diff --git a/build.gradle b/build.gradle index 978b56a..0c767ab 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,9 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' + + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -15,4 +18,94 @@ allprojects { repositories { jcenter() } +} + +subprojects { proj -> + + if (proj.name != "example") + { + proj.afterEvaluate { + + proj.apply plugin: 'com.github.dcendents.android-maven' + proj.apply plugin: 'com.jfrog.bintray' + + def gitUrl = "https://github.com/djavan-bertrand/JCVD" + + proj.install { + repositories.mavenInstaller { + // This generates POM.xml with proper parameters + pom { + project { + packaging 'aar' + + // Add your description here + name 'JCVD library: an Awareness API helper' + + // Set your license + licenses { + license { + name 'MIT' + url 'https://github.com/djavan-bertrand/JCVD/LICENSE' + } + } + developers { + developer { + id 'Sousoum' + name 'SousoumProd' + email 'sousoum.prod@gmail.com' + } + } + scm { + connection gitUrl + developerConnection gitUrl + + } + } + } + } + } + + proj.bintray { + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + user = properties.getProperty('bintray.user') + key = properties.getProperty('bintray.apikey') + pkg { + repo = 'maven' + name = "com.sousoum:jcvd" + + licenses = ['MIT'] + vcsUrl = gitUrl + version { + name = rootProject.version + desc = 'JCVD library: an Awareness API helper' + vcsTag = rootProject.releaseTag + } + } + configurations = ['archives'] + } + + task generateSourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier 'sources' + } + + task generateJavadocs(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath() + .join(File.pathSeparator)) + failOnError false + } + + task generateJavadocsJar(type: Jar, dependsOn: generateJavadocs) { + from generateJavadocs.destinationDir + classifier 'javadoc' + } + + artifacts { + archives generateJavadocsJar + archives generateSourcesJar + } + } + } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 9b6ae2a..9a29586 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,7 @@ # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +# org.gradle.parallel=true +group=com.sousoum +version=0.0.1 +releaseTag=version_0_0_1 \ No newline at end of file