mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Update deps, test fixes, and fix github actions deprecation warnings. (#745)
This commit is contained in:
2
.github/workflows/publish.yml
vendored
2
.github/workflows/publish.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
image: openjdk:17-jdk
|
||||
options: --user root
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
# Generate the build number based on tags to allow per branch build numbers, not something github provides by default.
|
||||
|
||||
30
.github/workflows/test-push.yml
vendored
30
.github/workflows/test-push.yml
vendored
@@ -10,13 +10,13 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version: [7.5.0-jdk17]
|
||||
version: [7.5.1-jdk17]
|
||||
runs-on: ubuntu-22.04
|
||||
container:
|
||||
image: gradle:${{ matrix.version }}
|
||||
options: --user root
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- run: gradle build check -x test --stacktrace --warning-mode fail
|
||||
|
||||
@@ -27,15 +27,15 @@ jobs:
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
container:
|
||||
image: gradle:7.5.0-jdk17
|
||||
image: gradle:7.5.1-jdk17
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- run: gradle writeActionsTestMatrix --stacktrace --warning-mode fail
|
||||
-
|
||||
id: set-matrix
|
||||
run: echo "::set-output name=matrix::$(cat build/test_matrix.json)"
|
||||
run: echo "matrix=$(cat build/test_matrix.json)" >> $GITHUB_OUTPUT
|
||||
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version: [7.4.0-jdk17]
|
||||
version: [7.5.1-jdk17]
|
||||
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- run: gradle printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace --warning-mode fail
|
||||
env:
|
||||
TEST_WARNING_MODE: fail
|
||||
@@ -79,17 +79,18 @@ jobs:
|
||||
runs-on: windows-2022
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: setup jdk ${{ matrix.java }}
|
||||
uses: actions/setup-java@v1
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
- run: ./gradlew printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace --warning-mode fail
|
||||
env:
|
||||
TEST_WARNING_MODE: fail
|
||||
id: test
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
name: ${{ steps.test.outputs.test }} (${{ matrix.java }}) Results (Windows)
|
||||
@@ -103,18 +104,19 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java: [ 17, 18 ]
|
||||
os: [ windows-2022, ubuntu-22.04, macos-11 ]
|
||||
os: [ windows-2022, ubuntu-22.04, macos-12 ]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
|
||||
- run: ./gradlew test --tests *ReproducibleBuildTest --stacktrace --warning-mode fail
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
name: Reproducible Build ${{ matrix.os }} (${{ matrix.java }}) Results
|
||||
|
||||
@@ -19,7 +19,7 @@ dependencies {
|
||||
implementation gradleApi()
|
||||
|
||||
testImplementation(gradleTestKit())
|
||||
testImplementation('org.spockframework:spock-core:2.1-groovy-3.0') {
|
||||
testImplementation('org.spockframework:spock-core:2.3-groovy-3.0') {
|
||||
exclude module: 'groovy-all'
|
||||
}
|
||||
}
|
||||
|
||||
32
build.gradle
32
build.gradle
@@ -9,7 +9,7 @@ plugins {
|
||||
id 'jacoco'
|
||||
id 'codenarc'
|
||||
id "org.jetbrains.kotlin.jvm" version "1.6.10" // Must match the version included with gradle.
|
||||
id "com.diffplug.spotless" version "6.8.0"
|
||||
id "com.diffplug.spotless" version "6.11.0"
|
||||
id "org.gradle.test-retry" version "1.4.1"
|
||||
}
|
||||
|
||||
@@ -70,14 +70,14 @@ dependencies {
|
||||
|
||||
// libraries
|
||||
implementation ('commons-io:commons-io:2.11.0')
|
||||
implementation ('com.google.code.gson:gson:2.9.0')
|
||||
implementation ('com.fasterxml.jackson.core:jackson-databind:2.13.3')
|
||||
implementation ('com.google.code.gson:gson:2.10')
|
||||
implementation ('com.fasterxml.jackson.core:jackson-databind:2.13.4.2')
|
||||
implementation ('com.google.guava:guava:31.1-jre')
|
||||
implementation ('org.ow2.asm:asm:9.3')
|
||||
implementation ('org.ow2.asm:asm-analysis:9.3')
|
||||
implementation ('org.ow2.asm:asm-commons:9.3')
|
||||
implementation ('org.ow2.asm:asm-tree:9.3')
|
||||
implementation ('org.ow2.asm:asm-util:9.3')
|
||||
implementation ('org.ow2.asm:asm:9.4')
|
||||
implementation ('org.ow2.asm:asm-analysis:9.4')
|
||||
implementation ('org.ow2.asm:asm-commons:9.4')
|
||||
implementation ('org.ow2.asm:asm-tree:9.4')
|
||||
implementation ('org.ow2.asm:asm-util:9.4')
|
||||
|
||||
// game handling utils
|
||||
implementation ('net.fabricmc:stitch:0.6.2') {
|
||||
@@ -101,7 +101,7 @@ dependencies {
|
||||
implementation ('net.fabricmc:mercury:0.2.7')
|
||||
|
||||
// Kotlin
|
||||
implementation('org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.4.2') {
|
||||
implementation('org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.5.0') {
|
||||
transitive = false
|
||||
}
|
||||
|
||||
@@ -110,15 +110,15 @@ dependencies {
|
||||
|
||||
// Testing
|
||||
testImplementation(gradleTestKit())
|
||||
testImplementation('org.spockframework:spock-core:2.1-groovy-3.0') {
|
||||
testImplementation('org.spockframework:spock-core:2.3-groovy-3.0') {
|
||||
exclude module: 'groovy-all'
|
||||
}
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
|
||||
testImplementation ('io.javalin:javalin:4.6.1') {
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
|
||||
testImplementation ('io.javalin:javalin:5.1.2') {
|
||||
exclude group: 'org.jetbrains.kotlin'
|
||||
}
|
||||
testImplementation 'net.fabricmc:fabric-installer:0.9.0'
|
||||
testImplementation 'org.mockito:mockito-core:4.6.1'
|
||||
testImplementation 'org.mockito:mockito-core:4.8.0'
|
||||
|
||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
testCompileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
@@ -160,7 +160,7 @@ spotless {
|
||||
|
||||
checkstyle {
|
||||
configFile = file('checkstyle.xml')
|
||||
toolVersion = '10.3.1'
|
||||
toolVersion = '10.3.4'
|
||||
}
|
||||
|
||||
codenarc {
|
||||
@@ -178,7 +178,7 @@ gradlePlugin {
|
||||
}
|
||||
|
||||
jacoco {
|
||||
toolVersion = "0.8.7"
|
||||
toolVersion = "0.8.8"
|
||||
}
|
||||
|
||||
// Run to get test coverage.
|
||||
@@ -353,6 +353,6 @@ class PrintActionsTestName extends DefaultTask {
|
||||
@TaskAction
|
||||
def run() {
|
||||
def sanitised = testName.replace('*', '_')
|
||||
println "::set-output name=test::$sanitised"
|
||||
new File(System.getenv().GITHUB_OUTPUT) << "\ntest=$sanitised"
|
||||
}
|
||||
}
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
6
gradlew
vendored
6
gradlew
vendored
@@ -205,6 +205,12 @@ set -- \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
|
||||
14
gradlew.bat
vendored
14
gradlew.bat
vendored
@@ -14,7 +14,7 @@
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@@ -25,7 +25,7 @@
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
@@ -27,7 +27,7 @@ package net.fabricmc.loom.test
|
||||
import org.gradle.util.GradleVersion
|
||||
|
||||
class LoomTestConstants {
|
||||
private final static String NIGHTLY_VERSION = "8.0-20221022221212+0000"
|
||||
private final static String NIGHTLY_VERSION = "8.0-20221027221148+0000"
|
||||
private final static boolean NIGHTLY_EXISTS = nightlyExists(NIGHTLY_VERSION)
|
||||
|
||||
public final static String DEFAULT_GRADLE = GradleVersion.current().getVersion()
|
||||
|
||||
@@ -39,7 +39,7 @@ class KotlinTest extends Specification implements GradleProjectTestTrait {
|
||||
def gradle = gradleProject(project: "kotlin", version: version)
|
||||
def server = ServerRunner.create(gradle.projectDir, "1.16.5")
|
||||
.withMod(gradle.getOutputFile("fabric-example-mod-0.0.1.jar"))
|
||||
.downloadMod(ServerRunner.FABRIC_LANG_KOTLIN, "fabric-language-kotlin-1.7.3+kotlin.1.6.20.jar")
|
||||
.downloadMod(ServerRunner.FABRIC_LANG_KOTLIN, "fabric-language-kotlin-1.8.5+kotlin.1.7.20.jar")
|
||||
|
||||
when:
|
||||
def result = gradle.run(task: "build")
|
||||
|
||||
@@ -56,7 +56,7 @@ class ModJavadocTest extends Specification implements GradleProjectTestTrait {
|
||||
}
|
||||
|
||||
private static String getClassSource(GradleProject gradle, String classname) {
|
||||
File sourcesJar = gradle.getGeneratedLocalSources("1.17.1/net.fabricmc.yarn.1_17_1.1.17.1+build.59-v2")
|
||||
File sourcesJar = gradle.getGeneratedLocalSources("1.17.1-net.fabricmc.yarn.1_17_1.1.17.1+build.59-v2")
|
||||
return new String(ZipUtils.unpack(sourcesJar.toPath(), classname), StandardCharsets.UTF_8)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import static net.fabricmc.loom.test.LoomTestConstants.*
|
||||
import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
|
||||
|
||||
class UnpickTest extends Specification implements GradleProjectTestTrait {
|
||||
static final String MAPPINGS = "21w13a/net.fabricmc.yarn.21w13a.21w13a+build.30-v2"
|
||||
static final String MAPPINGS = "21w13a-net.fabricmc.yarn.21w13a.21w13a+build.30-v2"
|
||||
|
||||
def "unpick decompile"() {
|
||||
setup:
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
package net.fabricmc.loom.test.unit.download
|
||||
|
||||
import io.javalin.http.HttpCode
|
||||
import io.javalin.http.HttpStatus
|
||||
import net.fabricmc.loom.util.Checksum
|
||||
import net.fabricmc.loom.util.download.Download
|
||||
import net.fabricmc.loom.util.download.DownloadException
|
||||
@@ -175,7 +175,7 @@ class DownloadFileTest extends DownloadTest {
|
||||
|
||||
if (clientEtag == etag) {
|
||||
// Etag matches, no need to send the data.
|
||||
it.status(HttpCode.NOT_MODIFIED)
|
||||
it.status(HttpStatus.NOT_MODIFIED)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
package net.fabricmc.loom.test.unit.download
|
||||
|
||||
import io.javalin.http.HttpCode
|
||||
import io.javalin.http.HttpStatus
|
||||
import net.fabricmc.loom.util.download.Download
|
||||
import net.fabricmc.loom.util.download.DownloadException
|
||||
|
||||
@@ -80,7 +80,7 @@ class DownloadStringTest extends DownloadTest {
|
||||
requests ++
|
||||
|
||||
if (requests < 3) {
|
||||
it.status(HttpCode.INTERNAL_SERVER_ERROR)
|
||||
it.status(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ abstract class DownloadTest extends Specification {
|
||||
|
||||
@Shared
|
||||
Javalin server = Javalin.create { config ->
|
||||
config.enableDevLogging()
|
||||
}.start(9081)
|
||||
|
||||
def cleanupSpec() {
|
||||
|
||||
@@ -244,11 +244,11 @@ trait GradleProjectTestTrait {
|
||||
}
|
||||
|
||||
File getGeneratedSources(String mappings) {
|
||||
return new File(getGradleHomeDir(), "caches/fabric-loom/${mappings}/minecraft-merged-named-sources.jar")
|
||||
return new File(getGradleHomeDir(), "caches/fabric-loom/minecraftMaven/net/minecraft/minecraft-merged/${mappings}/minecraft-merged-${mappings}-sources.jar")
|
||||
}
|
||||
|
||||
File getGeneratedLocalSources(String mappings) {
|
||||
return new File(getProjectDir(), ".gradle/loom-cache/${mappings}/minecraft-project-@-merged-named-sources.jar")
|
||||
return new File(getProjectDir(), ".gradle/loom-cache/minecraftMaven/net/minecraft/minecraft-merged-project-root/${mappings}/minecraft-merged-project-root-${mappings}-sources.jar")
|
||||
}
|
||||
|
||||
void buildSrc(String name) {
|
||||
|
||||
@@ -37,7 +37,6 @@ trait MockMavenServerTrait {
|
||||
println "Maven server path: ${testMavenDir.absolutePath}"
|
||||
|
||||
server = Javalin.create { config ->
|
||||
config.enableDevLogging()
|
||||
}.start(mavenServerPort)
|
||||
|
||||
/**
|
||||
@@ -61,7 +60,7 @@ trait MockMavenServerTrait {
|
||||
file.parentFile.mkdirs()
|
||||
|
||||
file.withOutputStream {
|
||||
IOUtils.copy(ctx.bodyAsInputStream(), it)
|
||||
IOUtils.copy(ctx.bodyInputStream(), it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class ServerRunner {
|
||||
"1.16.5": "https://github.com/FabricMC/fabric/releases/download/0.37.1%2B1.16/fabric-api-0.37.1+1.16.jar",
|
||||
"1.17.1": "https://github.com/FabricMC/fabric/releases/download/0.37.1%2B1.17/fabric-api-0.37.1+1.17.jar"
|
||||
]
|
||||
static final String FABRIC_LANG_KOTLIN = "https://maven.fabricmc.net/net/fabricmc/fabric-language-kotlin/1.7.3%2Bkotlin.1.6.20/fabric-language-kotlin-1.7.3%2Bkotlin.1.6.20.jar"
|
||||
static final String FABRIC_LANG_KOTLIN = "https://maven.fabricmc.net/net/fabricmc/fabric-language-kotlin/1.8.5%2Bkotlin.1.7.20/fabric-language-kotlin-1.8.5%2Bkotlin.1.7.20.jar"
|
||||
|
||||
final File serverDir
|
||||
final String minecraftVersion
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.6.20"
|
||||
kotlin("plugin.serialization") version "1.6.20"
|
||||
kotlin("jvm") version "1.7.20"
|
||||
kotlin("plugin.serialization") version "1.7.20"
|
||||
id("fabric-loom")
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ dependencies {
|
||||
minecraft(group = "com.mojang", name = "minecraft", version = "1.16.5")
|
||||
mappings(group = "net.fabricmc", name = "yarn", version = "1.16.5+build.5", classifier = "v2")
|
||||
modImplementation("net.fabricmc:fabric-loader:0.12.12")
|
||||
modImplementation(group = "net.fabricmc", name = "fabric-language-kotlin", version = "1.7.3+kotlin.1.6.20")
|
||||
modImplementation(group = "net.fabricmc", name = "fabric-language-kotlin", version = "1.8.5+kotlin.1.7.20")
|
||||
}
|
||||
Reference in New Issue
Block a user