Skip to content

Commit 44c9b62

Browse files
authored
Updates buildscript to CircleCI 2.0
1 parent d448f5c commit 44c9b62

File tree

6 files changed

+104
-65
lines changed

6 files changed

+104
-65
lines changed

.circleci/config.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ DemoApp/.settings
1212
DemoApp/bin
1313
DemoApp/gen
1414
DemoApp/target
15-
.idea/libraries
16-
.idea/*.xml
15+
.idea
1716
**/R.java

androidplot-core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ android {
7474
lintOptions {
7575
abortOnError false
7676
}
77-
buildToolsVersion '25.0.0'
77+
buildToolsVersion theBuildToolsVersion
7878
}
7979

8080
group = 'com.androidplot'
@@ -86,7 +86,7 @@ def gitUrl = 'https://github.com/halfhp/androidplot.git'
8686
dependencies {
8787

8888
compile 'com.halfhp.fig:figlib:1.0.3'
89-
compile 'com.android.support:support-annotations:24.2.0'
89+
compile 'com.android.support:support-annotations:25.3.1'
9090
testCompile "org.mockito:mockito-core:1.10.19"
9191
testCompile group: 'junit', name: 'junit', version: '4.12'
9292
testCompile "org.robolectric:robolectric:3.1"

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ buildscript {
3838
}
3939

4040
dependencies {
41-
classpath 'com.android.tools.build:gradle:2.3.2'
41+
classpath 'com.android.tools.build:gradle:2.3.3'
4242
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
4343
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
4444
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.5.0'

circle.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

demoapp-wearable/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ buildscript {
1919
jcenter()
2020
}
2121
dependencies {
22-
classpath 'com.android.tools.build:gradle:2.3.2'
22+
classpath 'com.android.tools.build:gradle:2.3.3'
2323
}
2424
}
2525
apply plugin: 'com.android.application'

0 commit comments

Comments
 (0)