forked from googleads/googleads-mobile-android-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
93 lines (88 loc) · 3.69 KB
/
.travis.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
if: branch = master
language: minimal
os: linux
dist: xenial
group: edge
sudo: required
env:
global:
# for updates check developer.android.com/studio#downloads (current 26.1.1)
- ANDROID_SDK_TOOLS=sdk-tools-linux-4333796.zip
before_install:
# set JAVA_HOME path
- export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
# download and unzip Android SDK command line tools
- wget -nv https://dl.google.com/android/repository/$ANDROID_SDK_TOOLS
- unzip -q $ANDROID_SDK_TOOLS -d $HOME/sdk
# set SDK tools path variable and ANDROID_HOME
- export PATH=$PATH:$HOME/sdk/tools/bin
- export ANDROID_HOME=$HOME/sdk
# create empty cfg file to prevent sdkmanager warning message
- mkdir -p $HOME/.android && touch $HOME/.android/repositories.cfg
install:
# accept licenses for all available packages that have not already been accepted
- yes | sdkmanager --licenses >/dev/null
before_script:
# set executable flag for gradle wrapper
- chmod +x "${PROJ_DIR}/gradlew"
# create dir for gradle settings
- mkdir -p "${PROJ_DIR}/.gradle"
# disable gradle daemon for current user
- echo "org.gradle.daemon=false" >> "${PROJ_DIR}/.gradle/gradle.properties"
# set gradle log format to plain
- echo "org.gradle.console=plain" >> "${PROJ_DIR}/.gradle/gradle.properties"
matrix:
include:
- name: "java/advanced/BannerRecyclerViewExample"
env: PROJ_DIR="java/advanced/BannerRecyclerViewExample"
- name: "java/advanced/APIDemo"
env: PROJ_DIR="java/advanced/APIDemo"
- name: "java/admob/AdaptiveBannerExample"
env: PROJ_DIR="java/admob/AdaptiveBannerExample"
- name: "java/admob/BannerExample"
env: PROJ_DIR="java/admob/BannerExample"
- name: "java/admob/RewardedVideoExample"
env: PROJ_DIR="java/admob/RewardedVideoExample"
- name: "java/admob/NativeAdvancedExample"
env: PROJ_DIR="java/admob/NativeAdvancedExample"
- name: "java/admob/InterstitialExample"
env: PROJ_DIR="java/admob/InterstitialExample"
- name: "java/admanager/AdaptiveBannerExample"
env: PROJ_DIR="java/admanager/AdaptiveBannerExample"
- name: "java/admanager/BannerExample"
env: PROJ_DIR="java/admanager/BannerExample"
- name: "java/admanager/NativeAdsExample"
env: PROJ_DIR="java/admanager/NativeAdsExample"
- name: "java/admanager/RewardedVideoExample"
env: PROJ_DIR="java/admanager/RewardedVideoExample"
- name: "java/admanager/InterstitialExample"
env: PROJ_DIR="java/admanager/InterstitialExample"
- name: "kotlin/advanced/APIDemo"
env: PROJ_DIR="kotlin/advanced/APIDemo"
- name: "kotlin/admob/AdaptiveBannerExample"
env: PROJ_DIR="kotlin/admob/AdaptiveBannerExample"
- name: "kotlin/admob/BannerExample"
env: PROJ_DIR="kotlin/admob/BannerExample"
- name: "kotlin/admob/RewardedVideoExample"
env: PROJ_DIR="kotlin/admob/RewardedVideoExample"
- name: "kotlin/admob/NativeAdvancedExample"
env: PROJ_DIR="kotlin/admob/NativeAdvancedExample"
- name: "kotlin/admob/InterstitialExample"
env: PROJ_DIR="kotlin/admob/InterstitialExample"
- name: "kotlin/admanager/AdaptiveBannerExample"
env: PROJ_DIR="kotlin/admanager/AdaptiveBannerExample"
- name: "kotlin/admanager/BannerExample"
env: PROJ_DIR="kotlin/admanager/BannerExample"
- name: "kotlin/admanager/NativeAdsExample"
env: PROJ_DIR="kotlin/admanager/NativeAdsExample"
- name: "kotlin/admanager/RewardedVideoExample"
env: PROJ_DIR="kotlin/admanager/RewardedVideoExample"
- name: "kotlin/admanager/InterstitialExample"
env: PROJ_DIR="kotlin/admanager/InterstitialExample"
script:
- CHANGES=$(git --no-pager diff --name-only $TRAVIS_COMMIT_RANGE)
- if [[ -n "$(grep -E "(${PROJ_DIR}|\.travis\.yml)" <<< "$CHANGES")" ]]; then
pushd "$PROJ_DIR";
./gradlew build;
popd;
fi