...
 
Commits (2)
...@@ -3,31 +3,44 @@ ...@@ -3,31 +3,44 @@
image: openjdk:8-jdk image: openjdk:8-jdk
variables: variables:
# Speed up Docker
DOCKER_DRIVER: overlay2
# Android Variables
ANDROID_COMPILE_SDK: "26" ANDROID_COMPILE_SDK: "26"
ANDROID_BUILD_TOOLS: "25.0.2" ANDROID_BUILD_TOOLS: "25.0.2"
ANDROID_SDK_TOOLS: "27.0.1" ANDROID_SDK_TOOLS: "27.0.1"
stages:
- build
- test
before_script: before_script:
# Set gradle home in pwd
- export GRADLE_USER_HOME=`pwd`/.gradle
# Update & install some tools
- apt-get --quiet update --yes - apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
# Get Android SDK
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
- unzip -q android-sdk.zip -d android-sdk-linux - unzip -q android-sdk.zip -d android-sdk-linux
# Accept Licenses
- mkdir android-sdk-linux/licenses - mkdir android-sdk-linux/licenses
- printf "d56f5187479451eabf01fb78af6dfcb131a6481e" > android-sdk-linux/licenses/android-sdk-license - printf "d56f5187479451eabf01fb78af6dfcb131a6481e" > android-sdk-linux/licenses/android-sdk-license
- printf "d975f751698a77b662f1254ddbeed3901e976f5a" > android-sdk-linux/licenses/intel-android-extra-license - printf "d975f751698a77b662f1254ddbeed3901e976f5a" > android-sdk-linux/licenses/intel-android-extra-license
# Update SDK
- android-sdk-linux/tools/bin/sdkmanager --update > update.log - android-sdk-linux/tools/bin/sdkmanager --update > update.log
- android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" "build-tools;${ANDROID_BUILD_TOOLS}" "extras;google;m2repository" "extras;android;m2repository" > installPlatform.log - android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" "build-tools;${ANDROID_BUILD_TOOLS}" "extras;google;m2repository" "extras;android;m2repository" > installPlatform.log
# Export Env Vars, make gradle executable
- export ANDROID_HOME=$PWD/android-sdk-linux - export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/ - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- chmod +x ./gradlew - chmod +x ./gradlew
stages: # Cache da things for the branch
- build cache:
- test key: "$CI_COMMIT_REF_NAME"
paths:
- .gradle/wrapper
- .gradle/caches
build: build:
stage: build stage: build
......