From f6f48e9b2dce75ad066592b72d4c4319b455ba3e Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 21 Aug 2018 23:58:17 -0400 Subject: [PATCH] This should do it --- api/build.gradle | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/api/build.gradle b/api/build.gradle index 7032fe084..becadce87 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -58,19 +58,13 @@ publishing { } } - println "maven deployment: ${System.getenv("MAVEN_DEPLOYMENT")}" - println "on branch ${project.ext.getCurrentBranchName()}" - - if (System.getenv("MAVEN_DEPLOYMENT") != null && project.ext.getCurrentBranchName() == "master") { - repositories { - maven { - name = 'myRepo' - if (project.version.toString().endsWith("-SNAPSHOT")) { - url = "file:///maven-repo/snapshots" - } else { - url = "file:///maven-repo/releases" - } - } + repositories { + maven { + name = 'myRepo' + def base = project.ext.getCurrentBranchName() == "master" ? File.createTempDir().toURI().toURL().toString() : 'file:///maven-repo' + def releasesRepoUrl = "$base/releases" + def snapshotsRepoUrl = "$base/snapshots" + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl } } -} +} \ No newline at end of file