Skip to content

Commit

Permalink
更新上传依赖配置
Browse files Browse the repository at this point in the history
  • Loading branch information
VeiZhang committed Jan 8, 2018
1 parent 21e8cf6 commit 475e086
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 50 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:2.3.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
80 changes: 32 additions & 48 deletions retrofit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.novoda:bintray-release:0.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}

/**避免中文注释:编码GBK的不可映射字符**/
tasks.withType(Javadoc) {
options {
encoding "UTF-8"
charSet 'UTF-8'
links "http://docs.oracle.com/javase/7/docs/api"
}
}
}

android {
compileSdkVersion 25
Expand Down Expand Up @@ -64,22 +36,46 @@ dependencies {
compile 'io.reactivex:rxandroid:1.2.1'
}

/*********************上传jCenter依赖*********************/
apply plugin: 'com.novoda.bintray-release'

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.novoda:bintray-release:0.8.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

/**避免中文注释:编码GBK的不可映射字符**/
tasks.withType(Javadoc) {
options {
encoding "UTF-8"
charSet 'UTF-8'
links "http://docs.oracle.com/javase/7/docs/api"
}
}

/**避免Javadocs错误:找不到引用**/
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}

/**发布到我的Bintray仓库**/
def user = getBintrayUser()
def key = getBintrayKey()
def userOrganization = getUserOrg()
def user = getPropertyValue('bintrayUser')
def key = getPropertyValue('bintrayKey')
def org = getPropertyValue('userOrg')

publish {
bintrayUser = user
bintrayKey = key
dryRun = false
userOrg = userOrganization
userOrg = org
groupId = 'com.excellence'
artifactId = 'retrofit'
publishVersion = '1.0.0'
Expand All @@ -88,28 +84,16 @@ publish {
licences = ['Apache-2.0']
}

/**读取bintray.key文件的user**/
def getBintrayUser() {
return getBintrayProperty('bintrayUser');
}

/**读取bintray.key文件的key**/
def getBintrayKey() {
return getBintrayProperty('bintrayKey');
}

/**读取bintray.key文件的userOrg**/
def getUserOrg() {
return getBintrayProperty('userOrg');
}
def getPropertyValue(String key) {
if (key == null || key.length() == 0)
return null

/**读取文件里字段值**/
def getBintrayProperty(String key) {
File file = project.rootProject.file('../../bintray.key')
if (!file.exists())
return null

InputStream inputStream = file.newDataInputStream();
InputStream inputStream = file.newDataInputStream()
Properties properties = new Properties()
properties.load(inputStream)

Expand Down

0 comments on commit 475e086

Please sign in to comment.