forked from Creators-of-Create/Create
-
Notifications
You must be signed in to change notification settings - Fork 209
/
Copy pathbuild.gradle.kts
287 lines (249 loc) · 10.4 KB
/
build.gradle.kts
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
// versions
// https://parchmentmc.org/docs/getting-started
val parchmentVersion = "2023.09.03"
// https://fabricmc.net/develop/
val minecraftVersion = "1.20.1"
val loaderVersion = "0.16.9"
val fapiVersion = "0.92.3+1.20.1"
// in-house dependencies
val flywheelVersion = "1.0.0-217"
val ponderVersion = "1.0.36"
val registrateVersion = "1.3.79-MC1.20.1"
val milkLibVersion = "1.2.60"
val portLibVersion = "2.3.8+1.20.1"
val portLibModules = listOf(
"accessors", "base", "entity", "extensions", "networking", "obj_loader",
"tags", "transfer", "models", "tool_actions", "client_events", "brewing"
)
// external dependencies
val configApiVersion = "8.0.0"
val nightConfigVersion = "3.6.3"
// https://maven.jamieswhiteshirt.com/libs-release/com/jamieswhiteshirt/reach-entity-attributes/
val reaVersion = "2.4.0"
val jsr305Version = "3.0.2"
// compat
// https://modrinth.com/mod/cc-tweaked/versions
val ccVersion = "1.106.1"
// for CC - https://modrinth.com/mod/cloth-config/versions
val clothVersion = "11.1.106+fabric"
// https://modrinth.com/mod/jei/versions
val jeiVersion = "15.19.0.85"
// https://modrinth.com/mod/rei/versions
val reiVersion = "12.0.626"
// https://modrinth.com/mod/emi/versions
val emiVersion = "1.0.9+1.20.1"
// https://modrinth.com/mod/botania
val botaniaVersion = "1.19.2-436-FABRIC"
// https://modrinth.com/mod/modmenu/versions
val modmenuVersion = "7.1.0"
// https://modrinth.com/mod/sandwichable/versions
val sandwichableVersion = "1.3.1+1.20.1"
// https://modrinth.com/mod/sodium
val sodiumVersion = "mc1.20.1-0.5.8"
// https://modrinth.com/mod/indium
val indiumVersion = "1.0.30+mc1.20.4"
// https://github.com/emilyploszaj/trinkets/releases/
val trinketsVersion = "3.7.0"
// for Trinkets - https://modrinth.com/mod/cardinal-components-api/versions
val ccaVersion = "5.2.1"
// https://modrinth.com/mod/journeymap
val jmVersion = "1.20.1-5.10.3-fabric"
// check the jm jar, it's JiJ
val jmApiVersion = "1.20-1.9-SNAPSHOT"
// dev stuff
val ccRuntime = false
val recipeViewer = "emi" // jei, rei, or emi
plugins {
id("fabric-loom") version "1.9.+"
id("maven-publish")
}
val buildNum = providers.environmentVariable("GITHUB_RUN_NUMBER")
.filter(String::isNotEmpty)
.map { "-build.$it" }
.orElse("-local")
.getOrElse("")
version = "6.0.0.0+mc$minecraftVersion$buildNum"
group = "com.simibubi.create"
base.archivesName = "create-fabric"
repositories {
maven("https://maven.parchmentmc.org") // Parchment
maven("https://maven.fabricmc.net") // FAPI, Loader
maven("https://maven.createmod.net") // Ponder, Flywheel
maven("https://mvn.devos.one/snapshots") // Registrate, Forge Tags, Milk Lib
maven("https://mvn.devos.one/releases") // Porting Lib
maven("https://raw.githubusercontent.com/Fuzss/modresources/main/maven") // Forge Config API Port
maven("https://maven.shedaniel.me") // REI and deps
maven("https://api.modrinth.com/maven") { // LazyDFU, Sodium, Sandwichable
content { includeGroupAndSubgroups("maven.modrinth") }
}
maven("https://maven.terraformersmc.com") // Mod Menu, Trinkets
maven("https://squiddev.cc/maven") // CC:T
maven("https://modmaven.dev") // Botania
maven("https://maven.jamieswhiteshirt.com/libs-release") { // Reach Entity Attributes
content { includeGroup("com.jamieswhiteshirt") }
}
maven("https://maven.ladysnake.org/releases") // CCA, for Trinkets
maven("https://maven.saps.dev/releases") // FTB
maven("https://maven.architectury.dev") // Architectury API
maven("https://jm.gserv.me/repository/maven-public/") // Journey map
}
val ponder = file("Ponder")
dependencies {
// setup
minecraft("com.mojang:minecraft:$minecraftVersion")
mappings(loom.layered {
officialMojangMappings { nameSyntheticMembers = false }
parchment("org.parchmentmc.data:parchment-$minecraftVersion:$parchmentVersion@zip")
})
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
// dependencies
modImplementation("net.fabricmc.fabric-api:fabric-api:$fapiVersion")
for (module in portLibModules) {
modApi(include("io.github.fabricators_of_create.Porting-Lib:$module:$portLibVersion")!!)
}
modApi(include("com.tterrag.registrate_fabric:Registrate:$registrateVersion") {
exclude(mapOf("group" to "io.github.fabricators_of_create")) // avoid duplicate Porting Lib
})
modApi(include("com.electronwill.night-config:core:$nightConfigVersion")!!)
modApi(include("com.electronwill.night-config:toml:$nightConfigVersion")!!)
modApi(include("fuzs.forgeconfigapiport:forgeconfigapiport-fabric:$configApiVersion")!!)
modApi(include("dev.engine-room.flywheel:flywheel-fabric-$minecraftVersion:$flywheelVersion")!!)
modApi(include("com.jamieswhiteshirt:reach-entity-attributes:$reaVersion")!!)
modApi(include("io.github.tropheusj:milk-lib:$milkLibVersion")!!)
api(include("com.google.code.findbugs:jsr305:$jsr305Version")!!)
if (ponder.exists()) {
implementation("net.createmod.ponder:Ponder-Fabric-$minecraftVersion:$ponderVersion") { isTransitive = false }
implementation("net.createmod.ponder:Ponder-Common-$minecraftVersion:$ponderVersion")
} else {
modApi(include("net.createmod.ponder:Ponder-Fabric-$minecraftVersion:$ponderVersion")!!)
}
// compat
modCompileOnly("cc.tweaked:cc-tweaked-$minecraftVersion-fabric-api:$ccVersion")
modCompileOnly("vazkii.botania:Botania:$botaniaVersion") { isTransitive = false }
modCompileOnly("com.terraformersmc:modmenu:$modmenuVersion")
modCompileOnly("maven.modrinth:sandwichable:$sandwichableVersion")
modCompileOnly("maven.modrinth:sodium:$sodiumVersion")
modCompileOnly("dev.emi:trinkets:$trinketsVersion")
// for Trinkets
modCompileOnly("dev.onyxstudios.cardinal-components-api:cardinal-components-base:$ccaVersion")
modCompileOnly("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:$ccaVersion")
// FIXME - Use gradle.properties for these versions, make change to concealed for this
modCompileOnly("dev.architectury:architectury-fabric:9.1.12")
modCompileOnly("dev.ftb.mods:ftb-chunks-fabric:2001.3.1")
modCompileOnly("dev.ftb.mods:ftb-teams-fabric:2001.3.0")
modCompileOnly("dev.ftb.mods:ftb-library-fabric:2001.2.4")
modCompileOnly("maven.modrinth:journeymap:$jmVersion")
modCompileOnly("info.journeymap:journeymap-api:$jmApiVersion")
// EMI
modCompileOnly("dev.emi:emi-fabric:$emiVersion:api") { isTransitive = false }
// JEI
modCompileOnly("mezz.jei:jei-$minecraftVersion-fabric:$jeiVersion") { isTransitive = false }
// REI
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:$reiVersion")
modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:$reiVersion")
when (recipeViewer) {
"jei" -> modLocalRuntime("mezz.jei:jei-$minecraftVersion-fabric:$jeiVersion")
"rei" -> modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:$reiVersion")
"emi" -> modLocalRuntime("dev.emi:emi-fabric:$emiVersion")
}
// dev env
modLocalRuntime("com.terraformersmc:modmenu:$modmenuVersion")
modLocalRuntime("dev.emi:trinkets:$trinketsVersion") { isTransitive = false }
// for Trinkets
modLocalRuntime("dev.onyxstudios.cardinal-components-api:cardinal-components-base:$ccaVersion")
modLocalRuntime("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:$ccaVersion")
if (ccRuntime) {
modLocalRuntime("cc.tweaked:cc-tweaked-$minecraftVersion-fabric:$ccVersion")
modLocalRuntime("maven.modrinth:cloth-config:$clothVersion")
}
// have deprecated modules present at runtime only
modLocalRuntime("net.fabricmc.fabric-api:fabric-api-deprecated:$fapiVersion")
}
sourceSets.named("main") {
resources {
srcDir("src/generated/resources")
exclude(".cache/")
}
}
loom {
accessWidenerPath = file("src/main/resources/create.accesswidener")
runs {
register("datagen") {
client()
name("Data Generation")
vmArg("-Dfabric-api.datagen")
vmArg("-Dfabric-api.datagen.output-dir=${file("src/generated/resources")}")
vmArg("-Dfabric-api.datagen.modid=create")
vmArg("-Dporting_lib.datagen.existing_resources=${file("src/main/resources")}")
}
register("gametestServer") {
server()
name("Headlesss GameTests")
ideConfigGenerated(false) // this run is for CI
vmArg("-Dfabric-api.gametest")
vmArg("-Dfabric-api.gametest.report-file=${layout.buildDirectory}/junit.xml")
runDir("run/gametest")
}
named("server") {
runDir("run/server")
}
configureEach {
vmArg("-XX:+AllowEnhancedClassRedefinition")
vmArg("-XX:+IgnoreUnrecognizedVMOptions")
property("mixin.debug.export", "true")
}
}
}
configurations {
// this avoids remapping ponder when it's local
named("runtimeClasspath") {
attributes {
attribute(Attribute.of("create.marker", String::class.java), "h")
}
}
}
tasks.named<ProcessResources>("processResources") {
exclude("**/*.bbmodel", "**/*.lnk")
val properties: MutableMap<String, Any> = mutableMapOf(
"version" to version,
"minecraft_version" to minecraftVersion,
"loader_version" to loaderVersion,
"fabric_version" to fapiVersion,
"forge_config_version" to configApiVersion,
"milk_lib_version" to milkLibVersion,
"reach_entity_attributes_version" to reaVersion
)
for (module in portLibModules) {
properties["port_lib_${module}_version"] = portLibVersion
}
properties["port_lib_tags_version"] = "3.0" // the weird one
inputs.properties(properties)
filesMatching("fabric.mod.json") {
expand(properties)
}
}
java {
withSourcesJar()
}
tasks.named<JavaCompile>("compileJava") {
options.compilerArgs.add("-Xmaxerrs")
options.compilerArgs.add("10000")
}
publishing {
publications {
register<MavenPublication>("mavenJava") {
artifactId = "create-fabric-$minecraftVersion"
from(components["java"])
}
}
repositories {
maven("https://mvn.devos.one/releases") {
name = "devOsReleases"
credentials(PasswordCredentials::class)
}
maven("https://mvn.devos.one/snapshots") {
name = "devOsSnapshots"
credentials(PasswordCredentials::class)
}
}
}