Fixed issue when custom properties is not available

This commit is contained in:
nathan 2018-08-27 23:33:09 +02:00
parent dda027cf5b
commit 0a67aa34e5
1 changed files with 6 additions and 6 deletions

View File

@ -18,13 +18,13 @@ import java.time.Instant
buildscript {
// load properties from custom location
def propsFile = Paths.get("${projectDir}/../../gradle.properties").toAbsolutePath().normalize().toFile()
println("Loading custom property data from: ${propsFile}")
def propsFile = Paths.get("${projectDir}/../../gradle.properties").normalize()
if (propsFile.toFile().canRead()) {
println("Loading custom property data from: ${propsFile}")
def props = new Properties()
propsFile.withInputStream { props.load(it) }
props.each { key, val ->
project.ext.set(key, val)
def props = new Properties()
propsFile.withInputStream {props.load(it)}
props.each {key, val -> project.ext.set(key, val)}
}
repositories {