Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
166 lines (141 loc) · 4.98 KB
/
Copy pathbuild.gradle
File metadata and controls
166 lines (141 loc) · 4.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id "java"
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
}
apply from: "build_dep_ver.gradle"
def patreon_api_key = rootProject.properties.containsKey("patreonApiKey") ? rootProject.getProperties().get("patreonApiKey").toString() : ""
rootProject.ext.variation = rootProject.properties.containsKey("variation") ? rootProject.getProperties().get("variation").toString() : "normal"
rootProject.ext.variation_header = rootProject.variation == "normal" ? "NeoMTR" : rootProject.variation == "server" ? "NeoMTR-server" : "Modern-Elevators-Escalators"
architectury {
minecraft = minecraft_version
}
configure(subprojects.findAll {it.name != 'rhino'}) {
apply plugin: "dev.architectury.loom"
apply plugin: "com.github.johnrengelman.shadow"
loom {
silentMojangMappingsLicense()
mixin {
useLegacyMixinAp = true
defaultRefmapName = "mixins.mtr.refmap.json"
}
}
configurations {
shadowCommon
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${parchment_minecraft_version}:${parchment_version}@zip")
}
implementation name: "Dynmap-3.2.1"
implementation name: "BlueMapAPI-2.1.1"
implementation "xyz.jpenilla:squaremap-api:+"
implementation "org.eclipse.jetty:jetty-http:9.+"
implementation "org.eclipse.jetty:jetty-io:9.+"
implementation "org.eclipse.jetty:jetty-security:9.+"
implementation "org.eclipse.jetty:jetty-server:9.+"
implementation "org.eclipse.jetty:jetty-servlet:9.+"
implementation "org.eclipse.jetty:jetty-util:9.+"
implementation "org.eclipse.jetty:jetty-util-ajax:9.+"
implementation "javax.servlet:javax.servlet-api:+"
implementation "org.msgpack:msgpack-core:+"
implementation "com.hierynomus:sshj:+"
implementation "com.github.jonafanho:Minecraft-Mod-API-Tools:${rootProject.minecraft_mod_api_tools_version}"
shadowCommon "org.eclipse.jetty:jetty-http:9.+"
shadowCommon "org.eclipse.jetty:jetty-io:9.+"
shadowCommon "org.eclipse.jetty:jetty-security:9.+"
shadowCommon "org.eclipse.jetty:jetty-server:9.+"
shadowCommon "org.eclipse.jetty:jetty-servlet:9.+"
shadowCommon "org.eclipse.jetty:jetty-util:9.+"
shadowCommon "org.eclipse.jetty:jetty-util-ajax:9.+"
shadowCommon "javax.servlet:javax.servlet-api:+"
shadowCommon "org.msgpack:msgpack-core:+"
implementation project(":rhino")
shadowCommon project(":rhino")
}
}
tasks.register("setupFiles") {
// copy {
// outputs.upToDateWhen { false }
// from(zipTree("common/src/main/java/mtr/mappings/lang.zip"))
// into "common/src/main/resources/assets/mtr/lang"
// }
copy {
outputs.upToDateWhen { false }
from "common/src/main/KeysTemplate.java"
into "common/src/main/java/mtr"
filter(ReplaceTokens, tokens: ["key": patreon_api_key, "version": rootProject.mod_version + "+" + minecraft_version, "lifts": rootProject.variation])
rename "(.+)Template.java", "\$1.java"
}
copy {
outputs.upToDateWhen { false }
from "common/src/main/latest.json"
into "build/latest"
filter(ReplaceTokens, tokens: ["version": rootProject.mod_version])
}
copy {
outputs.upToDateWhen { false }
from "common/src/main/version-template.js"
into "common/src/main/resources/assets/mtr/website"
filter(ReplaceTokens, tokens: ["version": minecraft_version + "-" + rootProject.mod_version])
rename "(.+)-template.js", "\$1.js"
}
}
configure(allprojects.findAll {it.name != 'rhino'}) {
apply plugin: "architectury-plugin"
version = rootProject.mod_version + "+" + minecraft_version
group = rootProject.maven_group
repositories {
maven { url "https://maven.neoforged.net/releases/" }
maven { url = "https://jitpack.io/" }
maven { url = "https://maven.terraformersmc.com/" }
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
flatDir {
dirs "../libs"
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
afterEvaluate {
for (def task in it.tasks) {
if (task != rootProject.tasks.setupFiles) {
task.dependsOn rootProject.tasks.setupFiles
}
}
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
withSourcesJar()
withJavadocJar()
}
import org.gradle.api.internal.file.copy.CopyAction;
import org.gradle.api.internal.file.copy.CopyActionProcessingStream;
class DummyArchiveTask extends AbstractArchiveTask {
protected CopyAction createCopyAction() {
return new DummyCopyAction();
}
class DummyCopyAction implements CopyAction {
@Override
WorkResult execute(CopyActionProcessingStream stream) {
return WorkResults.didWork(true);
}
}
}
task dummyForgeOutput(type: DummyArchiveTask) {
// This is to make github.com/teaconmc/longjing happy.
destinationDirectory = file("build/release/")
archiveBaseName = "NeoMTR-neoforge"
archiveVersion = rootProject.mod_version + "+" + minecraft_version
archiveExtension = "jar"
}