1+ # Java Gradle CircleCI 2.0 configuration file
2+ #
3+ # Check https://circleci.com/docs/2.0/language-java/ for more details
4+ #
5+ version : 2
6+
7+ general :
8+ branches :
9+ only :
10+ # - circleci
11+ jobs :
12+ build :
13+ docker :
14+ # specify the version you desire here
15+ # - image: circleci/openjdk:8-jdk
16+
17+ # CircleCI maintains a library of pre-built images
18+ # documented at https://circleci.com/docs/2.0/circleci-images/
19+ - image : circleci/android:api-25-alpha
20+
21+ working_directory : ~/repo
22+
23+ environment :
24+ # Customize the JVM maximum heap limit
25+ JVM_OPTS : -Xmx3200m
26+ TERM : dumb
27+ # KEYSTORE: ${CIRCLE_WORKING_DIRECTORY}/sigining.keystore
28+ # PUBLISHER_ACCT_JSON_FILE: ${CIRCLE_WORKING_DIRECTORY}/publisher_profile.json
29+
30+ steps :
31+ - checkout
32+
33+ - run : echo 'export KEYSTORE=${HOME}/repo/sigining.keystore' >> $BASH_ENV
34+ - run : echo 'export PUBLISHER_ACCT_JSON_FILE=${HOME}/repo/publisher_profile.json' >> $BASH_ENV
35+
36+ # Download and cache dependencies
37+ - restore_cache :
38+ keys :
39+ - v1-dependencies-{{ checksum "build.gradle" }}
40+ # fallback to using the latest cache if no exact match is found
41+ - v1-dependencies-
42+
43+ # Get private keys etc
44+ - run : ./misc/download_keystore.sh
45+ - run : ./misc/inject_circle_build_number.sh
46+
47+ - run : ./gradlew dependencies
48+
49+ - save_cache :
50+ paths :
51+ - ~/.m2
52+ key : v1-dependencies-{{ checksum "build.gradle" }}
53+
54+ # run tests & code coc!
55+ - run : ./gradlew testDebug jacocoTestReportDebug
56+
57+ # build release
58+ - run : ./gradlew assembleRelease
59+
60+ # javadoc
61+ - run : ./gradlew javadoc
62+
63+ # trigger codecod.io
64+ - run : bash <(curl -s https://codecov.io/bash)
65+
66+ - store_artifacts :
67+ path : androidplot-core/build/outputs/aar/
68+ destination : aar
69+
70+ - store_artifacts :
71+ path : demoapp/build/outputs/apk/
72+ destination : apk
73+
74+ - store_artifacts :
75+ path : androidplot-core/build/reports/jacoco/debug/
76+ destination : coverage_report
77+
78+ - store_artifacts :
79+ path : androidplot-core/build/reports/tests/
80+ destination : test_results
81+
82+ - store_test_results :
83+ path : androidplot-core/build/test-results/
84+
85+ - deploy :
86+ name : " Deploy to Bintray"
87+ command : |
88+ if [ "${CIRCLE_BRANCH}" == "master" ];
89+ then ./gradlew bintrayUpload;
90+ fi
91+
92+ - deploy :
93+ name : " Deploy to Google Play"
94+ command : |
95+ if [ "${CIRCLE_BRANCH}" == "master" ];
96+ then
97+ ./misc/download_google_publisher_json.sh;
98+ ./gradlew publishApkRelease
99+ fi
0 commit comments