Publish your android library to bintray (jcenter).
In you project's build.gradle
, add
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
inside the buildscript > dependencies:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' // this line
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // and this
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
In your project's local.properties
:
bintray.user= # your user name
bintray.apikey= # your api key
bintray.gpg.password= # your password
In your library module's build.gradle
, add:
ext {
bintrayRepo = 'Hong'
bintrayName = 'checkerboarddrawable'
publishedGroupId = 'com.github.duanhong169'
artifact = 'checkerboarddrawable'
libraryDescription = 'A custom Drawable to use as background which embody "transparent", AKA checkerboard grid.'
libraryVersion = '1.0.0'
gitUrl = 'https://github.com/duanhong169/CheckerboardDrawable.git'
siteUrl = 'https://github.com/duanhong169/CheckerboardDrawable'
licenseName = 'Apache License 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
Edit the values to yours as needed.
In your library module's build.gradle
, add:
apply from: 'https://raw.githubusercontent.com/duanhong169/bintray-gradle/master/bintray.gradle'
Or you can copy the bintray.gradle
file into your library module's root directory, and apply from it by add:
apply from: 'bintray.gradle'
The default bintray.gradle
will add the 'implementation' dependencies for your library automatically, so the library users only need to specify the dependency of your library. If this is not what you want, use the 'no transient' version:
apply from: 'https://raw.githubusercontent.com/duanhong169/bintray-gradle/master/bintray-no-transient.gradle'
Or:
apply from: 'bintray-no-transient'
Just run:
./gradlew clean install bintrayUpload
in your project root path.
See the project CheckerboardDrawable
for example.