Skip to content

Commit af96f9f

Browse files
committed
Migrated gradlew to 8.5 for Java 21 support
Updated deprecated gradle config Added java 21 test definition Added CI script for java 21 Added test stanza for gitlab
1 parent ce09adf commit af96f9f

19 files changed

+258
-132
lines changed

Diff for: .gitlab-ci.yml

+16
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,19 @@ test-code-17:
6969
- "mail/build/reports"
7070
- "util/build/reports"
7171
- "tls/build/reports"
72+
test-code-21:
73+
stage: test
74+
script:
75+
- "ecr_login"
76+
- "ecr_pull vm_base_intel latest"
77+
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test_21.sh\""
78+
artifacts:
79+
when: always
80+
paths:
81+
- "core/build/reports"
82+
- "prov/build/reports"
83+
- "pg/build/reports"
84+
- "pkix/build/reports"
85+
- "mail/build/reports"
86+
- "util/build/reports"
87+
- "tls/build/reports"

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ to valid JAVA_HOMEs for each JVM version:
2121
```
2222
export BC_JDK8=/path/to/java8
2323
export BC_JDK11=/path/to/java11
24-
export BC_JDK15=/path/to/java15
2524
export BC_JDK17=/path/to/java17
25+
export BC_JDK21=/path/to/java21
2626
```
2727

2828

Diff for: build.gradle

+27-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ buildscript {
88
}
99

1010
plugins {
11-
id "io.spring.nohttp" version "0.0.8"
11+
id "io.spring.nohttp" version "0.0.11"
1212
id "checkstyle"
1313
id "jacoco"
14-
id "net.ltgt.errorprone" version "2.0.2"
14+
id "net.ltgt.errorprone" version "3.1.0"
1515
}
1616

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

268+
task test21(type:Test) {
269+
forkEvery = 1;
270+
maxParallelForks = 1;
271+
272+
systemProperty 'bc.test.data.home', bcTestDataHome
273+
maxHeapSize = "1536m"
274+
testLogging.showStandardStreams = true
275+
276+
javaLauncher = javaToolchains.launcherFor {
277+
languageVersion = JavaLanguageVersion.of(21)
278+
}
279+
280+
jvmArgs=['-Dtest.java.version.prefix=21']
281+
282+
283+
finalizedBy jacocoTestReport
284+
285+
filter {
286+
includeTestsMatching "AllTest*"
287+
if (project.hasProperty('excludeTests')) {
288+
excludeTestsMatching "${excludeTests}"
289+
}
290+
}
291+
}
268292

269293
dependencies {
270294
checkstyle files("$rootDir/config/checkstyle/lib/methodchecker-1.0.0.jar")

Diff for: ci/test_11.sh

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ source ci/common.sh
1111

1212
export BC_JDK8=`openjdk_8`
1313
export BC_JDK11=`openjdk_11`
14-
export BC_JDK15=`openjdk_15`
1514
export BC_JDK17=`openjdk_17`
1615
export BC_JDK21=`openjdk_21`
1716

Diff for: ci/test_17.sh

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ source ci/common.sh
1111

1212
export BC_JDK8=`openjdk_8`
1313
export BC_JDK11=`openjdk_11`
14-
export BC_JDK15=`openjdk_15`
1514
export BC_JDK17=`openjdk_17`
1615
export BC_JDK21=`openjdk_21`
1716

Diff for: ci/test_21.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
#
6+
# This script is for running inside the docker container
7+
#
8+
9+
cd /workspace/bc-java
10+
source ci/common.sh
11+
12+
export BC_JDK8=`openjdk_8`
13+
export BC_JDK11=`openjdk_11`
14+
export BC_JDK17=`openjdk_17`
15+
export BC_JDK21=`openjdk_21`
16+
17+
18+
export JAVA_HOME=`openjdk_17`
19+
export PATH=$JAVA_HOME/bin:$PATH
20+
21+
./gradlew -stacktrace clean build test21 -x test
22+
23+
24+
25+

Diff for: ci/test_8.sh

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ source ci/common.sh
1111

1212
export BC_JDK8=`openjdk_8`
1313
export BC_JDK11=`openjdk_11`
14-
export BC_JDK15=`openjdk_15`
1514
export BC_JDK17=`openjdk_17`
1615
export BC_JDK21=`openjdk_21`
1716

Diff for: core/src/test/java/org/bouncycastle/crypto/test/AllTests.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public static Test suite()
2121
suite.addTestSuite(SimpleTestTest.class);
2222
suite.addTestSuite(GCMReorderTest.class);
2323
suite.addTestSuite(HPKETestVectors.class);
24+
suite.addTestSuite(JVMAssertionTest.class);
2425

2526
return new BCTestSetup(suite);
2627
}

Diff for: gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
org.gradle.jvmargs=-Xmx2g
22
version=1.75
33
org.gradle.java.installations.auto-download=false
4-
org.gradle.java.installations.fromEnv=BC_JDK8,BC_JDK11,BC_JDK15,BC_JDK15
4+
org.gradle.java.installations.fromEnv=BC_JDK8,BC_JDK11,BC_JDK17,BC_JDK21

Diff for: gradle/wrapper/gradle-wrapper.jar

2.36 KB
Binary file not shown.

Diff for: gradle/wrapper/gradle-wrapper.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)