【发布时间】:2017-05-25 05:05:52
【问题描述】:
关于 Bintray-release 插件
我正在使用bintray-release 将我的库上传到 maven。它的文档说明了如何使用它:
使用发布闭包来设置你的包的信息:
publish {
userOrg = 'novoda'
groupId = 'com.novoda'
artifactId = 'bintray-release'
publishVersion = '0.3.4'
desc = 'Oh hi, this is a nice description for a project, right?'
website = 'https://github.com/novoda/bintray-release'
}
最后使用任务
bintrayUpload发布
$ ./gradlew clean build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PdryRun=false
就我而言
然后我定义我的publish 闭包:
publish {
groupId = 'com.uniquestudio'
artifactId = 'parsingplayer'
publishVersion = '2.0.6'
website = 'https://github.com/TedaLIEz/ParsingPlayer'
Properties properties = new Properties()
InputStream inputStream = project.rootProject.file('local.properties').newDataInputStream() ;
properties.load( inputStream )
bintrayUser = properties.getProperty('bintrayUser')
bintrayKey = properties.getProperty('bintrayKey')
}
如您所见,出于安全考虑,我将bintrayUser 和bintrayKey 放入local.properties。
我的问题
首先
我知道我可以将bintrayUser 和bintrayKey 放在loacal.properties 和gradle.properties 中。有没有其他方法来存储私有数据,而我认为不适合在当前项目中存储私有数据?
第二
一切正常,但是当我将项目推送到 CI 时,出现错误:
/home/travis/build/TedaLIEz/ParsingPlayer/local.properties(没有这样的文件或目录)
所以我想知道 gradle 任务如何处理扩展对象,在我的情况下,publish 对象。有没有办法解决它?
【问题讨论】:
标签: android gradle groovy android-gradle-plugin