Skip to content

Commit

Permalink
Migrated gradlew to 8.5 for Java 21 support
Browse files Browse the repository at this point in the history
Updated deprecated gradle config
Added java 21 test definition
Added CI script for java 21
Added test stanza for gitlab
  • Loading branch information
mwcw committed Jan 30, 2024
1 parent ce09adf commit af96f9f
Show file tree
Hide file tree
Showing 19 changed files with 258 additions and 132 deletions.
16 changes: 16 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,19 @@ test-code-17:
- "mail/build/reports"
- "util/build/reports"
- "tls/build/reports"
test-code-21:
stage: test
script:
- "ecr_login"
- "ecr_pull vm_base_intel latest"
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test_21.sh\""
artifacts:
when: always
paths:
- "core/build/reports"
- "prov/build/reports"
- "pg/build/reports"
- "pkix/build/reports"
- "mail/build/reports"
- "util/build/reports"
- "tls/build/reports"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ to valid JAVA_HOMEs for each JVM version:
```
export BC_JDK8=/path/to/java8
export BC_JDK11=/path/to/java11
export BC_JDK15=/path/to/java15
export BC_JDK17=/path/to/java17
export BC_JDK21=/path/to/java21
```


Expand Down
30 changes: 27 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ buildscript {
}

plugins {
id "io.spring.nohttp" version "0.0.8"
id "io.spring.nohttp" version "0.0.11"
id "checkstyle"
id "jacoco"
id "net.ltgt.errorprone" version "2.0.2"
id "net.ltgt.errorprone" version "3.1.0"
}

println("Environment setup:")
["BC_JDK8", "BC_JDK11", "BC_JDK15", "BC_JDK17"].each({ it ->
["BC_JDK8", "BC_JDK11", "BC_JDK17","BC_JDK21"].each({ it ->
println("Looking for JDK ENV '${it}' found ${System.getenv(it)}");
if (System.getenv(it) == null) {
throw new RuntimeException("Looking for JDK ENV '${it}' but found null, see README 'Environmental variables'");
Expand Down Expand Up @@ -265,6 +265,30 @@ subprojects {
}
}

task test21(type:Test) {
forkEvery = 1;
maxParallelForks = 1;

systemProperty 'bc.test.data.home', bcTestDataHome
maxHeapSize = "1536m"
testLogging.showStandardStreams = true

javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(21)
}

jvmArgs=['-Dtest.java.version.prefix=21']


finalizedBy jacocoTestReport

filter {
includeTestsMatching "AllTest*"
if (project.hasProperty('excludeTests')) {
excludeTestsMatching "${excludeTests}"
}
}
}

dependencies {
checkstyle files("$rootDir/config/checkstyle/lib/methodchecker-1.0.0.jar")
Expand Down
1 change: 0 additions & 1 deletion ci/test_11.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ source ci/common.sh

export BC_JDK8=`openjdk_8`
export BC_JDK11=`openjdk_11`
export BC_JDK15=`openjdk_15`
export BC_JDK17=`openjdk_17`
export BC_JDK21=`openjdk_21`

Expand Down
1 change: 0 additions & 1 deletion ci/test_17.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ source ci/common.sh

export BC_JDK8=`openjdk_8`
export BC_JDK11=`openjdk_11`
export BC_JDK15=`openjdk_15`
export BC_JDK17=`openjdk_17`
export BC_JDK21=`openjdk_21`

Expand Down
25 changes: 25 additions & 0 deletions ci/test_21.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -e

#
# This script is for running inside the docker container
#

cd /workspace/bc-java
source ci/common.sh

export BC_JDK8=`openjdk_8`
export BC_JDK11=`openjdk_11`
export BC_JDK17=`openjdk_17`
export BC_JDK21=`openjdk_21`


export JAVA_HOME=`openjdk_17`
export PATH=$JAVA_HOME/bin:$PATH

./gradlew -stacktrace clean build test21 -x test




1 change: 0 additions & 1 deletion ci/test_8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ source ci/common.sh

export BC_JDK8=`openjdk_8`
export BC_JDK11=`openjdk_11`
export BC_JDK15=`openjdk_15`
export BC_JDK17=`openjdk_17`
export BC_JDK21=`openjdk_21`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static Test suite()
suite.addTestSuite(SimpleTestTest.class);
suite.addTestSuite(GCMReorderTest.class);
suite.addTestSuite(HPKETestVectors.class);
suite.addTestSuite(JVMAssertionTest.class);

return new BCTestSetup(suite);
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2g
version=1.75
org.gradle.java.installations.auto-download=false
org.gradle.java.installations.fromEnv=BC_JDK8,BC_JDK11,BC_JDK15,BC_JDK15
org.gradle.java.installations.fromEnv=BC_JDK8,BC_JDK11,BC_JDK17,BC_JDK21
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit af96f9f

Please sign in to comment.