comparison init20.gradle @ 245:df4f5bad8782

ensure property files exist in output task
author smith@nwoca.org
date Fri, 17 Feb 2017 16:15:26 +0000
parents 1c91b76fd9a3
children 9884456bea33
comparison
equal deleted inserted replaced
244:e5d348e8d80a 245:df4f5bad8782
8 maven { url 'http://repos.ssdt.nwoca.org/artifactory/gradle-plugins' } 8 maven { url 'http://repos.ssdt.nwoca.org/artifactory/gradle-plugins' }
9 maven { url 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo' } 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:4.3.0' 13 classpath 'com.netflix.nebula:gradle-dependency-lock-plugin:4.3.2'
14 } 14 }
15 } 15 }
16 16
17 final GradleVersion gradleCurrent = GradleVersion.current() 17 final GradleVersion gradleCurrent = GradleVersion.current()
18 final GradleVersion gradleV20 = GradleVersion.version('2.0') 18 final GradleVersion gradleV20 = GradleVersion.version('2.0')
212 ext.propertyFile = "${e.toLowerCase()}.properties" 212 ext.propertyFile = "${e.toLowerCase()}.properties"
213 ext.buildenv = project.file('build/buildenv.txt') 213 ext.buildenv = project.file('build/buildenv.txt')
214 inputs.files project.file("../environment${e}.groovy"), project.file("../private${e}.groovy"), project.file('../private.properties') 214 inputs.files project.file("../environment${e}.groovy"), project.file("../private${e}.groovy"), project.file('../private.properties')
215 outputs.files new File(outputDir,propertyFile), buildenv 215 outputs.files new File(outputDir,propertyFile), buildenv
216 outputs.upToDateWhen { 216 outputs.upToDateWhen {
217 gradle.env == project.previousBuildenv 217 gradle.env == project.previousBuildenv && outputs.getFiles().every { it.exists() }
218 } 218 }
219 doLast { 219 doLast {
220 t.mkdirs() 220 t.mkdirs()
221 buildenv.text = gradle.env 221 buildenv.text = gradle.env
222 def ps = gradle."environment${e}".toProperties() 222 def ps = gradle."environment${e}".toProperties()