文章摘要: 1、bintray-release是什么? 2、添加到工程方案。 3、示例
系列文章: bintray-release使用指南(一) bintray-release配置publish闭包(二) bintray-release自定义Publication(三) bintray-release定义额外产品(四) bintray-release添加对Maven Central同步的支持(五)
已经有很多帖子介绍了如何将Android Library或者artifacts上传到Bintray.com,那么本文就来介绍下这些文章借助的类库:com.novoda.bintray-release。
要使用此插件将库发布到bintray,请将以下这些依赖项添加到将要发布的模块的“build.gradle”中:
apply plugin: 'com.novoda.bintray-release' // must be applied after your artifact generating plugin (eg. java / com.android.library) buildscript { repositories { jcenter() } dependencies { classpath 'com.novoda:bintray-release:<latest-version>' } }使用publish闭包来设置你的应用的信息:
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