From 68b48e4953882c9caf325afea6083a0c7670b59b Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 28 Jan 2020 21:16:55 +0200 Subject: [PATCH 1/2] Don't setup uploadArchives tasks if there's no username Without this, gradle assemble would fail, which means travis would fail. --- build.gradle | 91 +++++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/build.gradle b/build.gradle index d16bc0a..abef3ea 100644 --- a/build.gradle +++ b/build.gradle @@ -47,50 +47,53 @@ artifacts { archives javadocJar, sourcesJar } -signing { - useGpgCmd() - sign configurations.archives -} +if (project.hasProperty("ossrhUsername")) { + signing { + useGpgCmd() + sign configurations.archives + } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - pom.project { - name "EteSync JVM" - packaging "jar" - description "EteSync API client for the JVM" - url "https://www.etesync.com" - - scm { - connection "scm:git:git://github.com/etesync/etesync-jvm.git" - developerConnection "scm:git:ssh://github.com/etesync/etesync-jvm" - url "https://github.com/etesync/etesync-jvm" - } - - licenses { - license { - name "LGPL-3.0-only" - url "https://spdx.org/licenses/LGPL-3.0-only.html" - } - } - - developers { - developer { - id "tasn" - name "Tom Hacohen" - email "maven@stosb.com" - } - } - } + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + pom.project { + name "EteSync JVM" + packaging "jar" + description "EteSync API client for the JVM" + url "https://www.etesync.com" + + scm { + connection "scm:git:git://github.com/etesync/etesync-jvm.git" + developerConnection "scm:git:ssh://github.com/etesync/etesync-jvm" + url "https://github.com/etesync/etesync-jvm" + } + + licenses { + license { + name "LGPL-3.0-only" + url "https://spdx.org/licenses/LGPL-3.0-only.html" + } + } + + developers { + developer { + id "tasn" + name "Tom Hacohen" + email "maven@stosb.com" + } + } + } + } + } } - } } From 9ab6acd9b174c6adedad14d3e7bfeebf2129f7fd Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 28 Jan 2020 21:00:52 +0200 Subject: [PATCH 2/2] Add travis configuration. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dff5f3a --- /dev/null +++ b/.travis.yml @@ -0,0 +1 @@ +language: java