Skip to content

Commit

Permalink
improve deployBintray
Browse files Browse the repository at this point in the history
  • Loading branch information
hotstu committed May 14, 2019
1 parent 687a47a commit 127c329
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions deployBintray.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
//打包 上传需在命令行执行 gradlew :tinyritro-compiler:bintrayUpload, 点击任务执行会报错
//config ~/.gradle/gradle.properties add your bintray_user & bintray_key first
//打包 上传需在命令行执行 gradlew bintrayUpload, 点击任务执行会报错
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

if (!bintray_user) {
print("add your bintray_user & bintray_key first")
return
}
Properties properties = new Properties()

File projectPropertiesFile = rootProject.file('project.properties')
properties.load(projectPropertiesFile.newDataInputStream())



def keystoreProperties = new Properties()
try {
def keystorePropertiesFile = rootProject.file("local.properties");
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

} catch (Exception e) {
println("local.properties not exits, return")
return
}
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
Expand Down Expand Up @@ -77,8 +71,8 @@ artifacts {
archives sourcesJar
}
bintray {
user = keystoreProperties['bintray.user']
key = keystoreProperties['bintray.key']
user = "${bintray_user}"
key = "${bintray_key}"
configurations = ['archives']
pkg {
repo = properties.getProperty("project.repo")
Expand All @@ -95,6 +89,6 @@ javadoc { //javadoc 采用 utf-8 编码否则会报“GBK的不可映射字符
encoding "UTF-8"
charSet "UTF-8"
addStringOption('Xdoclint:none', '-quiet')
}

}
}

0 comments on commit 127c329

Please sign in to comment.