Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise the minimum Java version to 11. #6557

Merged
merged 8 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java 8 CI (MC 1.13-1.16)
name: Java 11 CI (MC 1.13-1.16)

on:
push:
Expand Down Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Skript and run test scripts
run: ./gradlew clean skriptTestJava8
run: ./gradlew clean skriptTestJava11
- name: Upload Nightly Build
uses: actions/upload-artifact@v4
if: success()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Skript and run JUnit
run: ./gradlew clean JUnitJava8
run: ./gradlew clean JUnitJava11
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ task build(overwrite: true, type: ShadowJar) {
from sourceSets.main.output
}

// Excludes the tests for the build task. Should be using junit, junitJava17, junitJava8, skriptTest, quickTest.
// Excludes the tests for the build task. Should be using junit, junitJava17, junitJava11, skriptTest, quickTest.
// We do not want tests to run for building. That's time consuming and annoying. Especially in development.
test {
exclude '**/*'
Expand Down Expand Up @@ -252,7 +252,7 @@ void createTestTask(String name, String desc, String environments, int javaVersi

def latestEnv = 'java17/paper-1.20.4.json'
def latestJava = 17
def oldestJava = 8
def oldestJava = 11

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(latestJava))
Expand All @@ -271,22 +271,22 @@ String env = project.property('testEnv') == null ? latestEnv : project.property(
int envJava = project.property('testEnvJavaVersion') == null ? latestJava : Integer.parseInt(project.property('testEnvJavaVersion') as String)
createTestTask('quickTest', 'Runs tests on one environment being the latest supported Java and Minecraft.', environments + latestEnv, latestJava, 0)
createTestTask('skriptTestJava17', 'Runs tests on all Java 17 environments.', environments + 'java17', latestJava, 0)
createTestTask('skriptTestJava8', 'Runs tests on all Java 8 environments.', environments + 'java8', oldestJava, 0)
createTestTask('skriptTestJava11', 'Runs tests on all Java 11 environments.', environments + 'java11', oldestJava, 0)
createTestTask('skriptTestDev', 'Runs testing server and uses \'system.in\' for command input, stop server to finish.', environments + env, envJava, 0, Modifiers.DEV_MODE, Modifiers.DEBUG)
createTestTask('skriptProfile', 'Starts the testing server with JProfiler support.', environments + latestEnv, latestJava, -1, Modifiers.PROFILE)
createTestTask('genNightlyDocs', 'Generates the Skript documentation website html files.', environments + env, envJava, 0, Modifiers.GEN_NIGHTLY_DOCS)
createTestTask('genReleaseDocs', 'Generates the Skript documentation website html files for a release.', environments + env, envJava, 0, Modifiers.GEN_RELEASE_DOCS)
tasks.register('skriptTest') {
description = 'Runs tests on all environments.'
dependsOn skriptTestJava8, skriptTestJava17
dependsOn skriptTestJava11, skriptTestJava17
}

createTestTask('JUnitQuick', 'Runs JUnit tests on one environment being the latest supported Java and Minecraft.', environments + latestEnv, latestJava, 0, Modifiers.JUNIT)
createTestTask('JUnitJava17', 'Runs JUnit tests on all Java 17 environments.', environments + 'java17', latestJava, 0, Modifiers.JUNIT)
createTestTask('JUnitJava8', 'Runs JUnit tests on all Java 8 environments.', environments + 'java8', oldestJava, 0, Modifiers.JUNIT)
createTestTask('JUnitJava11', 'Runs JUnit tests on all Java 11 environments.', environments + 'java11', oldestJava, 0, Modifiers.JUNIT)
tasks.register('JUnit') {
description = 'Runs JUnit tests on all environments.'
dependsOn JUnitJava8, JUnitJava17
dependsOn JUnitJava11, JUnitJava17
}

// Build flavor configurations
Expand Down
Loading