登录
使用bintray-release发布
使用github
帐号登录https://bintray.com/ ,
你可以点击Your Profile
->Edit
->API Key
,复制。
AS
在最顶层的gradle
中添加
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| buildscript { repositories {...} dependencies { classpath 'com.android.tools.build:gradle:2.1.2' classpath 'com.novoda:bintray-release:0.3.4' } } allprojects { repositories {...} tasks.withType(Javadoc) { options{ encoding "UTF-8" charSet 'UTF-8' links "http://docs.oracle.com/javase/7/docs/api" } } }
|
在想要上传的module
添加
1 2 3 4 5 6 7 8 9 10 11 12
| apply plugin: 'com.android.library' apply plugin: 'com.novoda.bintray-release' android {...} dependencies {...} publish { userOrg = 'ahaochan' groupId = 'com.ahaochan' artifactId = 'TabLayout' publishVersion = '0.0.2' desc = 'Imitate WeChat6.0 TabLayout' website = 'https://github.com/Ahaochan/TabLayout' }
|
最后在AS
底下的Terminal
中输入
1 2 3 4
| gradlew clean build bintrayUpload -PbintrayUser=ahaochan -PbintrayKey=之前复制的key -PdryRun=false
|