Skip to content

Commit cde8718

Browse files
build: add jdk 17 to java units and dependency builds (#1462)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore(java): rename master branch to main Source-Author: Neenu Shaji <Neenu1995@users.noreply.github.com> Source-Date: Mon Sep 27 10:04:11 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: 67ab4f9f4272ad13f4b809de47fd0dec05f425ad Source-Link: googleapis/synthtool@67ab4f9 * build: add jdk 17 to java units and dependency builds * update dependencies.sh to not pass MaxPermSize when jdk 17 is used. MaxPermSize is an unrecognized flag in jdk 17. Source-Author: BenWhitehead <BenWhitehead@users.noreply.github.com> Source-Date: Mon Sep 27 11:34:46 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: a4be3384ccb92364795d981f2863f6986fcee620 Source-Link: googleapis/synthtool@a4be338
1 parent a37f6d4 commit cde8718

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
java: [8, 11]
12+
java: [8, 11, 17]
1313
steps:
1414
- uses: actions/checkout@v2
1515
- uses: stCarolas/setup-maven@v4
1616
with:
1717
maven-version: 3.8.1
18-
- uses: actions/setup-java@v1
18+
- uses: actions/setup-java@v2
1919
with:
20+
distribution: zulu
2021
java-version: ${{matrix.java}}
2122
- run: java -version
2223
- run: .kokoro/build.sh
@@ -29,8 +30,9 @@ jobs:
2930
- uses: stCarolas/setup-maven@v4
3031
with:
3132
maven-version: 3.8.1
32-
- uses: actions/setup-java@v1
33+
- uses: actions/setup-java@v2
3334
with:
35+
distribution: zulu
3436
java-version: 8
3537
- run: java -version
3638
- run: .kokoro/build.bat
@@ -40,14 +42,15 @@ jobs:
4042
runs-on: ubuntu-latest
4143
strategy:
4244
matrix:
43-
java: [8, 11]
45+
java: [8, 11, 17]
4446
steps:
4547
- uses: actions/checkout@v2
4648
- uses: stCarolas/setup-maven@v4
4749
with:
4850
maven-version: 3.8.1
49-
- uses: actions/setup-java@v1
51+
- uses: actions/setup-java@v2
5052
with:
53+
distribution: zulu
5154
java-version: ${{matrix.java}}
5255
- run: java -version
5356
- run: .kokoro/dependencies.sh
@@ -58,8 +61,9 @@ jobs:
5861
- uses: stCarolas/setup-maven@v4
5962
with:
6063
maven-version: 3.8.1
61-
- uses: actions/setup-java@v1
64+
- uses: actions/setup-java@v2
6265
with:
66+
distribution: zulu
6367
java-version: 8
6468
- run: java -version
6569
- run: .kokoro/build.sh
@@ -72,8 +76,9 @@ jobs:
7276
- uses: stCarolas/setup-maven@v4
7377
with:
7478
maven-version: 3.8.1
75-
- uses: actions/setup-java@v1
79+
- uses: actions/setup-java@v2
7680
with:
81+
distribution: zulu
7782
java-version: 8
7883
- run: java -version
7984
- run: .kokoro/build.sh

.kokoro/dependencies.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,28 @@ source ${scriptDir}/common.sh
2828
java -version
2929
echo $JOB_TYPE
3030

31-
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"
31+
function determineMavenOpts() {
32+
local javaVersion=$(
33+
# filter down to the version line, then pull out the version between quotes,
34+
# then trim the version number down to its minimal number (removing any
35+
# update or suffix number).
36+
java -version 2>&1 | grep "version" \
37+
| sed -E 's/^.*"(.*?)".*$/\1/g' \
38+
| sed -E 's/^(1\.[0-9]\.0).*$/\1/g'
39+
)
40+
41+
case $javaVersion in
42+
"17")
43+
# MaxPermSize is no longer supported as of jdk 17
44+
echo -n "-Xmx1024m"
45+
;;
46+
*)
47+
echo -n "-Xmx1024m -XX:MaxPermSize=128m"
48+
;;
49+
esac
50+
}
51+
52+
export MAVEN_OPTS=$(determineMavenOpts)
3253

3354
# this should run maven enforcer
3455
retry_with_backoff 3 10 \

synth.metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/java-spanner.git",
7-
"sha": "06f98b174b785d61ad430b27a3a8216e3c874318"
7+
"sha": "bbe7603b7040fe1f92e010849b3471c7c8949cdf"
88
}
99
},
1010
{
@@ -19,7 +19,7 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "0752ff727a19a467dffed335d5e59303689cf0d1"
22+
"sha": "a4be3384ccb92364795d981f2863f6986fcee620"
2323
}
2424
}
2525
],

0 commit comments

Comments
 (0)