Source: unsplash.com

How to distribute Android library in a convenient way

compile 'com.android.support:appcompat-v7:25.1.0'
repositories {
jcenter()
}

First: Create your account on JFrog Bintray

Second: Create your new repository

Add a new package
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// Two necessary plugins
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}
}
bintray.user=your_username 
bintray.apikey=your_apikey //Go to your profile page on bintray homepage
bintray.gpg.password=your_gpg_passphrase //Remember when you generated gpg key.
ext {

//For bintray and jcenter distribution
bintrayRepo = 'maven'
bintrayName = 'sample-library'

publishedGroupId = 'com.example.sample'
libraryName = 'SampleLibrary'
artifact = 'sample-library' //This artifact name should be the same with library module name

libraryDescription = 'Simple, clean and short description'

siteUrl = 'https://github.com/username/sample-library'
gitUrl = 'https://github.com/username/sample-library.git'

libraryVersion = '1.0.0'

developerId = 'your_id'
developerName = 'your_name'
developerEmail = 'your_email'
organization = 'your_organization' // if you push to organization's repository.
licenseName = 'The Apache Software License, Version 2.0' //Example for license
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]

}
//These two remote files contain Bintray configuration as described above.
apply from: 'https://raw.githubusercontent.com/quangctkm9207/template-files/master/android/gradle/install.gradle'
apply from: 'https://raw.githubusercontent.com/quangctkm9207/template-files/master/android/gradle/bintray.gradle'
repositories{
maven {
url "http://dl.bintray.com/your_username/maven"
}
}

Software engineer and designer, currently building digital scent technology at aromajoin.com. Side project: tinido.com.

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