Skip to content

Commit dcfb78d

Browse files
Merge pull request gzu-liyujiang#48 from msdx/travis-ci
Travis ci support
2 parents 6b5242b + 562e012 commit dcfb78d

2 files changed

Lines changed: 24 additions & 9 deletions

File tree

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: android
2+
jdk:
3+
- oraclejdk8
4+
android:
5+
components:
6+
- tools
7+
- build-tools-22.0.1
8+
- android-24
9+
- extra-android-m2repository
10+
11+
script:
12+
- ./gradlew aDebug

build.gradle

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ subprojects {
180180
}
181181

182182
bintray {
183-
Properties properties = new Properties()
184-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
185-
user = properties.getProperty("bintray.user")
186-
key = properties.getProperty("bintray.apikey")
183+
// You should configure "bintray.user" and "bintray.apiKey" in the gradle.properties
184+
// that in gradle cache directory
185+
user = safeGetProperty("bintray.user")
186+
key = safeGetProperty("bintray.apikey")
187187

188188
publications = ['mavenJava']
189189
publish = true //是否发布
@@ -202,14 +202,13 @@ subprojects {
202202
desc = project.pomDescription
203203
gpg {
204204
sign = false //是否GPG签名,可使用Gpg4win创建密钥文件
205-
passphrase = properties.getProperty("bintray.gpg.password")
206-
//GPG签名所用密钥
205+
//GPG签名所用密钥
206+
passphrase = safeGetProperty("bintray.gpg.password")
207207
}
208208
mavenCentralSync {
209209
sync = false //是否同步到Maven Central
210-
user = properties.getProperty("sonatype.user") //sonatype用户名
211-
password = properties.getProperty("sonatype.password")
212-
//sonatype密码
210+
user = safeGetProperty("sonatype.user") //sonatype用户名
211+
password = safeGetProperty("sonatype.password") //sonatype密码
213212
close = '1'
214213
}
215214
}
@@ -221,3 +220,7 @@ subprojects {
221220
}
222221
}
223222

223+
String safeGetProperty(String key) {
224+
hasProperty("key") ? getProperty("key") : ""
225+
}
226+

0 commit comments

Comments
 (0)