如何上传函数库到 JCenter
2017-02-12 本文已影响0人
码上述Andy
如何上传函数库到 JCenter
一.首先去https://bintray.com 申请账号
二.设置API Key,如图:
Paste_Image.png三.在项目build.gradle里添加:classpath 'com.novoda:bintray-release:0.3.4' (看目前版本)
四.在需要上传的modues的build.gradle添加:
1.apply plugin: 'com.novoda.bintray-release'
2.publish {
userOrg = 'chowenzhou' (bintray.com用户名)
groupId = 'com.chowen.lightutils' (jcenter上的路径)
artifactId = 'LightUtils' (项目名称)
publishVersion = '1.0.2' (版本号)
desc = 'the description for a project' (项目描述)
website = 'https://github.com/zhouwenhn/lightUtils' (网站)
}
五.最后上传即可
执行命令:
mac:./gradlew clean build bintrayUpload -PbintrayUser=chowenzhou -PbintrayKey=12321312a313222b760b36f95cea112312321~例子(api key:第二步生成的) -PdryRun=false
window:gradlew.bat clean build bintrayUpload -PbintrayUser=chowenzhou -PbintrayKey=12321312a313222b760b36f95cea112312321~例子(api key:第二步生成的) -PdryRun=false
控制台执行gradle上传成功后效果如下:
Paste_Image.png