You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/06/13 08:10:31 UTC
[groovy] 01/01: Support openjdk16 build
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch danielsun/tweak-build
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 164c932d87045d4f2471919a19a7c55edf7d976f
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Jun 13 16:09:15 2021 +0800
Support openjdk16 build
---
.travis.yml | 6 +++++-
buildSrc/src/main/groovy/org.apache.groovy-tested.gradle | 9 +++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 14edd60..f6a28cd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,6 +25,8 @@ install:
matrix:
include:
+ - env: BC='indy' FEATURE='16' TARGET_JAVA_HOME="/home/travis/openjdk$FEATURE" LICENSE='GPL'
+ jdk: openjdk11
- env: BC='indy'
jdk: openjdk15
- env: BC='indy'
@@ -50,7 +52,9 @@ before_script:
script:
- ./gradlew -version
- - if [ "$BC" == "indy" ]; then travis_wait 60 ./gradlew test; elif [ "$BC" == "sonar" ]; then travis_wait 60 ./gradlew sonarqube -Dsonar.login=$SONAR_LOGIN -Pcoverage=true; fi
+ - if [ "$TARGET_JAVA_HOME" != "" ]; then wget https://github.com/sormuras/bach/raw/master/install-jdk.sh -P /tmp/ && chmod 755 /tmp/install-jdk.sh; fi
+ - if [ "$TARGET_JAVA_HOME" != "" ]; then /tmp/install-jdk.sh --target "$TARGET_JAVA_HOME" --workspace "/home/travis/.cache/install-jdk" --feature "$FEATURE" --license "$LICENSE" --cacerts; fi
+ - if [ "$BC" == "indy" ]; then travis_wait 60 ./gradlew test -Ptarget.java.home=$TARGET_JAVA_HOME; elif [ "$BC" == "sonar" ]; then travis_wait 60 ./gradlew sonarqube -Dsonar.login=$SONAR_LOGIN -Pcoverage=true; fi
# As recommended in:
# https://docs.travis-ci.com/user/languages/java/#Caching
diff --git a/buildSrc/src/main/groovy/org.apache.groovy-tested.gradle b/buildSrc/src/main/groovy/org.apache.groovy-tested.gradle
index e2cb9de..25a4ca0 100644
--- a/buildSrc/src/main/groovy/org.apache.groovy-tested.gradle
+++ b/buildSrc/src/main/groovy/org.apache.groovy-tested.gradle
@@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+
import org.apache.groovy.gradle.ConcurrentExecutionControlBuildService
+
import javax.inject.Inject
// Instead of adding to the test sources, this should
@@ -55,6 +57,13 @@ tasks.withType(Test).configureEach {
'gradle.home': gradle.gradleHomeDir, // this is needed by the security.policy
'user.home': temporaryDir.absolutePath // make sure tests are isolated from real user home or tests using Grape may fail
+ if (rootProject.hasProperty('target.java.home')) {
+ println "${rootProject.property('target.java.home')}/bin/java"
+ executable = "${rootProject.property('target.java.home')}/bin/java"
+ } else {
+ println "target.java.home not set"
+ }
+
forkEvery = 50
maxParallelForks = sharedConfiguration.isRunningOnCI ? 1 : Runtime.runtime.availableProcessors().intdiv(2) ?: 1
scanForTestClasses = true