diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | .travis.yml | 2 | ||||
-rwxr-xr-x | install-custom-gradle-test-plugin.sh | 15 | ||||
-rwxr-xr-x | prepare-tests.sh | 30 | ||||
-rw-r--r-- | settings.gradle | 1 |
5 files changed, 34 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore index 1dfe84d5a..68f5b5a9e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,9 @@ ant.properties .gradle build gradle.properties +# this is in here because the prepare-tests thing modifies it, and we DON'T +# want this to be commited. use git add -f to work on this file. +settings.gradle #Maven target diff --git a/.travis.yml b/.travis.yml index fd6e55ea7..ef69eb556 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: # Install required Android components. #- echo "y" | android update sdk -a --filter build-tools-19.1.0,android-19,platform-tools,extra-android-support,extra-android-m2repository --no-ui --force - ( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk --no-ui --all --force --filter build-tools-19.1.0,android-19,platform-tools,extra-android-support,extra-android-m2repository - - ./install-custom-gradle-test-plugin.sh + - ./prepare-tests.sh install: echo "Installation done" script: - gradle assemble -S -q diff --git a/install-custom-gradle-test-plugin.sh b/install-custom-gradle-test-plugin.sh deleted file mode 100755 index 85c13d959..000000000 --- a/install-custom-gradle-test-plugin.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -mkdir temp -cd temp - - git clone https://github.com/nenick/gradle-android-test-plugin.git - cd gradle-android-test-plugin - - echo "rootProject.name = 'gradle-android-test-plugin-parent'" > settings.gradle - echo "include ':gradle-android-test-plugin'" >> settings.gradle - - ./gradlew :gradle-android-test-plugin:install - - cd .. -cd ..
\ No newline at end of file diff --git a/prepare-tests.sh b/prepare-tests.sh new file mode 100755 index 000000000..027c76f84 --- /dev/null +++ b/prepare-tests.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# This script installs a plugin which is necessary to run OpenKeychain's tests +# into the local maven repository, then puts a line to include the -Test +# subproject into settings.gradle + +echo "checking jdk runtime.." +if ! java -version 2>&1 | grep OpenJDK; then + echo "tests will only run on openjdk, see readme for details!" >&2 + return +fi + +tmpdir="$(mktemp -d)" +( + cd "$tmpdir"; + git clone https://github.com/nenick/gradle-android-test-plugin.git + cd gradle-android-test-plugin + echo "rootProject.name = 'gradle-android-test-plugin-parent'" > settings.gradle + echo "include ':gradle-android-test-plugin'" >> settings.gradle + ./gradlew :gradle-android-test-plugin:install +) +rm -rf "$tmpdir" + +echo -n "ok, adding tests to include list.. " +if grep OpenKeychain-Test settings.gradle >/dev/null ; then + echo " already in." +else + echo "include ':OpenKeychain-Test'" >> settings.gradle + echo "ok" +fi diff --git a/settings.gradle b/settings.gradle index 86088e04a..d8802320c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,4 @@ include ':OpenKeychain' -include ':OpenKeychain-Test' include ':extern:openpgp-api-lib' include ':extern:openkeychain-api-lib' include ':extern:html-textview' |