Fixed issue when custom build props are not available

This commit is contained in:
nathan 2018-08-27 23:11:23 +02:00
parent c5268b3ece
commit 346c37244f
1 changed files with 11 additions and 5 deletions

View File

@ -19,12 +19,18 @@ 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().toFile()
if (propsFile.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)}
}
else {
ext.sonatypeUsername = ""
ext.sonatypePassword = ""
}
// for plugin publishing and license sources
repositories {