chiark / gitweb /
travis-ci: get OSX tests running again...
authorHans-Christoph Steiner <hans@eds.org>
Wed, 18 Oct 2017 11:40:32 +0000 (13:40 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 19 Oct 2017 18:23:57 +0000 (20:23 +0200)
Java9 is starting to roll out on some of the Travis CI machines, but
the Android SDK does not yet work on Java9, it throws:

java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema

.travis.yml

index 8d491b3d0ce9511da2e143b9cd392cf64c449062..9d78587c951db9a42d69c471b3fc64ab4f91df39 100644 (file)
@@ -7,7 +7,7 @@ matrix:
     - os: linux
       language: android
     - os: osx
-      osx_image: xcode9
+      osx_image: xcode9.1
       env: ANDROID_SDK_ROOT=/usr/local/share/android-sdk
       env: ANDROID_HOME=/usr/local/share/android-sdk
     - os: osx
@@ -46,13 +46,21 @@ android:
     - 'android-sdk-license-.+'
 
 # the PPA is needed on Ubuntu 14.04 precise, and with python3, trusty too
-# the pip thing is a hack that can go away with trusty
+# the pip thing is a hack that can go away with trusty.
+#
+# * ensure java8 is installed since Android SDK doesn't work with Java9
+# * Java needs to be at least 1.8.0_131 to have MD5 properly disabled
+#   https://blogs.oracle.com/java-platform-group/oracle-jre-will-no-longer-trust-md5-signed-code-by-default
+#   https://opsech.io/posts/2017/Jun/09/openjdk-april-2017-security-update-131-8u131-and-md5-signed-jars.html
 install:
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
       brew update > /dev/null;
       brew install dash bash python3 gradle jenv;
       brew install gnu-sed --with-default-names;
-      brew cask reinstall java;
+      if ! ruby -e 'v = `javac -version 2>&1`.split()[1].gsub("_", "."); exit Gem::Dependency.new("", "~> 1.8.0.131").match?("", v)'; then
+        brew cask uninstall java --force;
+        brew cask install caskroom/versions/java8;
+      fi;
       brew cask install android-sdk;
 
       mkdir -p "$ANDROID_HOME/licenses";