Skip to content

Commit

Permalink
Update to Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Mar 5, 2024
1 parent 023a704 commit a63a9e2
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 17.0.1
java-version: 21.0.2
cache: 'gradle'

- name: Grant execute permission for gradlew
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 17.0.1
java-version: 21.0.2
cache: 'gradle'

- name: Grant execute permission for gradlew
Expand Down
59 changes: 3 additions & 56 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ allprojects {
apply plugin: 'java'
group 'com.faforever.neroxis'

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21


repositories {
mavenCentral()
Expand Down Expand Up @@ -42,58 +43,4 @@ allprojects {
options.compilerArgs << '-parameters'
}
}

// source: https://github.com/mendhak/Gradle-Travis-Colored-Output/blob/master/ColoredOutput.gradle
tasks.withType(Test) {
String ANSI_BOLD_WHITE = "\u001B[0;1m"
String ANSI_RESET = "\u001B[0m"
String ANSI_BLACK = "\u001B[30m"
String ANSI_RED = "\u001B[31m"
String ANSI_GREEN = "\u001B[32m"
String ANSI_YELLOW = "\u001B[33m"
String ANSI_BLUE = "\u001B[34m"
String ANSI_PURPLE = "\u001B[35m"
String ANSI_CYAN = "\u001B[36m"
String ANSI_WHITE = "\u001B[37m"
String CHECK_MARK = "\u2713"
String NEUTRAL_FACE = "\u0CA0_\u0CA0"
String X_MARK = "\u274C"
String indent = ' '

afterTest { descriptor, result ->
if (result.failedTestCount > 0) {
String exceptions = result.getException().toString().split("\\n").join("\n" + indent)

out.println("\n" + ANSI_BOLD_WHITE + descriptor.parent.name + ANSI_RESET
+ "\n" + indent + ANSI_RED + X_MARK + ANSI_RESET + " " + descriptor.name
+ "\n" + indent + exceptions)
}
}

afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def failStyle = ANSI_RED
def skipStyle = ANSI_YELLOW
def summaryStyle = ANSI_WHITE

switch (result.resultType) {
case TestResult.ResultType.SUCCESS:
summaryStyle = ANSI_GREEN
break
case TestResult.ResultType.FAILURE:
summaryStyle = ANSI_RED
break
}

out.println("--------------------------------------------------------------------------")
out.println("Results: " + summaryStyle + "${result.resultType}" + ANSI_RESET
+ " (${result.testCount} tests, "
+ ANSI_GREEN + "${result.successfulTestCount} passed" + ANSI_RESET
+ ", " + failStyle + "${result.failedTestCount} failed" + ANSI_RESET
+ ", " + skipStyle + "${result.skippedTestCount} skipped" + ANSI_RESET
+ ")")
out.println("--------------------------------------------------------------------------")
}
}
}
}
7 changes: 7 additions & 0 deletions generator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'application'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id("com.adarshr.test-logger") version "4.0.0"
}

application {
Expand All @@ -14,6 +15,12 @@ dependencies {
annotationProcessor("info.picocli:picocli-codegen:4.7.5")
}

testlogger {
showFullStackTraces = false
showPassed = false
showStandardStreams = false
}

shadowJar {
getArchiveFileName().set("NeroxisGen_${generatorVersion}.jar")
manifest {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 7 additions & 0 deletions shared/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'java-library'
id "me.champeau.jmh" version "0.7.2"
id("com.adarshr.test-logger") version "4.0.0"
}

dependencies {
Expand All @@ -10,6 +11,12 @@ dependencies {
annotationProcessor("com.dslplatform:dsl-json-java8:1.10.0")
}

testlogger {
showFullStackTraces = false
showPassed = false
showStandardStreams = false
}

jmh {
warmupIterations = 2
iterations = 5
Expand Down

0 comments on commit a63a9e2

Please sign in to comment.