This doc is used to clarify how to publish Lego library to jCenter.
- change versionName and versionCode in base
build.gradle
->ext.publish.legoVersion(Code)
; - execute
./gradlew install; ./gradlew bintrayUpload
First we have three library to publish: 2 java libraries(jar) + 1 android library(aar). And I write two gradle scripts for publish jar&aar separating library.
Let's use lego-annotation
as example. Write two lines in lego-annotation/build.gradle
as below:
ext.jarPublishName='lego-annotation';
apply from: '../jarPublish.gradle'
If you need to update library version, go to base build.gradle and change ext.publish.legoVersion
field.
That's all.
Put this line in lego-library/build.gradle
as below:
apply from: '../aarPublish.gradle'
./gradlew install;
this will generate jar/aar file in ~/.m2/repo...
./gradlew bintrayUpload
this will upload library to bintray
https://bintray.com/wingjay https://www.jianshu.com/p/1502674152bd