summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilal Alsharifi <bilal.alsharifi@gmail.com>2019-03-12 10:42:13 -0400
committerBilal Alsharifi <bilal.alsharifi@gmail.com>2019-03-12 10:42:13 -0400
commit649af9bff641913c4f09c0717a6e11b2728da4c5 (patch)
tree6e7e0db860764db78113010ac0aaa5f913f607a0
parent85cf432c1add5fe1e74d20657fb2e7af2914df15 (diff)
downloadsdl_android-649af9bff641913c4f09c0717a6e11b2728da4c5.tar.gz
Add bintray to javaEE
-rw-r--r--javaEE/bintray.gradle96
-rw-r--r--javaEE/bintray.properties8
-rw-r--r--javaEE/build.gradle22
3 files changed, 123 insertions, 3 deletions
diff --git a/javaEE/bintray.gradle b/javaEE/bintray.gradle
new file mode 100644
index 000000000..abf86b8b6
--- /dev/null
+++ b/javaEE/bintray.gradle
@@ -0,0 +1,96 @@
+apply plugin: "com.jfrog.bintray"
+apply plugin: 'maven-publish'
+apply plugin: 'maven'
+
+def siteUrl = 'https://github.com/smartdevicelink/sdl_android' // Homepage URL of the library
+def gitUrl = 'https://github.com/smartdevicelink/sdl_android.git' // Git repository URL
+group = "com.smartdevicelink" // Maven Group ID for the artifact
+def libDescription = 'SmartDeviceLink mobile library'
+
+task sourcesJar(type: Jar, dependsOn: classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+}
+
+javadoc.failOnError = false
+task javadocJar(type: Jar, dependsOn: javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+}
+
+artifacts {
+ archives sourcesJar
+ archives javadocJar
+}
+
+bintray {
+ Properties props = new Properties()
+ props.load(new FileInputStream("$projectDir/bintray.properties"))
+
+ // Authorization
+ user = props.getProperty("bintray.user")
+ key = props.getProperty("bintray.key")
+ version = props.getProperty("bintray.version")
+ publications = ['mavenPublication']
+
+
+ pkg {
+ repo = props.getProperty("bintray.repo")
+ name = props.getProperty("bintray.artifact")
+ websiteUrl = siteUrl
+ vcsUrl = gitUrl
+ userOrg = props.getProperty("bintray.userorg")
+ licenses = ["BSD 3-Clause"]
+ publish = props.getProperty("bintray.publish") // Will upload to jCenter
+ version {
+ name = props.getProperty("bintray.version") // Change to release version
+ desc = libDescription
+ released = new Date() // Will be the current date & time
+ vcsTag = props.getProperty("bintray.vcs") // Should match git tag
+ }
+ }
+}
+
+def pomConfig = {
+ Properties props = new Properties()
+ props.load(new FileInputStream("$projectDir/bintray.properties"))
+
+ licenses {
+ license {
+ name 'BSD 3-Clause'
+ url 'https://opensource.org/licenses/BSD-3-Clause'
+ distribution "repo"
+ }
+ }
+
+ scm {
+ url siteUrl
+ }
+}
+
+publishing {
+ publications {
+ mavenPublication(MavenPublication) {
+ Properties props = new Properties()
+ props.load(new FileInputStream("$projectDir/bintray.properties"))
+
+ from components.java
+ artifact sourcesJar {
+ classifier "sources"
+ }
+ artifact javadocJar {
+ classifier "javadoc"
+ }
+ groupId props.getProperty("bintray.userorg")
+ artifactId props.getProperty("bintray.artifact")
+ version props.getProperty("bintray.vcs")
+ pom.withXml {
+ def root = asNode()
+ root.appendNode('description', libDescription)
+ root.appendNode('name', props.getProperty("bintray.artifact"))
+ root.appendNode('url', siteUrl)
+ root.children().last() + pomConfig
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/javaEE/bintray.properties b/javaEE/bintray.properties
new file mode 100644
index 000000000..760f99904
--- /dev/null
+++ b/javaEE/bintray.properties
@@ -0,0 +1,8 @@
+bintray.user=username
+bintray.key=apikey
+bintray.repo=sdl_android
+bintray.artifact=sdl_android
+bintray.userorg=smartdevicelink
+bintray.publish=true
+bintray.version=X.X.X
+bintray.vcs=X.X.X \ No newline at end of file
diff --git a/javaEE/build.gradle b/javaEE/build.gradle
index 7d8a433e7..7b8f6e668 100644
--- a/javaEE/build.gradle
+++ b/javaEE/build.gradle
@@ -1,12 +1,19 @@
-plugins {
- id 'java-library'
-}
+apply plugin: 'java-library'
group 'com.smartdevicelink'
version '4.7.2'
sourceCompatibility = 1.8
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
+ }
+}
+
repositories {
google()
jcenter()
@@ -28,4 +35,13 @@ jar {
from {
configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
}
+}
+
+apply from: 'bintray.gradle'
+
+// Excluded :javaSE:bintrayUpload from running when we run bintrayUpload in javaEE
+def taskRequests = gradle.startParameter.taskRequests
+def runTaskRequest = taskRequests.find { it.args.contains('bintrayUpload') }
+if (runTaskRequest) {
+ gradle.startParameter.excludedTaskNames = [':javaSE:bintrayUpload']
} \ No newline at end of file