-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
40 lines (36 loc) · 1.82 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "29"
ANDROID_BUILD_TOOLS: "29.0.2"
ANDROID_SDK_TOOLS: "6858069"
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip
- unzip -d android-sdk-linux android-sdk.zip
- mkdir -p android-sdk-linux/cmdline-tools/tools/
# The cmdline-tools expect a specific directory structure, move all files into the tools subdir
# https://stackoverflow.com/questions/60440509/android-command-line-tools-sdkmanager-always-shows-warning-could-not-create-se
- mv android-sdk-linux/cmdline-tools/bin android-sdk-linux/cmdline-tools/tools/
- mv android-sdk-linux/cmdline-tools/lib android-sdk-linux/cmdline-tools/tools/
- mv android-sdk-linux/cmdline-tools/NOTICE.txt android-sdk-linux/cmdline-tools/tools/
- mv android-sdk-linux/cmdline-tools/source.properties android-sdk-linux/cmdline-tools/tools/
- echo y | android-sdk-linux/cmdline-tools/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null
- echo y | android-sdk-linux/cmdline-tools/tools/bin/sdkmanager "platform-tools" >/dev/null
- echo y | android-sdk-linux/cmdline-tools/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- chmod +x ./gradlew
# temporarily disable checking for EPIPE error and use yes to accept all licenses
- set +o pipefail
- yes | android-sdk-linux/cmdline-tools/tools/bin/sdkmanager --licenses
- set -o pipefail
stages:
- build
assembleDebug:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
- app/build/outputs/