11buildscript {
22 repositories {
33 maven { url = ' https://maven.minecraftforge.net' }
4- jcenter()
54 mavenCentral()
65 }
76
87 dependencies {
9- classpath " net.minecraftforge.gradle:ForgeGradle:4 .1.12 "
8+ classpath " net.minecraftforge.gradle:ForgeGradle:5 .1.+ "
109 }
1110}
1211
@@ -28,7 +27,7 @@ archivesBaseName = mod_id
2827println (" Mod ID: ${ mod_id} " );
2928println (" Version: ${ version} " );
3029
31- sourceCompatibility = targetCompatibility = compileJava . sourceCompatibility = compileJava . targetCompatibility = ' 1.8 ' // Need this here so eclipse task generates correctly.
30+ java . toolchain . languageVersion = JavaLanguageVersion . of( 8 )
3231
3332sourceSets {
3433 api {
@@ -139,7 +138,8 @@ minecraft {
139138 parent runs. server
140139
141140 workingDirectory project. file(' run/test' )
142- main ' com.alcatrazescapee.mcjunitlib.DedicatedTestServerLauncher' // The main class which launches a customized server which then runs JUnit tests
141+ main ' com.alcatrazescapee.mcjunitlib.DedicatedTestServerLauncher'
142+ // The main class which launches a customized server which then runs JUnit tests
143143 ideaModule " ${ project.name} .test"
144144 property ' forge.logging.console.level' , ' unittest'
145145 environment ' MOD_MODULES' , String . join(File . pathSeparator, " ${ mod_id} %%${ project.name} .test" )
@@ -161,7 +161,8 @@ minecraft {
161161 parent runs. server
162162
163163 workingDirectory project. file(' run/test' )
164- main ' com.alcatrazescapee.mcjunitlib.DedicatedTestServerLauncher' // The main class which launches a customized server which then runs JUnit tests
164+ main ' com.alcatrazescapee.mcjunitlib.DedicatedTestServerLauncher'
165+ // The main class which launches a customized server which then runs JUnit tests
165166 ideaModule " ${ project.name} .test"
166167 property ' forge.logging.console.level' , ' unittest'
167168 environment ' MOD_MODULES' , String . join(File . pathSeparator, " ${ mod_id} %%${ project.name} .test" )
@@ -220,15 +221,19 @@ repositories {
220221
221222 maven {
222223 name " MCJUnitLib - CM Github"
223- url = uri(" https://maven.pkg.github.com/CompactMods/mcjunitlib" )
224+ url = " https://maven.pkg.github.com/CompactMods/mcjunitlib"
225+ content {
226+ includeGroup " com.github.alcatrazEscapee"
227+ }
228+
224229 credentials {
225230 username = project. findProperty(" gpr.actor" ) ?: System . getenv(" GITHUB_ACTOR" )
226231 password = project. findProperty(" gpr.key" ) ?: System . getenv(" GITHUB_TOKEN" )
227232 }
228233 }
229234}
230235
231- def dev_mods = fileTree(dev_mods_dir ). filter { it -> it. isFile() }. files. name. collect( { format(it) } )
236+ def dev_mods = fileTree(" mods " ). filter { it -> it. isFile() }. files. name. collect({ format(it) })
232237
233238dependencies {
234239 // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
@@ -239,10 +244,7 @@ dependencies {
239244 testImplementation fg. deobf(" com.github.alcatrazEscapee:mcjunitlib:${ mcunittest_version} " )
240245
241246 // Deobfuscate each dev mod for runtime
242- dev_mods. each {
243- compileOnly fg. deobf(it)
244- runtimeOnly fg. deobf(it)
245- }
247+ dev_mods. each { implementation fg. deobf(it) }
246248
247249 // JEI
248250 compileOnly fg. deobf(" mezz.jei:jei-${ minecraft_version} :${ jei_version} :api" )
@@ -253,6 +255,10 @@ dependencies {
253255 runtimeOnly fg. deobf(" mcjty.theoneprobe:TheOneProbe-1.16:${ top_version} " )
254256}
255257
258+ processResources {
259+ duplicatesStrategy = DuplicatesStrategy . WARN
260+ }
261+
256262jar {
257263 from sourceSets. api. output
258264 from sourceSets. main. output
@@ -261,20 +267,19 @@ jar {
261267 finalizedBy(' reobfJar' )
262268 manifest {
263269 attributes([
264- " Specification-Title" : " compactcrafting" ,
265- " Specification-Vendor" : " robotgryphon" ,
266- " Specification-Version" : " 1" , // We are version 1 of ourselves
267- " Implementation-Title" : project. name,
268- " Implementation-Version" : isRelease ? archiveVersion : " nightly-${ gitCommitHash} " ,
269- " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
270+ " Specification-Title" : " compactcrafting" ,
271+ " Specification-Vendor" : " robotgryphon" ,
272+ " Specification-Version" : " 1" , // We are version 1 of ourselves
273+ " Implementation-Title" : project. name,
274+ " Implementation-Version" : isRelease ? archiveVersion : " nightly-${ gitCommitHash} " ,
275+ " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
270276 ])
271277 }
272278}
273279
274280task apiJar (type : Jar ) {
275281 // Sources included because of MinecraftForge/ForgeGradle#369
276282 from sourceSets. api. output
277- archiveClassifier = ' api'
278283 destinationDirectory = file(" $rootDir /build-out" )
279284}
280285
@@ -322,6 +327,6 @@ publishing {
322327
323328test {
324329 useJUnitPlatform() {
325- excludeTags " minecraft"
330+ excludeTags " minecraft"
326331 }
327332}
0 commit comments