aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2016-02-19 19:49:17 -0800
committerKenny Root <kenny@the-b.org>2016-02-19 20:39:52 -0800
commit9ca54dfd3f2477d5da9d37b6de07791541af0899 (patch)
tree8949705e993b0b6a5ff588aa2b491f9db004e205
parentf72032191a038329a752de0ab194c224e7f3acba (diff)
downloadsshlib-9ca54dfd3f2477d5da9d37b6de07791541af0899.tar.gz
sshlib-9ca54dfd3f2477d5da9d37b6de07791541af0899.tar.bz2
sshlib-9ca54dfd3f2477d5da9d37b6de07791541af0899.zip
Add Artifactory publishing for snapshots
-rw-r--r--.travis.yml2
-rw-r--r--publish.gradle39
-rw-r--r--sshlib/build.gradle11
3 files changed, 40 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml
index 3981a62..e3caf10 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,7 +11,7 @@ before_cache:
- find $HOME/.gradle -name "*.lock" -exec rm {} \;
- rm -rf $HOME/.gradle/caches/[1-9]*
after_success:
-- "./gradlew bintrayUpload"
+- "./gradlew bintrayUpload artifactoryPublish"
env:
global:
- bintrayUser=kruton
diff --git a/publish.gradle b/publish.gradle
index d5c69e1..348265c 100644
--- a/publish.gradle
+++ b/publish.gradle
@@ -1,4 +1,5 @@
apply plugin: 'maven'
+apply plugin: 'maven-publish'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
@@ -11,7 +12,20 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
}
artifacts {
- archives sourcesJar, javadocJar
+ archives jar, sourcesJar, javadocJar
+}
+
+ext.isSnapshot = (VersionNumber.parse(rootProject.version).qualifier == "SNAPSHOT")
+ext.isOfficialSdk = (System.env.TRAVIS_JDK_VERSION == officialJdk)
+ext.isMainline = (System.env.TRAVIS_PULL_REQUEST == "false")
+
+publishing {
+ publications {
+ Sshlib(MavenPublication) {
+ from components.java
+ groupId 'org.connectbot'
+ }
+ }
}
uploadArchives {
@@ -81,7 +95,26 @@ bintray {
}
}
+//Bintray is for official releases
bintrayUpload.onlyIf {
- System.env.TRAVIS_JDK_VERSION == officialJdk &&
- !(version ==~ /.*SNAPSHOT/)
+ project.isOfficialSdk && !project.isSnapshot && project.isMainline
}
+
+artifactory {
+ contextUrl = 'http://oss.jfrog.org/artifactory'
+ publish {
+ repository {
+ repoKey = 'oss-snapshot-local'
+ username = bintrayUser
+ password = bintrayApiKey
+ }
+ defaults {
+ publications('Sshlib')
+ }
+ }
+}
+
+//Artifactory is for publishing snapshots
+artifactoryPublish.onlyIf {
+ project.isOfficialSdk && project.isSnapshot && project.isMainline
+} \ No newline at end of file
diff --git a/sshlib/build.gradle b/sshlib/build.gradle
index 5949330..1c36976 100644
--- a/sshlib/build.gradle
+++ b/sshlib/build.gradle
@@ -1,14 +1,9 @@
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
- }
+plugins {
+ id 'com.jfrog.artifactory' version '4.0.0'
+ id 'com.jfrog.bintray' version '1.1'
}
apply plugin: 'java'
-apply plugin: 'com.jfrog.bintray'
apply from: "${rootDir}/publish.gradle"
dependencies {