Skip to content

Commit

Permalink
Merge pull request #12 from nevissecurity/feature/NEVISACCESSAPP-5452-…
Browse files Browse the repository at this point in the history
…add-local-properties-retrieval-but-keep-previous-order

NEVISACCESSAPP-5452: Leave the newly added retrieval from local.prope…
  • Loading branch information
balazs-gerlei authored Jan 23, 2024
2 parents 8cbf9e2 + 00b644a commit 0eaefb7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ plugins {
}

ext.getConfig = { String name ->
File localPropertiesFile = project.file('local.properties')
if (localPropertiesFile?.exists()) {
Properties localProperties = new Properties()
localProperties.load(localPropertiesFile.newDataInputStream())
if (localProperties.containsKey(name)) {
return localProperties.getProperty(name)
}
}
def env = System.getenv(name)
if (env != null) {
return env
}

def prop = System.getProperty(name)
if (prop != null) {
return prop
}

if (project.hasProperty(name)) {
return project.getProperty(name)
}
Expand Down Expand Up @@ -53,4 +59,4 @@ allprojects {
}
}
}
}
}

0 comments on commit 0eaefb7

Please sign in to comment.