Skip to content

Instantly share code, notes, and snippets.

@rahuldream11
Last active October 20, 2017 13:16
Show Gist options
  • Save rahuldream11/04a62d3526b60c41e2180fd69c41aed8 to your computer and use it in GitHub Desktop.
Save rahuldream11/04a62d3526b60c41e2180fd69c41aed8 to your computer and use it in GitHub Desktop.
AndroidHelper
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
def ORGANISATION_NAME = "dream11"
def BINTRAY_REPO_NAME = "android-infra"
version = project.VERSION_NAME
group = project.PACKAGE_NAME
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_API_KEY")
configurations = ['archives'] //When uploading configuration files
// // - OR -
// publications = ['DefaultBinaryContainer_Decorated'] //When uploading Maven-based publication files
// - AND/OR -
// filesSpec { //When uploading any arbitrary files ('filesSpec' is a standard Gradle CopySpec)
// from 'arbitrary-files'
// into 'standalone_files/level1'
// rename '(.+)\\.(.+)', '$1-suffix.$2'
// }
// dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
//Package configuration. The plugin will use the repo and name properties to check if the package already exists. In that case, there's no need to configure the other package properties (like userOrg, desc, etc).
pkg {
repo = BINTRAY_REPO_NAME
name = project.PACKAGE_NAME
userOrg = ORGANISATION_NAME //An optional organization name when the repo belongs to one of
// the
// user's
// orgs
desc = project.DESCRIPTION
licenses = ['Apache-2.0']
// websiteUrl = 'https://github.com/bintray/gradle-bintray-plugin'
// issueTrackerUrl = 'https://github.com/bintray/gradle-bintray-plugin/issues'
vcsUrl = project.gitUrl
// labels = ['gear', 'gore', 'gorilla']
// publicDownloadNumbers = true
// attributes= ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee'] //Optional package-level attributes
//Optional version descriptor
// version {
//// name = VERSION_NAME //Bintray logical version name
// desc = DESCRIPTION
// released = new Date()
// vcsTag = VERSION_NAME
//// attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] //Optional version-level attributes
// //Optional configuration for GPG signing
// //Optional configuration for Maven Central sync of the version
//// mavenCentralSync {
//// sync = false //Optional (true by default). Determines whether to sync the version to
//// // Maven Central.
//// user = 'userToken' //OSS user token
//// password = 'paasword' //OSS user password
//// close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
//// }
// }
}
}
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
name 'Bintray publish Gradle aar example'
url project.siteUrl
// Add your description here
name project.PACKAGE_NAME
description project.DESCRIPTION
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id System.getenv("BINTRAY_DEVELOPER_ID")
name System.getenv("BINTRAY_DEVELOPER_NAME")
email System.getenv("BINTRAY_DEVELOPER_EMAIL")
}
}
// scm {
// //connection gitUrl
// //developerConnection gitUrl
// //url siteUrl
//
// }
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
destinationDir = file("../javadoc/")
failOnError false
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment