2020 * SOFTWARE.
2121 */
2222
23+ import java.time.LocalDateTime
2324import java.time.format.DateTimeFormatter
2425
2526plugins {
2627 java
2728 `maven- publish`
28- id(" fabric-loom" ) version " 0.12 -SNAPSHOT"
29- id(" org.cadixdev.licenser" ) version " 0.6.1"
29+ id(" fabric-loom" ) version( " 1.0 -SNAPSHOT" )
30+ id(" org.cadixdev.licenser" ) version( " 0.6.1" )
3031 id(" io.github.juuxel.loom-quiltflower" ) version(" 1.7.3" )
3132}
3233
34+ val buildNumber = System .getenv(" BUILD_NUMBER" ) ? : " "
35+ val prerelease = (System .getenv(" PRE_RELEASE" ) ? : " false" ) == " true"
36+
3337val modId = project.property(" mod.id" ).toString()
3438val modVersion = project.property(" mod.version" ).toString()
3539val modName = project.property(" mod.name" ).toString()
@@ -50,16 +54,10 @@ java {
5054 targetCompatibility = JavaVersion .VERSION_17
5155 sourceCompatibility = JavaVersion .VERSION_17
5256
57+ withSourcesJar()
5358 withJavadocJar()
5459}
5560
56- sourceSets {
57- create(" gametest" ) {
58- compileClasspath + = main.get().compileClasspath + main.get().output;
59- runtimeClasspath + = main.get().runtimeClasspath + main.get().output;
60- }
61- }
62-
6361loom {
6462 accessWidenerPath.set(project.file(" src/main/resources/${modId} .accesswidener" ))
6563 mixin {
@@ -71,21 +69,21 @@ loom {
7169 sourceSet(sourceSets.main.get())
7270 }
7371 create(" gc-api-test" ) {
74- sourceSet(sourceSets.getByName( " gametest " ))
72+ sourceSet(sourceSets.test.get( ))
7573 }
7674 }
7775
7876 runs {
7977 register(" gametest" ) {
8078 server()
8179 name(" Game Test" )
82- source(sourceSets.getByName( " gametest " ))
80+ source(sourceSets.test.get( ))
8381 vmArgs(" -Dfabric-api.gametest" , " -Dfabric-api.gametest.report-file=${project.buildDir} /junit.xml" , " -ea" )
8482 }
8583 register(" gametestClient" ) {
8684 server()
8785 name(" Game Test Client" )
88- source(sourceSets.getByName( " gametest " ))
86+ source(sourceSets.test.get( ))
8987 vmArgs(" -Dfabric-api.gametest" , " -Dfabric-api.gametest.report-file=${project.buildDir} /junit.xml" , " -ea" )
9088 }
9189 }
@@ -138,12 +136,14 @@ tasks.jar {
138136 from(" LICENSE" )
139137 manifest {
140138 attributes(
141- " Implementation-Title" to modName,
142- " Implementation-Version" to " ${project.version} " ,
143- " Implementation-Vendor" to " Team Galacticraft" ,
144- " Implementation-Timestamp" to DateTimeFormatter .ISO_DATE_TIME ,
145- " Maven-Artifact" to " ${project.group} :${modName} :${project.version} " ,
146- " ModSide" to " BOTH"
139+ " Specification-Title" to modName,
140+ " Specification-Vendor" to " Team Galacticraft" ,
141+ " Specification-Version" to modVersion,
142+ " Implementation-Title" to project.name,
143+ " Implementation-Version" to " ${project.version} " ,
144+ " Implementation-Vendor" to " Team Galacticraft" ,
145+ " Implementation-Timestamp" to LocalDateTime .now().format(DateTimeFormatter .ISO_DATE_TIME ),
146+ " Built-On-Java" to " ${System .getProperty(" java.vm.version" )} (${System .getProperty(" java.vm.vendor" )} )"
147147 )
148148 }
149149}
@@ -185,9 +185,3 @@ license {
185185 set(" company" , " Team Galacticraft" )
186186 }
187187}
188-
189- tasks.named<ProcessResources >(" processGametestResources" ) {
190- duplicatesStrategy = DuplicatesStrategy .WARN
191- }
192-
193- tasks.getByName(" gametestClasses" ).dependsOn(" classes" )
0 commit comments