Skip to content

Commit

Permalink
build: add jdk 17 to java units and dependency builds (#1048)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
yoshi-automation committed Sep 29, 2021
1 parent 575cf12 commit 8717cd6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11]
java: [8, 11, 17]
steps:
- uses: actions/checkout@v2
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
distribution: zulu
java-version: ${{matrix.java}}
- run: java -version
- run: .kokoro/build.sh
Expand All @@ -29,8 +30,9 @@ jobs:
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 8
- run: java -version
- run: .kokoro/build.bat
Expand All @@ -40,14 +42,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11]
java: [8, 11, 17]
steps:
- uses: actions/checkout@v2
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
distribution: zulu
java-version: ${{matrix.java}}
- run: java -version
- run: .kokoro/dependencies.sh
Expand All @@ -58,8 +61,9 @@ jobs:
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 8
- run: java -version
- run: .kokoro/build.sh
Expand All @@ -72,8 +76,9 @@ jobs:
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 8
- run: java -version
- run: .kokoro/build.sh
Expand Down
23 changes: 22 additions & 1 deletion .kokoro/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,28 @@ source ${scriptDir}/common.sh
java -version
echo $JOB_TYPE

export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"
function determineMavenOpts() {
local javaVersion=$(
# filter down to the version line, then pull out the version between quotes,
# then trim the version number down to its minimal number (removing any
# update or suffix number).
java -version 2>&1 | grep "version" \
| sed -E 's/^.*"(.*?)".*$/\1/g' \
| sed -E 's/^(1\.[0-9]\.0).*$/\1/g'
)

case $javaVersion in
"17")
# MaxPermSize is no longer supported as of jdk 17
echo -n "-Xmx1024m"
;;
*)
echo -n "-Xmx1024m -XX:MaxPermSize=128m"
;;
esac
}

export MAVEN_OPTS=$(determineMavenOpts)

# this should run maven enforcer
retry_with_backoff 3 10 \
Expand Down
4 changes: 2 additions & 2 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-storage.git",
"sha": "d6d95456f1e300ca4a9dc4b1c47940dea7b3a82a"
"sha": "2e7f041ef7873ede8c2d1ebb526639d1aff61963"
}
},
{
Expand All @@ -19,7 +19,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "0752ff727a19a467dffed335d5e59303689cf0d1"
"sha": "a4be3384ccb92364795d981f2863f6986fcee620"
}
}
],
Expand Down

0 comments on commit 8717cd6

Please sign in to comment.