From b43ce4454f1220f4f7638ad0f40e536a6242eac2 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Mon, 1 Dec 2014 22:33:29 -0500 Subject: [PATCH] Switch Travis build to Java Have to install Android manually, but allows me to upgrade on my schedule instead of waiting for Travis to update the components. Should fix #9, not going to worry about release builds yet --- .travis.yml | 8 ++++++-- android_install.sh | 14 ++++++++++++++ setup_js_build.sh | 43 ------------------------------------------- wait_for_emulator | 17 ----------------- 4 files changed, 20 insertions(+), 62 deletions(-) create mode 100644 android_install.sh delete mode 100755 setup_js_build.sh delete mode 100644 wait_for_emulator diff --git a/.travis.yml b/.travis.yml index 4be7cf3..b8908aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,9 @@ -# We still need android to get the build tools/support libraries -language: android +language: java +env: + - COMPONENTS="tools,platform-tools,build-tools-21.1.1,android-21,extra-android-m2repository,extra-android-support,extra-google-m2repository" + +before_script: + - ./android_install.sh $COMPONENTS script: - ./gradlew test diff --git a/android_install.sh b/android_install.sh new file mode 100644 index 0000000..a39adda --- /dev/null +++ b/android_install.sh @@ -0,0 +1,14 @@ +#!/bin/bash - + +wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz +tar xf android-sdk_r23.0.2-linux.tgz +cd android-sdk-linux/ +export ANDROID_HOME=`pwd` + +COMPONENT_ARRAY=$(echo $COMPONENTS | tr "," "\n") +for COMP in $COMPONENT_ARRAY +do + echo "yes" | tools/android update sdk -u -a -t $COMP +done + +cd - diff --git a/setup_js_build.sh b/setup_js_build.sh deleted file mode 100755 index d5228ac..0000000 --- a/setup_js_build.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -#=============================================================================== -# -# FILE: setup_js_build.sh -# -# USAGE: ./setup_js_build.sh -# -# DESCRIPTION: Set up a Linux host for building MinimalBible. It is possible -# to do in Windows, but Linux is scriptable. -# -# OPTIONS: --- -# REQUIREMENTS: --- -# BUGS: --- -# NOTES: --- -# AUTHOR: YOUR NAME (), -# ORGANIZATION: -# CREATED: 09/01/2014 15:19 -# REVISION: --- -#=============================================================================== - -set -o nounset # Treat unset variables as an error - -# Check for apt. This could be done with RPM, but I don't have access to a -# computer for it. -if [ `which apt-get` == "" ]; then - echo "Building on Redhat/RPM is not currently supported." - exit 1 -fi - -# We need root before doing anything else -if [ $UID != 0 ]; then - sudo bash "$0" - exit $? -fi - -# We don't really need Node, npm is enough. -apt-get install npm - -# Gulp needs a global install -npm install -g gulp - -# And run the rest of everything as the user who invoked sudo -sudo -u $SUDO_USER npm install diff --git a/wait_for_emulator b/wait_for_emulator deleted file mode 100644 index 207f028..0000000 --- a/wait_for_emulator +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -bootanim="" -failcounter=0 -until [[ "$bootanim" =~ "stopped" ]]; do - bootanim=`adb -e shell getprop init.svc.bootanim 2>&1` - echo "$bootanim" - if [[ "$bootanim" =~ "not found" ]]; then - let "failcounter += 1" - if [[ $failcounter -gt 3 ]]; then - echo "Failed to start emulator" - exit 1 - fi - fi - sleep 1 -done -echo "Done" \ No newline at end of file