Better Java 16 / Minecraft 1.17+ support

Using a version older than Java 16 with the original BuildTools causes the build to fail as Minecraft 1.17 requires Java 16 and Tool preparations are done without telling the tool a version to build (until now).

Additionally the test builds in this repo have been updated to use java 16 for the latest build.
This commit is contained in:
Christian Koop 2021-08-01 19:45:40 +02:00
parent 2f6ac0ccdb
commit a1c87b0147
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
6 changed files with 50 additions and 17 deletions

View File

@ -22,22 +22,43 @@ jobs:
- uses: actions/checkout@v2
# Setup JDK version
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
java-version: '8'
java-package: jdk
java-version: 8
distribution: adopt
- name: Compile 2 spigot version
- name: Compile 1.8 spigot version
uses: ./
with:
versions: latest, 1.8
versions: 1.8
- uses: actions/setup-java@v2
with:
java-version: 16
distribution: adopt
- name: Compile latest spigot version
uses: ./
with:
versions: latest
# Run again. The Action should detect that the requested versions are already inside the local maven repo
- name: Compile the same versions agains
- name: Compile the same version again (latest)
uses: ./
with:
# These versions should match the ones above
versions: latest, 1.8
versions: latest
- uses: actions/setup-java@v2
with:
java-version: 8
distribution: adopt
- name: Compile the same version again (1.8)
uses: ./
with:
# These versions should match the ones above
versions: 1.8
- name: Upload logs
if: ${{ always() }}
@ -51,16 +72,28 @@ jobs:
runs-on: ubuntu-latest
steps:
# Setup JDK version
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
# This version should probably match the ones from the 'run'-job
java-version: '8'
java-package: jdk
java-version: 8
distribution: adopt
- name: Run original Spigot-BuildTools
- name: Run original Spigot-BuildTools (1.8)
# These versions should match the ones from the 'run'-job
# Using '--compile Spigot' as this action does the same by default
run: |
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -O BuildTools.jar
java -jar BuildTools.jar --rev 1.8 --compile Spigot
- uses: actions/setup-java@v2
with:
# This version should probably match the ones from the 'run'-job
java-version: 16
distribution: adopt
- name: Run original Spigot-BuildTools (latest)
# These versions should match the ones from the 'run'-job
# Using '--compile Spigot' as this action does the same by default
run: |
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -O BuildTools.jar
java -jar BuildTools.jar --rev latest --compile Spigot
java -jar BuildTools.jar --rev 1.8 --compile Spigot

2
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

2
dist/package.json generated vendored
View File

@ -47,7 +47,7 @@
"@types/async": "^3.2.7",
"@types/fs-extra": "^9.0.12",
"@types/n-readlines": "^1.0.2",
"@types/node": "12.x",
"@types/node": "^12.20.18",
"@vercel/ncc": "^0.29.0",
"ts-node": "^10.1.0",
"typescript": "^4.3.5"

2
package-lock.json generated
View File

@ -20,7 +20,7 @@
"@types/async": "^3.2.7",
"@types/fs-extra": "^9.0.12",
"@types/n-readlines": "^1.0.2",
"@types/node": "12.x",
"@types/node": "^12.20.18",
"@vercel/ncc": "^0.29.0",
"ts-node": "^10.1.0",
"typescript": "^4.3.5"

View File

@ -24,7 +24,7 @@ const supportedBuildTools: { [key: string]: { url: string, prepareArgs: string[]
},
spigotmc: {
url: 'https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar',
prepareArgs: ['--compile', 'None']
prepareArgs: ['--compile', 'None', '--rev', '1.16.5'] // Using 1.16.5 as the last release still supporting Java 8
}
};