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() {
def builtBy
file("override.properties").readLines().findAll({ line ->
def builtBy = ""
def overrideProps = file("override.properties")
if (overrideProps.exists()) {
overrideProps.readLines().findAll({ line ->
line.contains("build.built-by")
}).first().eachMatch('.*=(.*)', {
builtBy = it[1]
})
}
builtBy
}