comparison init20.gradle @ 257:70b500eef001

fix hg dependency
author smith@nwoca.org
date Tue, 09 Oct 2018 21:08:29 +0100
parents 91e05187fd79
children 98a734a5287e
comparison
equal deleted inserted replaced
256:91e05187fd79 257:70b500eef001
3 import groovy.transform.ToString 3 import groovy.transform.ToString
4 import groovy.transform.TupleConstructor 4 import groovy.transform.TupleConstructor
5 5
6 buildscript { 6 buildscript {
7 repositories { 7 repositories {
8 maven { url 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo' }
8 maven { url 'http://repos.ssdt.nwoca.org/artifactory/gradle-plugins' } 9 maven { url 'http://repos.ssdt.nwoca.org/artifactory/gradle-plugins' }
9 maven { url 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo' }
10 } 10 }
11 dependencies { 11 dependencies {
12 classpath 'postgresql:postgresql:9.1-901.jdbc4' 12 classpath 'postgresql:postgresql:9.1-901.jdbc4'
13 classpath 'com.netflix.nebula:gradle-dependency-lock-plugin:5.0.6' 13 classpath 'com.netflix.nebula:gradle-dependency-lock-plugin:5.0.6'
14 } 14 }
793 digest.update(s.bytes); 793 digest.update(s.bytes);
794 new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0') 794 new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
795 } 795 }
796 796
797 private findSnapshotVersion() { 797 private findSnapshotVersion() {
798 def repositoryUrl = System.getenv('bamboo_planRepository_repositoryUrl') 798
799 if (repositoryUrl) { 799 try {
800 println "hg pull $repositoryUrl".execute().text 800 def repositoryUrl = System.getenv('bamboo_planRepository_repositoryUrl')
801 } 801 if (repositoryUrl) {
802 def versions = "hg branches --closed".execute().text.split('\n').findAll { 802 println "hg pull $repositoryUrl".execute().text
803 it.startsWith( 'release') || it.startsWith( 'hotfix') 803 }
804 }.collect { 804 def versions = "hg branches --closed".execute().text.split('\n').findAll {
805 it.replaceAll('\\s+',' ').split(' ')[0].split('/')[1] - 'v' 805 it.startsWith( 'release') || it.startsWith( 'hotfix')
806 }.collect { 806 }.collect {
807 new Version(*it.split('\\.')*.toInteger()) 807 it.replaceAll('\\s+',' ').split(' ')[0].split('/')[1] - 'v'
808 }.sort { v1, v2 -> v2 <=> v1 } 808 }.collect {
809 809 new Version(*it.split('\\.')*.toInteger())
810 return versions ? versions.first().nextSnapshot() : new Version().nextSnapshot() 810 }.sort { v1, v2 -> v2 <=> v1 }
811 811
812 return versions ? versions.first().nextSnapshot() : new Version().nextSnapshot()
813
814 } catch (e) {
815 return new Version().nextSnapshot()
816 }
817
812 } 818 }
813 819
814 820
815 def determineName() { 821 def determineName() {
816 try { 822 try {