groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Add more JDK builds
Date Wed, 21 Feb 2018 15:42:50 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 387270f1b -> 21a2fec15


Add more JDK builds


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/21a2fec1
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/21a2fec1
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/21a2fec1

Branch: refs/heads/GROOVY_2_6_X
Commit: 21a2fec15e672716c2b45fe96aa8de9c5c54fdba
Parents: 387270f
Author: danielsun1106 <realbluesun@hotmail.com>
Authored: Wed Feb 21 23:42:44 2018 +0800
Committer: danielsun1106 <realbluesun@hotmail.com>
Committed: Wed Feb 21 23:42:44 2018 +0800

----------------------------------------------------------------------
 .travis.yml                |  33 ++++++++++---
 src/install/install-jdk.sh | 107 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 132 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/21a2fec1/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 4a28d1f..6af5e89 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,14 +16,34 @@
 language: groovy
 
 sudo: required
+dist: trusty
 
 matrix:
   include:
+# Java 10 "Oracle JDK"
+#    - env: JDK_RELEASE='Oracle JDK 10' EXTRA_GRADLE_ARGS=''
+#      install: . ./src/install/install-jdk.sh -F 10 -L BCL
+# Java 10 "OpenJDK"
+#    - env: JDK_RELEASE='OpenJDK 10' EXTRA_GRADLE_ARGS=''
+#      install: . ./src/install/install-jdk.sh -F 10 -L GPL
+# Java 9 "Oracle JDK" (provided by Travis CI)
     - jdk: oraclejdk9
+      env: JDK_RELEASE='Oracle JDK 9' EXTRA_GRADLE_ARGS=''
+      install: echo "Don't let Travis CI execute './gradlew assemble' by default"
+# Java 9 "OpenJDK"
+    - env: JDK_RELEASE='OpenJDK 9' EXTRA_GRADLE_ARGS=''
+      install: . ./src/install/install-jdk.sh -F 9 -L GPL
+# Java 8 "Oracle JDK" (provided by Travis CI)
     - jdk: oraclejdk8
+      env: JDK_RELEASE='Oracle JDK 8' EXTRA_GRADLE_ARGS=''
+      install: echo "Don't let Travis CI execute './gradlew assemble' by default"
+# Java 8 "OpenJDK"
+#    - env: JDK_RELEASE='OpenJDK 8' EXTRA_GRADLE_ARGS=''
+#      install: . ./src/install/install-jdk.sh -F 8 -L GPL
+# Java 7 "OpenJDK"
     - jdk: openjdk7
-
-dist: trusty
+      env: JDK_RELEASE='OpenJDK 7' EXTRA_GRADLE_ARGS=''
+      install: echo "Don't let Travis CI execute './gradlew assemble' by default"
 
 before_install:
   - |
@@ -35,8 +55,6 @@ before_install:
       echo "security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider" | sudo
tee -a /etc/java-7-openjdk/security/java.security
     fi
 
-install: true
-
 # adjust gradle.properties and _JAVA_OPTIONS if needed
 before_script:
   - |
@@ -45,11 +63,10 @@ before_script:
     else
       unset _JAVA_OPTIONS
     fi
-    if [ $TRAVIS_JDK_VERSION == "oraclejdk9" ]; then
-      sed -i 's/org.gradle.jvmargs=.*/org.gradle.jvmargs=-ea -Xms500m -Xmx1500m/' gradle.properties
-    fi
 
-script: travis_wait 60 ./gradlew -PuseAntlr4=true test
+script:
+  - ./gradlew -version
+  - travis_wait 60 ./gradlew -PuseAntlr4=true test
 
 # As recommended in:
 # https://docs.travis-ci.com/user/languages/java/#Caching

http://git-wip-us.apache.org/repos/asf/groovy/blob/21a2fec1/src/install/install-jdk.sh
----------------------------------------------------------------------
diff --git a/src/install/install-jdk.sh b/src/install/install-jdk.sh
new file mode 100644
index 0000000..47ba4c3
--- /dev/null
+++ b/src/install/install-jdk.sh
@@ -0,0 +1,107 @@
+#!/usr/bin/env bash
+
+#
+# Install JDK for Linux
+#
+# This script determines the most recent early-access build number,
+# downloads the JDK archive to the user home directory and extracts
+# it there.
+#
+# Example usage
+#
+#   install-jdk.sh                 | install most recent early-access JDK
+#   install-jdk.sh -W /usr/opt     | install most recent early-access JDK to /usr/opt
+#   install-jdk.sh -F 9            | install most recent OpenJDK 9
+#   install-jdk.sh -F 10           | install most recent OpenJDK 10
+#   install-jdk.sh -F 10 -L BCL    | install most recent OracleJDK 10
+#
+# Options
+#
+#   -F f | Feature number of the JDK release, [9|10|...]
+#   -B b | Build number of the JDK release    [?|1|2...]
+#   -L l | License of the JDK                 [GPL|BCL]
+#   -W w | Working directory and install path [${HOME}]
+#
+# Exported environment variables
+#
+#   JAVA_HOME is set to the extracted JDK directory
+#   PATH is prepended with ${JAVA_HOME}/bin
+#
+# (C) 2018 Christian Stein
+#
+# https://github.com/sormuras/bach/blob/master/install-jdk.sh
+#
+set -e
+
+JDK_FEATURE='10'
+JDK_BUILD='?'
+JDK_LICENSE='GPL'
+JDK_WORKSPACE=${HOME}
+
+while getopts F:B:L:W: option
+do
+  case "${option}" in
+    F) JDK_FEATURE=${OPTARG};;
+    B) JDK_BUILD=${OPTARG};;
+    L) JDK_LICENSE=${OPTARG};;
+    W) JDK_WORKSPACE=${OPTARG};;
+ esac
+done
+
+#
+# Other constants
+#
+JDK_DOWNLOAD='https://download.java.net/java'
+JDK_BASENAME='openjdk'
+if [ "${JDK_LICENSE}" != 'GPL' ]; then
+  JDK_BASENAME='jdk'
+fi
+
+#
+# 9
+#
+if [ "${JDK_FEATURE}" == '9' ]; then
+  if [ "${JDK_BUILD}" == '?' ]; then
+    TMP=$(curl -L jdk.java.net/${JDK_FEATURE})
+    TMP="${TMP#*<h1>JDK}"                                   # remove everything before
the number
+    TMP="${TMP%%General-Availability Release*}"             # remove everything after the
number
+    JDK_BUILD="$(echo -e "${TMP}" | tr -d '[:space:]')"     # remove all whitespace
+  fi
+
+  JDK_ARCHIVE=${JDK_BASENAME}-${JDK_BUILD}_linux-x64_bin.tar.gz
+  JDK_URL=${JDK_DOWNLOAD}/GA/jdk${JDK_FEATURE}/${JDK_BUILD}/binaries/${JDK_ARCHIVE}
+  JDK_HOME=jdk-${JDK_BUILD}
+fi
+
+#
+# 10
+#
+if [ "${JDK_FEATURE}" == '10' ]; then
+  if [ "${JDK_BUILD}" == '?' ]; then
+    TMP=$(curl -L jdk.java.net/${JDK_FEATURE})
+    TMP="${TMP#*Most recent build: jdk-${JDK_FEATURE}+}"    # remove everything before the
number
+    TMP="${TMP%%<*}"                                        # remove everything after
the number
+    JDK_BUILD="$(echo -e "${TMP}" | tr -d '[:space:]')"     # remove all whitespace
+  fi
+
+  JDK_ARCHIVE=${JDK_BASENAME}-${JDK_FEATURE}+${JDK_BUILD}_linux-x64_bin.tar.gz
+  JDK_URL=${JDK_DOWNLOAD}/jdk${JDK_FEATURE}/archive/${JDK_BUILD}/${JDK_LICENSE}/${JDK_ARCHIVE}
+  JDK_HOME=jdk-${JDK_FEATURE}
+fi
+
+#
+# Create any missing intermediate paths, switch to workspace, download, unpack, switch back.
+#
+mkdir -p ${JDK_WORKSPACE}
+cd ${JDK_WORKSPACE}
+wget ${JDK_URL}
+tar -xzf ${JDK_ARCHIVE}
+cd -
+
+#
+# Update environment and test-drive.
+#
+export JAVA_HOME=${JDK_WORKSPACE}/${JDK_HOME}
+export PATH=${JAVA_HOME}/bin:$PATH
+
+java --version


Mime
View raw message