Mercurial > public > develkit
comparison init.gradle @ 104:13a1e737ca31
USASR-800: Fix command line env setting
author | smith@nwoca.org |
---|---|
date | Sat, 31 Mar 2012 19:03:26 +0100 |
parents | 3267840f534f |
children | f7b0f9d286b8 |
comparison
equal
deleted
inserted
replaced
103:3267840f534f | 104:13a1e737ca31 |
---|---|
46 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener { | 46 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener { |
47 | 47 |
48 def void projectsEvaluated(Gradle gradle) { | 48 def void projectsEvaluated(Gradle gradle) { |
49 def ssdtArtifactory = 'http://repos.ssdt.nwoca.org/artifactory' | 49 def ssdtArtifactory = 'http://repos.ssdt.nwoca.org/artifactory' |
50 Project root = gradle.getRootProject() | 50 Project root = gradle.getRootProject() |
51 root.allprojects { | 51 root.allprojects { |
52 def thisProject = delegate | 52 def thisProject = delegate |
53 configurations.all { | 53 configurations.all { |
54 resolutionStrategy.cacheChangingModulesFor 120, 'minutes' | 54 resolutionStrategy.cacheChangingModulesFor 120, 'minutes' |
55 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes' | 55 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes' |
56 } | 56 } |
118 def loadEnvironments() { | 118 def loadEnvironments() { |
119 def developerPrivate = new Properties() | 119 def developerPrivate = new Properties() |
120 if (file('private.properties').exists()) { | 120 if (file('private.properties').exists()) { |
121 developerPrivate.load(file('private.properties').newReader()) | 121 developerPrivate.load(file('private.properties').newReader()) |
122 } | 122 } |
123 gradle.ext.env = (gradle.ext.has('env') ? gradle.env : (developerPrivate.env ?: 'dev')) | 123 gradle.ext.env = (hasProperty('env') ? getProperty('env') : (developerPrivate.env ?: 'dev')) |
124 println "Environment is: $gradle.env" | 124 println "Environment is: $gradle.env" |
125 def slurper = new ConfigSlurper(gradle.env) | 125 def slurper = new ConfigSlurper(gradle.env) |
126 def environment = new ConfigObject() | 126 def environment = new ConfigObject() |
127 def environments = [] | 127 def environments = [] |
128 file('.').eachFileMatch(~/^environment.*\.groovy$/) { envFile -> | 128 file('.').eachFileMatch(~/^environment.*\.groovy$/) { envFile -> |