comparison init20.gradle @ 223:6cbe6a8597db

USASR-2244: Attempt to simplify changes to init script by placing hg pull in findSnapshotVersion method
author Christopher Springer <springer@nwoca.org>
date Thu, 07 Jul 2016 16:33:50 +0100
parents b3cb5db317a0
children f2495310ee69
comparison
equal deleted inserted replaced
222:b3cb5db317a0 223:6cbe6a8597db
46 logger.info "Bamboo plan: ${gradle.bambooPlan}" 46 logger.info "Bamboo plan: ${gradle.bambooPlan}"
47 47
48 gradle.ext.buildTimestamp = System.currentTimeMillis().toString().padLeft(14, '0') 48 gradle.ext.buildTimestamp = System.currentTimeMillis().toString().padLeft(14, '0')
49 49
50 gradle.ext.hgRepositoryUrl = "" 50 gradle.ext.hgRepositoryUrl = ""
51
51 try { 52 try {
52 gradle.ext.hgRepositoryUrl = ("hg path".execute().text.split('=') ?: ['', ''])[1].trim() 53 gradle.ext.hgRepositoryUrl = ("hg path".execute().text.split('=') ?: ['', ''])[1].trim()
53 } catch (e) { 54 } catch (e) {
54 }
55 try {
56 if (gradle.ext.bambooBuild) {
57 "hg pull".execute()
58 }
59 } catch (e) {
60 logger.error "exception thrown attempting to pull all changesets from mercurial", e
61 } 55 }
62 56
63 def springModuleTranslator = [ 57 def springModuleTranslator = [
64 'spring-transaction': 'spring-tx', 58 'spring-transaction': 'spring-tx',
65 'spring-web-servlet': 'spring-webmvc', 59 'spring-web-servlet': 'spring-webmvc',
802 digest.update(s.bytes); 796 digest.update(s.bytes);
803 new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0') 797 new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
804 } 798 }
805 799
806 private findSnapshotVersion() { 800 private findSnapshotVersion() {
801 "hg pull".execute()
807 def versions = "hg branches --closed".execute().text.split('\n').findAll { 802 def versions = "hg branches --closed".execute().text.split('\n').findAll {
808 it.startsWith( 'release') || it.startsWith( 'hotfix') 803 it.startsWith( 'release') || it.startsWith( 'hotfix')
809 }.collect { 804 }.collect {
810 it.replaceAll('\\s+',' ').split(' ')[0].split('/')[1] - 'v' 805 it.replaceAll('\\s+',' ').split(' ')[0].split('/')[1] - 'v'
811 }.collect { 806 }.collect {