# HG changeset patch # User smith@nwoca.org # Date 1539115709 -3600 # Node ID 70b500eef001c481c21bc39b491f37371299b02e # Parent 91e05187fd79d1c6e0a78719fc1db331b57dc7d8 fix hg dependency diff -r 91e05187fd79 -r 70b500eef001 init20.gradle --- a/init20.gradle Wed Jun 06 23:15:28 2018 +0100 +++ b/init20.gradle Tue Oct 09 21:08:29 2018 +0100 @@ -5,8 +5,8 @@ buildscript { repositories { + maven { url 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo' } maven { url 'http://repos.ssdt.nwoca.org/artifactory/gradle-plugins' } - maven { url 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo' } } dependencies { classpath 'postgresql:postgresql:9.1-901.jdbc4' @@ -795,20 +795,26 @@ } private findSnapshotVersion() { - def repositoryUrl = System.getenv('bamboo_planRepository_repositoryUrl') - if (repositoryUrl) { - println "hg pull $repositoryUrl".execute().text + + try { + def repositoryUrl = System.getenv('bamboo_planRepository_repositoryUrl') + if (repositoryUrl) { + println "hg pull $repositoryUrl".execute().text + } + def versions = "hg branches --closed".execute().text.split('\n').findAll { + it.startsWith( 'release') || it.startsWith( 'hotfix') + }.collect { + it.replaceAll('\\s+',' ').split(' ')[0].split('/')[1] - 'v' + }.collect { + new Version(*it.split('\\.')*.toInteger()) + }.sort { v1, v2 -> v2 <=> v1 } + + return versions ? versions.first().nextSnapshot() : new Version().nextSnapshot() + + } catch (e) { + return new Version().nextSnapshot() } - def versions = "hg branches --closed".execute().text.split('\n').findAll { - it.startsWith( 'release') || it.startsWith( 'hotfix') - }.collect { - it.replaceAll('\\s+',' ').split(' ')[0].split('/')[1] - 'v' - }.collect { - new Version(*it.split('\\.')*.toInteger()) - }.sort { v1, v2 -> v2 <=> v1 } - - return versions ? versions.first().nextSnapshot() : new Version().nextSnapshot() - + }