summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml12
-rw-r--r--scripts/android/after_success.sh12
-rw-r--r--scripts/android/before_install.sh19
-rw-r--r--scripts/android/travisbuild.sh12
4 files changed, 55 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index c01c72d44..72cf07aed 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -47,6 +47,18 @@ matrix:
- libhyphen-dev
- libicu52
+ - env: SUBSURFACE_PLATFORM="android"
+ # Currently hard coded to arm
+ os: linux
+ language: c++
+ services:
+ - docker
+# TODO: caching
+# cache:
+# timeout: 300
+# directories:
+# - 3pp
+
before_install:
- source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/before_install.sh
diff --git a/scripts/android/after_success.sh b/scripts/android/after_success.sh
new file mode 100644
index 000000000..42d402cd9
--- /dev/null
+++ b/scripts/android/after_success.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+if [ ! -z $TRAVIS_BRANCH ] && [ "$TRAVIS_BRANCH" != "master" ] ; then
+ export UPLOADTOOL_SUFFIX=$TRAVIS_BRANCH
+fi
+
+echo "Submitting the folloing apk for continuous build release:"
+ls -lh $TRAVIS_BUILD_DIR/apk/*.apk
+
+# get and run the upload script
+wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
+bash ./upload.sh $TRAVIS_BUILD_DIR/apk/*.apk
diff --git a/scripts/android/before_install.sh b/scripts/android/before_install.sh
new file mode 100644
index 000000000..000d1a760
--- /dev/null
+++ b/scripts/android/before_install.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Travis only pulls shallow repos. But that messes with git describe.
+# Sorry Travis, fetching the whole thing and the tags as well...
+git fetch --unshallow
+git pull --tags
+git describe
+
+# Ugly, but keeps it running during the build
+docker run -v $PWD:/workspace/subsurface --name=builder -w /workspace -d ubuntu /bin/sleep 60m
+docker exec -t builder apt-get update
+# subsurface android build dependencies
+docker exec -t builder apt-get install -y git cmake autoconf libtool-bin openjdk-8-jdk-headless ant wget unzip python bzip2 pkg-config
+# Qt installer dependencies
+docker exec -t builder apt-get install -y libx11-xcb1 libgl1-mesa-glx libglib2.0-0
+# Inject cached 3pp's (if none exists in 3pp dir, we inject zero ones, and all is downloaded in the container)
+# TODO: caching
+#docker cp 3pp builder:/workspace
+docker exec -t builder mkdir -p /workspace/3pp
diff --git a/scripts/android/travisbuild.sh b/scripts/android/travisbuild.sh
new file mode 100644
index 000000000..4887ea684
--- /dev/null
+++ b/scripts/android/travisbuild.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+docker exec -t builder subsurface/packaging/android/android-build-wrapper.sh
+
+# Extract the built apk from the builder container
+docker cp builder:/workspace/subsurface-mobile-build-arm/build/outputs/apk/ .
+
+# TODO: Caching
+# Yank Qt, android-sdk, android-ndk and other 3pp source tar balls out from the container and cache them.
+#docker exec builder mkdir -p 3pp
+#docker exec builder sh -c 'mv Qt android-sdk-linux android-ndk-* *.tar.gz *.tar.bz2 3pp/'
+#docker cp builder:/workspace/3pp .