Commit df0d5b48 authored by Shaun Burch's avatar Shaun Burch 💻

#12 Speed up builds with Gradle caching

parent 24f04b27
Pipeline #22096829 passed with stages
in 9 minutes
......@@ -3,31 +3,44 @@
image: openjdk:8-jdk
variables:
# Speed up Docker
DOCKER_DRIVER: overlay2
# Android Variables
ANDROID_COMPILE_SDK: "26"
ANDROID_BUILD_TOOLS: "25.0.2"
ANDROID_SDK_TOOLS: "27.0.1"
stages:
- build
- test
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 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
- unzip -q android-sdk.zip -d android-sdk-linux
# Accept Licenses
- mkdir android-sdk-linux/licenses
- printf "d56f5187479451eabf01fb78af6dfcb131a6481e" > android-sdk-linux/licenses/android-sdk-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 "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 PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- chmod +x ./gradlew
stages:
- build
- test
# Cache da things for the branch
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- .gradle/wrapper
- .gradle/caches
build:
stage: build
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment