Publish an Android library on jCenter

dependencies {
compile project(':library-module-name')
}
bintray_user=your bintray user
bintray_organisation= your bintray organisation
bintray_apikey=your bintray api key
bintray_gpg_passphrase=your gpg passphrase
projectVersionName=1.3.0
projectVersionCode=5

libDescription=Android library to scan for iBeacons.
libUrl=https://github.com/inthepocket/ibeacon-scanner-android
libGit=https://github.com/inthepocket/ibeacon-scanner-android.git
libLicenseUrl=https://github.com/inthepocket/ibeacon-scanner-android/blob/master/LICENSE.md
libGroupId=mobi.inthepocket.ibeaconscanner
libArtifactId=ibeaconscanner
plugins {
id “com.jfrog.bintray” version “1.7.2” // jCenter
id “com.github.dcendents.android-maven” version “1.5” // maven
}
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
// for Bintray
def projectVersionCodeNr = Integer.parseInt(projectVersionCode);
def libGit = libGit;
def libUrl = libUrl;
def libDescription = libDescription
def libGroupId = libGroupId;
def libArtifactId = libArtifactId;

// for Maven
group = libGroupId
version = projectVersionName
install {
repositories.mavenInstaller {
pom.project {
name libArtifactId
description libDescription
url libUrl
inceptionYear '2016'

packaging 'aar'
groupId libGroupId
artifactId libArtifactId
version projectVersionName

licenses {
license {
name 'MIT'
url libLicenseUrl
}
}
}
}
}

bintray {
user = bintray_user
key = bintray_apikey
pkg {
repo = libGroupId
name = libArtifactId
userOrg = bintray_user_org
licenses = ['MIT']
vcsUrl = libGit
version {
name = projectVersionName
gpg {
sign = true
passphrase = bintray_gpg_phrase
}
}
}
configurations = ['archives']
}
./gradlew :library-module-name:clean
./gradlew :library-module-name:assembleRelease
./gradlew :library-module-name:bintrayUpload

--

--

React Native + Android | 🏄‍♂️ kitesurfer | 🌊 ocean addict | 💗 open source | 🌍 climate

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store