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 commitHash = (System .getenv(" GITHUB_SHA" ) ? : grgit.head().id)!!
36+ val prerelease = (System .getenv(" PRE_RELEASE" ) ? : " false" ) == " true"
37+
3338val modId = project.property(" mod.id" ).toString()
3439val modVersion = project.property(" mod.version" ).toString()
3540val modName = project.property(" mod.name" ).toString()
@@ -50,16 +55,10 @@ java {
5055 targetCompatibility = JavaVersion .VERSION_17
5156 sourceCompatibility = JavaVersion .VERSION_17
5257
58+ withSourcesJar()
5359 withJavadocJar()
5460}
5561
56- sourceSets {
57- create(" gametest" ) {
58- compileClasspath + = main.get().compileClasspath + main.get().output;
59- runtimeClasspath + = main.get().runtimeClasspath + main.get().output;
60- }
61- }
62-
6362loom {
6463 accessWidenerPath.set(project.file(" src/main/resources/${modId} .accesswidener" ))
6564 mixin {
@@ -71,21 +70,21 @@ loom {
7170 sourceSet(sourceSets.main.get())
7271 }
7372 create(" gc-api-test" ) {
74- sourceSet(sourceSets.getByName( " gametest " ))
73+ sourceSet(sourceSets.test.get( ))
7574 }
7675 }
7776
7877 runs {
7978 register(" gametest" ) {
8079 server()
8180 name(" Game Test" )
82- source(sourceSets.getByName( " gametest " ))
81+ source(sourceSets.test.get( ))
8382 vmArgs(" -Dfabric-api.gametest" , " -Dfabric-api.gametest.report-file=${project.buildDir} /junit.xml" , " -ea" )
8483 }
8584 register(" gametestClient" ) {
8685 server()
8786 name(" Game Test Client" )
88- source(sourceSets.getByName( " gametest " ))
87+ source(sourceSets.test.get( ))
8988 vmArgs(" -Dfabric-api.gametest" , " -Dfabric-api.gametest.report-file=${project.buildDir} /junit.xml" , " -ea" )
9089 }
9190 }
@@ -138,12 +137,14 @@ tasks.jar {
138137 from(" LICENSE" )
139138 manifest {
140139 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"
140+ " Specification-Title" to modName,
141+ " Specification-Vendor" to " Team Galacticraft" ,
142+ " Specification-Version" to modVersion,
143+ " Implementation-Title" to project.name,
144+ " Implementation-Version" to " ${project.version} " ,
145+ " Implementation-Vendor" to " Team Galacticraft" ,
146+ " Implementation-Timestamp" to LocalDateTime .now().format(DateTimeFormatter .ISO_DATE_TIME ),
147+ " Built-On-Java" to " ${System .getProperty(" java.vm.version" )} (${System .getProperty(" java.vm.vendor" )} )"
147148 )
148149 }
149150}
@@ -185,9 +186,3 @@ license {
185186 set(" company" , " Team Galacticraft" )
186187 }
187188}
188-
189- tasks.named<ProcessResources >(" processGametestResources" ) {
190- duplicatesStrategy = DuplicatesStrategy .WARN
191- }
192-
193- tasks.getByName(" gametestClasses" ).dependsOn(" classes" )
0 commit comments