Gradle: Fix getBuiltBy() to work when override.properties does not exist

This commit is contained in:
str4d
2019-04-21 22:31:45 +00:00
parent 7c71ff106b
commit fd311c7e1a

View File

@ -33,12 +33,15 @@ String getBuildExtra() {
} }
String getBuiltBy() { String getBuiltBy() {
def builtBy def builtBy = ""
file("override.properties").readLines().findAll({ line -> def overrideProps = file("override.properties")
line.contains("build.built-by") if (overrideProps.exists()) {
}).first().eachMatch('.*=(.*)', { overrideProps.readLines().findAll({ line ->
builtBy = it[1] line.contains("build.built-by")
}) }).first().eachMatch('.*=(.*)', {
builtBy = it[1]
})
}
builtBy builtBy
} }