Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

Commit 15a327c

Browse files
committed
change: move tests into default test source set
update machinelib add more manifest attributes
1 parent 17cb514 commit 15a327c

File tree

12 files changed

+50
-29
lines changed

12 files changed

+50
-29
lines changed

.github/workflows/build.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,20 @@ jobs:
2222
java-version: 17
2323
distribution: temurin
2424

25+
- name: License headers
26+
id: license_headers
27+
uses: gradle/gradle-build-action@v2
28+
with:
29+
arguments: checkLicenses
30+
2531
- name: Build
2632
id: build
2733
uses: gradle/gradle-build-action@v2
2834
with:
29-
arguments: checkLicenses build runGametest
35+
arguments: build
36+
37+
- name: Gametest
38+
id: gametest
39+
uses: gradle/gradle-build-action@v2
40+
with:
41+
arguments: runGametest

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Build
3737
uses: gradle/gradle-build-action@v2
3838
with:
39-
arguments: checkLicenses build
39+
arguments: build
4040

4141
- name: Perform CodeQL Analysis
4242
uses: github/codeql-action/analyze@v2

.github/workflows/pr_check.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Pull Request Check
33
on:
44
pull_request:
55
types: [ synchronize, opened ]
6+
branches:
7+
- main
68

79
jobs:
810
Build:
@@ -21,7 +23,20 @@ jobs:
2123
java-version: 17
2224
distribution: temurin
2325

26+
- name: License headers
27+
id: license_headers
28+
uses: gradle/gradle-build-action@v2
29+
with:
30+
arguments: checkLicenses
31+
2432
- name: Build
33+
id: build
34+
uses: gradle/gradle-build-action@v2
35+
with:
36+
arguments: build
37+
38+
- name: Gametest
39+
id: gametest
2540
uses: gradle/gradle-build-action@v2
2641
with:
27-
arguments: checkLicenses build runGametest
42+
arguments: runGametest

build.gradle.kts

+18-24
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,20 @@
2020
* SOFTWARE.
2121
*/
2222

23+
import java.time.LocalDateTime
2324
import java.time.format.DateTimeFormatter
2425

2526
plugins {
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+
3337
val modId = project.property("mod.id").toString()
3438
val modVersion = project.property("mod.version").toString()
3539
val 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-
6361
loom {
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")

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx3G
33
# Mod Information
44
mod.id=galacticraft-api
55
mod.name=GalacticraftAPI
6-
mod.version=0.4.0-prealpha.24
6+
mod.version=0.4.0-prealpha.25
77
mod.group=dev.galacticraft
88

99
# Minecraft and Fabric Loader
@@ -12,5 +12,5 @@ loader.version=0.14.9
1212

1313
# Mod Dependencies
1414
fabric.version=0.60.0+1.19.2
15-
machinelib.version=0.1.0+1.19.2
15+
machinelib.version=0.1.0+eaeb4e6f
1616
dyndims.version=0.3.0
File renamed without changes.

0 commit comments

Comments
 (0)