aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2015-07-18 10:03:27 -0700
committerKenny Root <kenny@the-b.org>2015-07-18 10:03:27 -0700
commit85ce71ea98f56964b3ead2478dcba8d1d10901b6 (patch)
tree51ec075b9e88e4f5947d605a52859c88f67340fc
parent2e9742b29181feeba61bb032196fef633178b89f (diff)
downloadsshlib-85ce71ea98f56964b3ead2478dcba8d1d10901b6.tar.gz
sshlib-85ce71ea98f56964b3ead2478dcba8d1d10901b6.tar.bz2
sshlib-85ce71ea98f56964b3ead2478dcba8d1d10901b6.zip
Add auto-publishing via Travis
-rw-r--r--.travis.yml11
-rw-r--r--gradle.properties13
-rw-r--r--lib/build.gradle11
-rw-r--r--publish.gradle86
4 files changed, 120 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..02e38b9
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,11 @@
+language: java
+jdk:
+- oraclejdk8
+- oraclejdk7
+- openjdk7
+after_success:
+- "./gradlew bintrayUpload"
+env:
+ global:
+ - bintrayUser=kruton
+ - secure: 747rxAH8xAF0LRutqgrb/XlAT0Ju7PfN2lQ7wMjC8arIuDFCDUFgKMfq9qw/fk7KkC058cEXfo8Gmkt9IN//78hxnjMTjS4DRNJYHUm5vFmLIfir1eae9/vNOjJsG+bON9rgzA15smvxJyaGkDLFcLE9Iq7k+qtIdSr1FG6DXkabfAa2zpRs6KkjU10A1HdJ+SNVeXn3vVRULxtxvh0XGKsHrEZbmyVeLRFoaLY8ruJ8FFr2hykQfQ1+XGCLF53dApYpULKWQEkM1EABE7ikX2fM4Xrrn3AlHYGLkd9jnK7drPuR1Q0QqqQC7wwKHLwvXi1CQImRRRV0I9KmlNxsBTN4CxBgw1XfwmFPboofNtewto0DGWe2LqSDP5et3vS6XUX3iHElAiAzwRPMoAXlJVWlo0MsTgA8qUB6bhHgpfnI1M1pBfbgyF70M3lJundm6VYw8/LERhNrmtVPwuJNDugJdvGyMU5XWayKkQj/RPP1x8BEOmpXWLuMA4Vrgo2SSNUCSTm4AzS1kF5M5/hJiR4JkUMie+YKOxrbFAG1CE6uqCMw0Y4oGjVWh+dVR1XfQARrK4fcHF2JIdDj+hibFYGuKY5Uc5S8ShV62QbYRMoXXPfEmLFDY2dAE+Xem45LCLoTfYgUPTPW/rd6erwCfeGC4pOW7B4ndZ+N5WlS+QQ=
diff --git a/gradle.properties b/gradle.properties
index 1d3591c..dec6a2b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,3 +1,4 @@
+#Sat, 18 Jul 2015 09:36:26 -0700
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
@@ -15,4 +16,14 @@
# 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
+
+version=2.2.0-SNAPSHOT
+group=org.connectbot
+description=SSH library used in the ConnectBot app
+
+bintrayUser=dummyUser
+bintrayApiKey=dummyApiKey
+
+officialJdk=oraclejdk7
+gitHubUrl=https\://github.com/connectbot/sshlib
diff --git a/lib/build.gradle b/lib/build.gradle
index c9b32b0..ff1fe10 100644
--- a/lib/build.gradle
+++ b/lib/build.gradle
@@ -1,4 +1,15 @@
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
+ }
+}
+
apply plugin: 'java'
+apply plugin: 'com.jfrog.bintray'
+apply from: "${rootDir}/publish.gradle"
repositories {
maven {
diff --git a/publish.gradle b/publish.gradle
new file mode 100644
index 0000000..bd4682c
--- /dev/null
+++ b/publish.gradle
@@ -0,0 +1,86 @@
+apply plugin: 'maven'
+
+task sourcesJar(type: Jar, dependsOn: classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+}
+
+artifacts {
+ archives sourcesJar, javadocJar
+}
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+ }
+ }
+}
+
+install {
+ repositories.mavenInstaller {
+ pom {
+ project {
+ name project.name
+ description project.description
+ url gitHubUrl
+ licenses {
+ license {
+ name 'Apache License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ }
+ }
+ developers {
+ developer {
+ id 'kruton'
+ name 'Kenny Root'
+ email 'kenny@the-b.org'
+ }
+ }
+ scm {
+ connection "${gitHubUrl}.git"
+ developerConnection "${gitHubUrl}.git"
+ url gitHubUrl
+ }
+ }
+ }
+ }
+}
+
+//Load data from environment if present to support Travis
+['bintrayUser', 'bintrayApiKey'].each{
+ if (System.env[it])
+ project[it] = System.env[it]
+}
+
+//This is only needed if bintrayUpload is done as part of releasing
+task updateBintrayVersion << {
+ bintray.pkg.version.name = project.version
+}
+bintrayUpload.dependsOn updateBintrayVersion
+
+bintray {
+ user = bintrayUser
+ key = bintrayApiKey
+ publish = true
+ pkg {
+ repo = 'maven'
+ name = project.name
+
+ licenses = ['Apache-2.0']
+ configurations = ['archives']
+
+ websiteUrl = gitHubUrl
+ vcsUrl = "${gitHubUrl}.git"
+ }
+}
+
+bintrayUpload.onlyIf {
+ System.env.TRAVIS_JDK_VERSION == officialJdk &&
+ !(version ==~ /.*SNAPSHOT/)
+}