changeset 162:29c3af8dc031

add default global deploy.mode
author Dave Smith <smith@nwoca.org>
date Tue, 14 Jan 2014 01:03:52 +0000
parents 8dd6adab9388
children c5f09d617715
files init.gradle
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/init.gradle	Fri Jan 10 03:41:29 2014 +0000
+++ b/init.gradle	Tue Jan 14 01:03:52 2014 +0000
@@ -381,9 +381,16 @@
     def slurper = new ConfigSlurper(gradle.env)
 	slurper.setBinding(['gradle': gradle ])
 	
-    def environment = new ConfigObject()	
+    def environment = slurper.parse (
+	'''deploy.mode="production"
+	   environments {
+		test { deploy.mode="test" }
+		dev { deploy.mode="development"}
+	   }''')
+	if (developerPrivate['deploy.mode']) { environment.put('deploy.mode',developerPrivate['deploy.mode']) }
+	
     def environments = []
-    
+    gradle.ext.environment = environment
     file('.').eachFileMatch(~/^environment.*\.groovy$/) { envFile ->
         def envName = envFile.name - '.groovy'
         def privateFile = file("private" + envName - "environment" + ".groovy")
@@ -420,7 +427,6 @@
 	def deployMode = environment.deploy.mode ?: 'development'
 	environments.each { gradle.ext[it].put('ssdt.deployment.mode',deployMode) } 
     environments << 'environment'
-    gradle.ext.environment = environment
     gradle.ext.environments = environments
 
 }