jalviewDirRelativePath = jalviewDir
// local build environment properties
- def localProps = "${jalviewDirAbsolutePath}/local.properties"
+ // can be "projectDir/local.properties"
+ def localProps = "${projectDir}/local.properties"
+ def propsFile = null;
if (file(localProps).exists()) {
+ propsFile = localProps
+ }
+ // or "../projectDir_local.properties"
+ def dirLocalProps = projectDir.getParent() + "/" + projectDir.getName() + "_local.properties"
+ if (file(dirLocalProps).exists()) {
+ propsFile = dirLocalProps
+ }
+ if (propsFile != null) {
try {
def p = new Properties()
- def localPropsFIS = new FileInputStream(localProps)
+ def localPropsFIS = new FileInputStream(propsFile)
p.load(localPropsFIS)
localPropsFIS.close()
p.each {
def oldval = findProperty(key)
setProperty(key, val)
if (oldval != null) {
- println("Overriding property '${key}' ('${oldval}') with local.properties value '${val}'")
+ println("Overriding property '${key}' ('${oldval}') with ${file(propsFile).getName()} value '${val}'")
} else {
- println("Setting unknown property '${key}' with local.properties value '${val}'")
+ println("Setting unknown property '${key}' with ${file(propsFile).getName()}s value '${val}'")
}
}
} catch (Exception e) {