Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
560 lines (471 loc) · 22.8 KB
/
Copy pathbuild.gradle
File metadata and controls
560 lines (471 loc) · 22.8 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
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
plugins {
id 'java-library'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.107'
id 'idea'
}
tasks.named('wrapper', Wrapper).configure {
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
distributionType = Wrapper.DistributionType.BIN
}
version = mod_version
group = mod_group_id
repositories {
maven {
name = 'cursemaven'
url = uri("https://www.cursemaven.com")
}
maven {
name = "Modmaven"
url = uri("https://modmaven.dev/")
}
maven {
url = uri("https://maven.architectury.dev/")
}
maven {
url = uri("https://maven.latvian.dev/releases/")
}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
maven {
name = "BlameJared"
url = "https://maven.blamejared.com"
}
maven {
name 'Thermal Maven'
url 'https://maven.covers1624.net/'
}
maven {
name = "TheIllusiveC4"
url = "https://maven.theillusivec4.top/"
}
maven {
name = "GeckoLib"
url = "https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/"
}
maven {
name = "FTB"
url = "https://maven.ftb.dev/releases"
}
maven {
name = "Kotlin for Forge"
url = "https://thedarkcolour.github.io/KotlinForForge/"
}
maven {
url = uri("https://jitpack.io")
}
// Astral Sorcery 及其硬前置 ObserverLib 仅在该仓库发布
maven {
name = "HellFirePvP Maven"
url = "https://maven.hellfiredev.net/"
content {
includeGroup "hellfirepvp.observerlib"
includeGroup "hellfirepvp.astralsorcery"
}
}
mavenCentral()
}
base {
archivesName = mod_id
}
// Mojang ships Java 21 to end users in 1.21.1, so mods should target Java 21.
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
neoForge {
// Specify the version of NeoForge to use.
version = project.neo_version
parchment {
mappingsVersion = project.parchment_mappings_version
minecraftVersion = project.parchment_minecraft_version
}
accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
client()
gameDirectory = project.file('run/client')
jvmArguments.addAll '-Xmx3G', '-Xms3G'
}
server {
server()
gameDirectory = project.file('run/server')
programArgument '--nogui'
jvmArguments.addAll '-Xmx3G', '-Xms3G'
}
data {
data()
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
// gameDirectory = project.file('run-data')
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
// applies to all the run configs above
configureEach {
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
systemProperty 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
logLevel = org.slf4j.event.Level.DEBUG
}
}
mods {
// define mod <-> source bindings
// these are used to tell the game which sources are for which mod
// multi mod projects should define one per mod
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
// ModDev adds Minecraft/NeoForge to main; JVM contract tests need those same classes.
sourceSets.test.compileClasspath += sourceSets.main.compileClasspath
sourceSets.test.runtimeClasspath += sourceSets.main.compileClasspath
configurations {
runtimeClasspath.extendsFrom localRuntime
}
def productiveBeesApi = configurations.create('productiveBeesApi') {
canBeConsumed = false
canBeResolved = true
transitive = false
}
def productiveLibJar = layout.buildDirectory.file(
'generated/productivebees-api/productivelib-1.21.1-0.2.0.jar'
)
def extractProductiveLib = tasks.register('extractProductiveLib', Copy) {
from { productiveBeesApi.collect { zipTree(it) } }
include 'META-INF/jarjar/productivelib-1.21.1-0.2.0.jar'
eachFile { details -> details.path = details.name }
includeEmptyDirs = false
into productiveLibJar.map { it.asFile.parentFile }
doLast {
if (!productiveLibJar.get().asFile.isFile()) {
throw new GradleException('Productive Bees did not contain ProductiveLib 1.21.1-0.2.0')
}
}
}
def productiveLibCompileFiles = files(productiveLibJar).builtBy(extractProductiveLib)
// Ender IO ships EnderCore, GraphLib and the optional conduit module as Jar-in-Jar
// libraries. NeoForge loads those libraries at runtime, but the nested jars are
// not exposed on the Java compile classpath by the Curse Maven artifact.
def enderIoApi = configurations.create('enderIoApi') {
canBeConsumed = false
canBeResolved = true
transitive = false
}
def enderIoApiDirectory = layout.buildDirectory.dir('generated/enderio-api')
def extractEnderIoApi = tasks.register('extractEnderIoApi', Copy) {
from { enderIoApi.collect { zipTree(it).matching { include 'META-INF/jarjar/*.jar' } } }
eachFile { details -> details.path = details.name }
includeEmptyDirs = false
into enderIoApiDirectory
}
def enderIoCompileFiles = files(
layout.buildDirectory.file('generated/enderio-api/com.enderio.endercore-8.2.11-beta.jar'),
layout.buildDirectory.file('generated/enderio-api/GraphLib3-3.0.5.jar'),
layout.buildDirectory.file('generated/enderio-api/com.enderio.enderio-modded-conduits-8.2.11-beta.jar')
).builtBy(extractEnderIoApi)
dependencies {
testImplementation platform('org.junit:junit-bom:5.11.4')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core:5.15.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation "mezz.jei:jei-1.21.1-neoforge:19.70.0.460"
compileOnly "curse.maven:ae2-jei-integration-1074338:7727898"
implementation "org.appliedenergistics:appliedenergistics2:19.2.18"
runtimeOnly "org.appliedenergistics:guideme:21.1.17"
runtimeOnly "de.mari_023:ae2wtlib_api:19.2.5"
compileOnly "curse.maven:oritech-1030830:8556549"
compileOnly "curse.maven:ufo-future-1372445:8372110"
compileOnly "curse.maven:immersive-engineering-231951:6733669"
compileOnly "curse.maven:extreme-reactors-250277:7344744"
compileOnly "curse.maven:neovitae-1404763:8690909"
compileOnly "curse.maven:athena-841890:8061947"
compileOnly "curse.maven:modern-industrialization-405388:8597392"
compileOnly "curse.maven:pneumaticcraft-repressurized-281849:8519226"
compileOnly "curse.maven:zerocore-247921:7344742"
compileOnly "curse.maven:sophisticated-core-618298:8838842"
compileOnly "curse.maven:sophisticated-storage-619320:8687896"
implementation "curse.maven:glodium-957920:5821676"
implementation "curse.maven:ex-pattern-provider-892005:8025439" // 2.2.32
implementation "curse.maven:applied-flux-965012:5614830"
// implementation "curse.maven:applied-flux-965012:7429565"
compileOnly "maven.modrinth:mega:4.11.0"
// 高级ae
// geckolib 不直接 import,但 Ars Nouveau 的方块实体类型实现了其 GeoBlockEntity,
// 编译期需在类路径上解析;开发运行仍需加载,故 compileOnly + runtimeOnly。
compileOnly "curse.maven:geckolib-388172:8350073"
runtimeOnly "curse.maven:geckolib-388172:8350073"
// Iron's Spells 'n Spellbooks and its required libraries
compileOnly "maven.modrinth:irons-spells-n-spellbooks:1.21.1-3.16.3"
compileOnly "maven.modrinth:irons-lib:1.21.1-2.1.0"
runtimeOnly "maven.modrinth:playeranimator:2.0.4+1.21.1-forge"
implementation "curse.maven:advancedae-1084104:8564177"
compileOnly "curse.maven:ae2addonlib-1366135:7222312"
compileOnly "curse.maven:item-obliterator-835861:6696097"
compileOnly "curse.maven:necronomicon-586157:5772683"
compileOnly "curse.maven:ae2-crystal-science-1435174:8498888" // 1.21.1-1.2.1
compileOnly "maven.modrinth:ae2-lightning-tech:2.1.0-beta.5"
compileOnly "maven.modrinth:thunderbolt-core:2.0.0-beta.4"
//implementation "curse.maven:data-energistics-1565514:8841396" // 1.21.1-3.2.2
//implementation"curse.maven:not-enough-dataenergitic-and-ae2lighteningtech-1671687:8752847"
//implementation"curse.maven:not-enough-dataenergitic-and-ae2lighteningtech-service-1671683:8752820"
//additionalRuntimeClasspath "curse.maven:not-enough-dataenergitic-and-ae2lighteningtech-service-1671683:8752820"
compileOnly "curse.maven:omnitool-1401075:8272031"
compileOnly "curse.maven:manaitaplus-legacy-1334654:8136932"
//powah
compileOnly "curse.maven:powah-rearchitected-633483:8011715"
compileOnly "maven.modrinth:9s6osm5g:izKINKFg"
runtimeOnly "top.theillusivec4.curios:curios-neoforge:9.5.1+1.21.1"
implementation "top.theillusivec4.curios:curios-neoforge:9.5.1+1.21.1:api"
//合成拓展
compileOnly "maven.modrinth:5JMG1gql:Pb2OHQ8E"
compileOnly "maven.modrinth:Rw1NrDzF:8421rqFF"
implementation "curse.maven:jade-324717:8591319"
//龙之研究
compileOnly "curse.maven:codechicken-lib-1-8-242818:7281427"
compileOnly "curse.maven:brandons-core-231382:7130990"
compileOnly "curse.maven:draconic-evolution-223565:7584459"
runtimeOnly "de.mari_023:ae2wtlib:19.5.1"
//资源蜜蜂
// Productive Bees 1.21.1-13.13.5. ProductiveLib is embedded with JarJar,
// so expose the nested jar separately on the production compile classpath.
add(productiveBeesApi.name, "curse.maven:productivebees-377897:8022994")
compileOnly "curse.maven:productivebees-377897:8022994"
runtimeOnly "curse.maven:productivebees-377897:8022994"
compileOnly productiveLibCompileFiles
add(enderIoApi.name, "curse.maven:ender-io-64578:8192838")
compileOnly enderIoCompileFiles
//eco
compileOnly "curse.maven:neo-eco-ae-extension-1460639:8983610"
// LDLib2 同时供本地编译(源码直接引用其 GUI/RPC 类型)与运行时使用:
// OmniSequence 在运行时强制要求 ldlib2 存在,缺失会导致整包加载失败。
compileOnly "maven.modrinth:ldlib:mc1.21.1-2.2.44-neoforge"
runtimeOnly "maven.modrinth:ldlib:mc1.21.1-2.2.44-neoforge"
// 实用拓展
compileOnly "maven.modrinth:actually-additions:1.3.22"
// 工业先锋
compileOnly "maven.modrinth:titanium:1.21-4.0.40"
compileOnly "curse.maven:industrial-foregoing-266515:7073719"
compileOnly "curse.maven:mifa-1086142:6288756"
compileOnly "curse.maven:industrial-foregoing-extra-upgrades-1161049:8428353"
// 新生魔艺
compileOnly "curse.maven:ars-nouveau-401955:8152094"
compileOnly "curse.maven:ars-energistique-905641:6203425"
compileOnly "curse.maven:just-dire-things-1002348:7463040"
compileOnly "curse.maven:jdte-1566414:8776309"
//禁忌与奥秘
compileOnly "curse.maven:forbidden-arcanus-309858:6875895"
compileOnly "curse.maven:valhelsia-core-416935:6296775"
implementation "mekanism:Mekanism:1.21.1-10.7.19.85"
implementation "mekanism:Mekanism:1.21.1-10.7.19.85:generators"
compileOnly "curse.maven:applied-mekanistics-574300:7096962"
compileOnly "maven.modrinth:mekanism_extra:1.21.1-1.4.1"
compileOnly "curse.maven:flux-networks-248020:6089446"
compileOnly "maven.modrinth:mekanismmoremachine:1.21.1-1.4.1"
compileOnly "curse.maven:flux-networks-248020:6089446"
compileOnly "curse.maven:the-twilight-forest-227639:7797302"
compileOnly "curse.maven:botany-pots-353928:7115287"
compileOnly "curse.maven:create-328085:7963363"
compileOnly "curse.maven:bookshelf-228525:7115332"
compileOnly "maven.modrinth:prickle:EE1FHDyD"
runtimeOnly "curse.maven:allthemodium-364466:7974403"
runtimeOnly "curse.maven:ato-405593:7825464"
// runtimeOnly "maven.modrinth:allthemodium:2.9.5"
implementation "maven.modrinth:extendedae-plus:1.6.4"
// runtimeOnly "maven.modrinth:omnitools:1.21.1-1.2.1"
implementation "curse.maven:ftb-ultimine-forge-386134:8231400"
// 神秘农业
compileOnly "curse.maven:cucumber-272335:8035802"
compileOnly "curse.maven:mystical-agriculture-246640:8035819"
compileOnly "curse.maven:mystical-agradditions-256247:8515974"
compileOnly "maven.modrinth:hostile-neural-networks:1.21.1-6.5.1"
compileOnly "maven.modrinth:ex-deorum:3.12"
//自然灵气
compileOnly "maven.modrinth:natures-aura:41.9"
runtimeOnly "maven.modrinth:patchouli:1.21.1-93-neoforge"
// Occultism is an optional runtime integration. Keep it off the production
// dependency graph while exposing its API for compilation and local development.
def occultism = "maven.modrinth:occultism:1.21.1-neoforge-1.205.0"
def modonomicon = "maven.modrinth:modonomicon:1.21.1-1.117.2"
def smartBrainLib = "maven.modrinth:smartbrainlib:O5EpeqI3"
compileOnly occultism
compileOnly modonomicon
compileOnly smartBrainLib
if (!project.hasProperty('withoutOccultism')) {
localRuntime occultism
localRuntime modonomicon
localRuntime smartBrainLib
}
// kjs
// KubeJS is optional at runtime; the plugin is discovered only when KubeJS is installed.
compileOnly "dev.latvian.mods:rhino:2101.2.7-build.77"
compileOnly "dev.latvian.mods:kubejs-neoforge:2101.7.2-build.336"
implementation "curse.maven:ftb-library-forge-404465:8858846"
implementation "curse.maven:architectury-api-419699:8492726"
implementation "curse.maven:ftb-teams-forge-404468:8724782"
implementation "curse.maven:ftb-chunks-forge-314906:8791113"
//性能
runtimeOnly "maven.modrinth:observable:5.4.4+neoforge"
//eio
compileOnly "curse.maven:ender-io-64578:8192838"
//灵灾
compileOnly "maven.modrinth:malum:1.8.2"
compileOnly "maven.modrinth:bN3xUWdo:CohX6yP1"
compileOnly "maven.modrinth:summoningrituals:1.21.1-3.14.2+neoforge"
compileOnly "maven.modrinth:re-avaritia:1.21.1-1.4.1-release"
// 龙研
compileOnly "com.brandon3055.brandonscore:BrandonsCore:1.21.1-3.2.1.309"
compileOnly "com.brandon3055.draconicevolution:Draconic-Evolution:1.21.1-3.1.4.632"
// compileOnly "maven.modrinth:gregtechceu-modern:mc1.21.1-7.0.1"
compileOnly "maven.modrinth:configuration:6Mztfq1u"
runtimeOnly "curse.maven:configured-457570:7276577"
// Kotlin 运行时由若干 Kotlin 编写的模组(Observable、Configured 等)在运行时依赖;
// 本项目源码不 import 其类型,故仅需 runtimeOnly。
// 注意:thedarkcolour:kotlinforforge-neoforge 的 MANIFEST 为 FMLModType: LIBRARY,
// 它把 Kotlin 运行时与 kotlinx.serialization 放在 META-INF/jarjar 内嵌,
// 开发环境下这些内嵌 jar 不会展开到 classpath,必须显式声明,
// 否则 Observable 会因 ClassNotFoundException: kotlinx.serialization.json.JsonElement 崩溃。
runtimeOnly "thedarkcolour:kotlinforforge-neoforge:5.11.0"
// 用 JVM 实构件坐标而非 KMP 元数据坐标 kotlinx-serialization-json:1.9.0:
// 后者的 pom 会牵引 kotlinx-serialization-bom,而该 bom 仅由 maven.neoforged.net 提供,
// 本机访问该仓库超时会导致解析失败。json-jvm 由 Maven Central 直接提供 pom 与 jar。
runtimeOnly "org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.9.0"
implementation "curse.maven:just-enough-characters-250702:8413478"
compileOnly "curse.maven:apotheosis-313970:8564919"
compileOnly "curse.maven:apothic-spawners-986583:8469405"
compileOnly "curse.maven:placebo-283644:8463693"
compileOnly "curse.maven:apothic-enchanting-1063926:8682996"
compileOnly "curse.maven:apothic-attributes-898963:8502288"
// runtimeOnly "curse.maven:gateways-to-eternity-417802:6926284"
compileOnly "curse.maven:apothic-flux-1483497:8820187"
// Lychee
compileOnly "maven.modrinth:lychee:6.7.0+neoforge"
compileOnly "maven.modrinth:kiwi:15.8.7+neoforge"
implementation "curse.maven:omnisequence-transfinite-1624558:8991983"
// AppliedEnhancements 同时供本地编译(源码直接引用其规划器类型)与运行时使用:
// OmniSequence(mod id molecularmanipulator)在运行时强制要求 appliedenhancements
// 存在,缺失会导致整包加载失败。
compileOnly "curse.maven:applied-enhancements-1665696:8990232"
runtimeOnly "curse.maven:applied-enhancements-1665696:8990232"
compileOnly "curse.maven:applied-pneumatics-1355087:8812885"
compileOnly "curse.maven:mystical-agriculture-omnia-1684008:8824904"
// 乐事系列
compileOnly "maven.modrinth:farmers-delight:1.21.1-1.3.3"
compileOnly "maven.modrinth:ends-delight:2.6.1+neoforge.1.21.1"
compileOnly "maven.modrinth:enders-delight:1.3.1"
compileOnly "maven.modrinth:crabbers-delight:1.2.6"
compileOnly "maven.modrinth:ubes-delight:neoforge-1.21.1-0.4.14"
compileOnly "curse.maven:barbeques-delight-1007788:8004721"
compileOnly "curse.maven:gensokyo-delight-youkais-feasts-1309991:8004770"
compileOnly "curse.maven:casualness-delight-909519:7467708"
compileOnly "curse.maven:cultural-delights-574622:8126191"
compileOnly "maven.modrinth:expanded-delight:0.1.4-neoforge"
compileOnly "maven.modrinth:extradelight:2.6.6"
compileOnly "maven.modrinth:brewin-and-chewin:4.5.0+1.21.1-neoforge"
compileOnly "maven.modrinth:nomads-delight:1.0.2"
// 森罗物语
compileOnly "maven.modrinth:kaleidoscope-cookery:1.4.1-neoforge+mc1.21.1"
compileOnly "maven.modrinth:kaleidoscope-grilling:ao5iN7Jb"
compileOnly "maven.modrinth:kaleidoscopetavern:1.2.0-neoforge+mc1.21.1"
// 星辉魔法及其硬前置 ObserverLib
compileOnly "hellfirepvp.observerlib:ObserverLib:1.10.3.31"
compileOnly "hellfirepvp.astralsorcery:AstralSorcery:2.0.2.40"
// // 集成动力
// runtimeOnly "maven.modrinth:cyclops-core:RjMKI4zG"
// runtimeOnly "maven.modrinth:common-capabilities:c50bCinZ"
// runtimeOnly "maven.modrinth:integrated-dynamics:JK4qvMtw"
//
// // Refined Storage
// runtimeOnly "maven.modrinth:refined-storage:lHHiI26k"
compileOnly fileTree(dir: 'libs', includes: ['*.jar'], excludes: [])
compileOnly fileTree(dir: 'libs/compile', includes: ['*.jar'], excludes: [])
// 仅用于开发环境实机测试的兼容模组:不参与编译,编译期类型仍来自 libs/compile。
runtimeOnly fileTree(dir: 'libs/runtime', includes: ['*.jar'], excludes: [])
}
// This block of code expands all declared replace properties in the specified resource targets.
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
var replaceProperties = [
minecraft_version : minecraft_version,
minecraft_version_range: minecraft_version_range,
neo_version : neo_version,
loader_version_range : loader_version_range,
mod_id : mod_id,
mod_name : mod_name,
mod_license : mod_license,
mod_version : mod_version,
mod_authors : mod_authors,
mod_description : mod_description
]
inputs.properties replaceProperties
expand replaceProperties
from "src/main/templates"
into "build/generated/sources/modMetadata"
}
// Include the output of "generateModMetadata" as an input directory for the build
// this works with both building through Gradle and the IDE.
sourceSets.main.resources.srcDir generateModMetadata
// To avoid having to run "generateModMetadata" manually, make it run on every project reload
neoForge.ideSyncTask generateModMetadata
neoForge.ideSyncTask extractProductiveLib
neoForge.ideSyncTask extractEnderIoApi
// 分发包内一并带上许可证全文:根目录 LICENSE(代码 MIT)与 LICENSES/ 下的
// 资源 ARR 声明及第三方许可证。assets/ 与 xia/ 内的 LICENSE.txt 由 processResources 自动打包。
tasks.named('jar', Jar).configure {
from('LICENSE')
from('LICENSES') {
into 'LICENSES'
}
}
// Example configuration to allow publishing using the maven-publish plugin
publishing {
publications {
register('mavenJava', MavenPublication) {
from components.java
}
}
repositories {
maven {
url "file://${project.projectDir}/repo"
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
tasks.named('test', Test) {
useJUnitPlatform()
maxHeapSize = '2G'
workingDir = layout.buildDirectory.dir('test-run').get().asFile
doFirst { workingDir.mkdirs() }
// Keep compilation on the declared ECO API while testing the same bytecode
// against a user's newer runtime: -PneoEcoRuntimeJar=/path/to/neoecoae.jar
def ecoRuntimeJar = providers.gradleProperty('neoEcoRuntimeJar')
if (ecoRuntimeJar.isPresent()) {
classpath = classpath.filter {
!it.name.startsWith('neo-eco-ae-extension-1460639-')
} + files(ecoRuntimeJar.get())
reports.junitXml.outputLocation = layout.buildDirectory.dir('test-results/neoecoae-runtime')
reports.html.outputLocation = layout.buildDirectory.dir('reports/tests/neoecoae-runtime')
}
}
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}