[Android] Task for extension api upload on bintray

David Papazian git at videolan.org
Mon Aug 7 17:55:05 CEST 2017


vlc-android | branch: master | David Papazian <david.papazian at metz.supelec.fr> | Mon Aug  7 15:30:21 2017 +0200| [5f19796dfecaf62d4297d49de350aec78cc05157] | committer: Geoffrey Métais

Task for extension api upload on bintray

Signed-off-by: Geoffrey Métais <geoffrey.metais at gmail.com>

> https://code.videolan.org/videolan/vlc-android/commit/5f19796dfecaf62d4297d49de350aec78cc05157
---

 api/build.gradle | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 build.gradle     |  2 ++
 2 files changed, 101 insertions(+)

diff --git a/api/build.gradle b/api/build.gradle
index d99459d81..9f6455480 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -22,6 +22,8 @@
  */
 
 apply plugin: 'com.android.library'
+apply plugin: 'com.github.dcendents.android-maven'
+apply plugin: 'com.jfrog.bintray'
 
 android {
     compileSdkVersion rootProject.ext.compileSdkVersion
@@ -44,8 +46,105 @@ task generateSources (type: Jar) {
     from android.sourceSets.main.java.srcDirs
 }
 
+task javadoc(type: Javadoc) {
+    source = android.sourceSets.main.java.srcDirs
+    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+    classifier = 'javadoc'
+    from javadoc.destinationDir
+}
+
 dependencies {
     compile fileTree(dir: 'libs', include: ['*.jar'])
     compile "com.android.support:appcompat-v7:$rootProject.ext.appCompatVersion"
     testCompile 'junit:junit:4.12'
 }
+
+def properties = new Properties()
+properties.load( new FileInputStream("local.properties"))
+group = properties.getProperty("package.groupId")
+version = properties.getProperty("version.name")
+
+install {
+    repositories.mavenInstaller {
+        pom {
+            project {
+                packaging 'aar'
+                groupId properties.getProperty("package.groupId")
+                artifactId properties.getProperty("package.name")
+
+                name properties.getProperty("package.name")
+                description properties.getProperty("package.description")
+                url properties.getProperty("package.url")
+
+                licenses {
+                    license {
+                        name properties.getProperty("license.name")
+                        url properties.getProperty("license.url")
+                    }
+                }
+                developers {
+                    developer {
+                        id properties.getProperty("developer.id")
+                        name properties.getProperty("developer.name")
+                        email properties.getProperty("developer.email")
+                    }
+                }
+                scm {
+                    connection properties.getProperty("vcs.connection")
+                    developerConnection properties.getProperty("vcs.connection")
+                    url properties.getProperty("vcs.url")
+                }
+            }
+        }
+    }
+}
+
+artifacts {
+    archives javadocJar
+    archives generateSources
+}
+
+bintray {
+    user = properties.getProperty("bintray.user")
+    key = properties.getProperty("bintray.apikey")
+
+    configurations = ['archives']
+
+    pkg {
+        repo = properties.getProperty("package.repository")
+        name = properties.getProperty("package.name")
+        //userOrg = properties.getProperty("package.groupId")
+        desc = properties.getProperty("package.description")
+        websiteUrl = properties.getProperty("package.url")
+        vcsUrl = properties.getProperty("vcs.url")
+        licenses = [properties.getProperty("package.licenses")]
+        publish = true
+        publicDownloadNumbers = true
+        version {
+            name = properties.getProperty("version.name")
+            desc = properties.getProperty("version.description")
+            released = new Date()
+            vcsTag = properties.getProperty("vcs.tag")
+            //gpg {
+            //    sign = true
+            //    passphrase = properties.getProperty("bintray.gpg.password")
+            //}
+            //mavenCentralSync {
+            //    sync = true
+            //    user = properties.getProperty("bintray.user") //OSS user token: mandatory
+            //    password = properties.getProperty("bintray.password") //OSS user password: mandatory
+            //    close = '1'
+            //}
+        }
+    }
+}
+
+// launch uploadApi to upload extension api on bintray based on values in local.properties
+task uploadApi {
+    dependsOn 'install'
+    dependsOn 'bintrayUpload'
+    tasks.findByName('bintrayUpload').mustRunAfter 'install'
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 084b6ad57..f8249a7a8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,6 +6,8 @@ buildscript {
     }
     dependencies {
         classpath 'com.android.tools.build:gradle:2.3.3'
+        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
+        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
     }
 }
 



More information about the Android mailing list