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

Commit

Permalink
change: move tests into default test source set
Browse files Browse the repository at this point in the history
update machinelib
add more manifest attributes
  • Loading branch information
marcus8448 committed Aug 30, 2022
1 parent 17cb514 commit 33bfa1e
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 29 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,20 @@ jobs:
java-version: 17
distribution: temurin

- name: License headers
id: license_headers
uses: gradle/gradle-build-action@v2
with:
arguments: checkLicenses

- name: Build
id: build
uses: gradle/gradle-build-action@v2
with:
arguments: checkLicenses build runGametest
arguments: build

- name: Gametest
id: gametest
uses: gradle/gradle-build-action@v2
with:
arguments: runGametest
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: checkLicenses build
arguments: build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
17 changes: 16 additions & 1 deletion .github/workflows/pr_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Pull Request Check
on:
pull_request:
types: [ synchronize, opened ]
branches:
- main

jobs:
Build:
Expand All @@ -21,7 +23,20 @@ jobs:
java-version: 17
distribution: temurin

- name: License headers
id: license_headers
uses: gradle/gradle-build-action@v2
with:
arguments: checkLicenses

- name: Build
id: build
uses: gradle/gradle-build-action@v2
with:
arguments: build

- name: Gametest
id: gametest
uses: gradle/gradle-build-action@v2
with:
arguments: checkLicenses build runGametest
arguments: runGametest
43 changes: 19 additions & 24 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@
* SOFTWARE.
*/

import java.time.LocalDateTime
import java.time.format.DateTimeFormatter

plugins {
java
`maven-publish`
id("fabric-loom") version "0.12-SNAPSHOT"
id("org.cadixdev.licenser") version "0.6.1"
id("fabric-loom") version("1.0-SNAPSHOT")
id("org.cadixdev.licenser") version("0.6.1")
id("io.github.juuxel.loom-quiltflower") version("1.7.3")
}

val buildNumber = System.getenv("BUILD_NUMBER") ?: ""
val commitHash = (System.getenv("GITHUB_SHA") ?: grgit.head().id)!!
val prerelease = (System.getenv("PRE_RELEASE") ?: "false") == "true"

val modId = project.property("mod.id").toString()
val modVersion = project.property("mod.version").toString()
val modName = project.property("mod.name").toString()
Expand All @@ -50,16 +55,10 @@ java {
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17

withSourcesJar()
withJavadocJar()
}

sourceSets {
create("gametest") {
compileClasspath += main.get().compileClasspath + main.get().output;
runtimeClasspath += main.get().runtimeClasspath + main.get().output;
}
}

loom {
accessWidenerPath.set(project.file("src/main/resources/${modId}.accesswidener"))
mixin {
Expand All @@ -71,21 +70,21 @@ loom {
sourceSet(sourceSets.main.get())
}
create("gc-api-test") {
sourceSet(sourceSets.getByName("gametest"))
sourceSet(sourceSets.test.get())
}
}

runs {
register("gametest") {
server()
name("Game Test")
source(sourceSets.getByName("gametest"))
source(sourceSets.test.get())
vmArgs("-Dfabric-api.gametest", "-Dfabric-api.gametest.report-file=${project.buildDir}/junit.xml", "-ea")
}
register("gametestClient") {
server()
name("Game Test Client")
source(sourceSets.getByName("gametest"))
source(sourceSets.test.get())
vmArgs("-Dfabric-api.gametest", "-Dfabric-api.gametest.report-file=${project.buildDir}/junit.xml", "-ea")
}
}
Expand Down Expand Up @@ -138,12 +137,14 @@ tasks.jar {
from("LICENSE")
manifest {
attributes(
"Implementation-Title" to modName,
"Implementation-Version" to "${project.version}",
"Implementation-Vendor" to "Team Galacticraft",
"Implementation-Timestamp" to DateTimeFormatter.ISO_DATE_TIME,
"Maven-Artifact" to "${project.group}:${modName}:${project.version}",
"ModSide" to "BOTH"
"Specification-Title" to modName,
"Specification-Vendor" to "Team Galacticraft",
"Specification-Version" to modVersion,
"Implementation-Title" to project.name,
"Implementation-Version" to "${project.version}",
"Implementation-Vendor" to "Team Galacticraft",
"Implementation-Timestamp" to LocalDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME),
"Built-On-Java" to "${System.getProperty("java.vm.version")} (${System.getProperty("java.vm.vendor")})"
)
}
}
Expand Down Expand Up @@ -185,9 +186,3 @@ license {
set("company", "Team Galacticraft")
}
}

tasks.named<ProcessResources>("processGametestResources") {
duplicatesStrategy = DuplicatesStrategy.WARN
}

tasks.getByName("gametestClasses").dependsOn("classes")
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx3G
# Mod Information
mod.id=galacticraft-api
mod.name=GalacticraftAPI
mod.version=0.4.0-prealpha.24
mod.version=0.4.0-prealpha.25
mod.group=dev.galacticraft

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

# Mod Dependencies
fabric.version=0.60.0+1.19.2
machinelib.version=0.1.0+1.19.2
machinelib.version=0.1.0+eaeb4e6f
dyndims.version=0.3.0
File renamed without changes.

0 comments on commit 33bfa1e

Please sign in to comment.