return o == null ? "" : o.toString()
}
-def overrideProperties(def propsFileName) {
+def overrideProperties(String propsFileName, boolean output = false) {
if (propsFileName == null) {
return
}
def propsFile = file(propsFileName)
if (propsFile != null && propsFile.exists()) {
+ println("Using properties from file '${propsFileName}'")
try {
def p = new Properties()
def localPropsFIS = new FileInputStream(propsFile)
if (project.hasProperty(key)) {
oldval = project.findProperty(key)
project.setProperty(key, val)
- println("Overriding property '${key}' ('${oldval}') with ${file(propsFile).getName()} value '${val}'")
+ if (output) {
+ println("Overriding property '${key}' ('${oldval}') with ${file(propsFile).getName()} value '${val}'")
+ }
} else {
ext.setProperty(key, val)
- println("Setting ext property '${key}' with ${file(propsFile).getName()}s value '${val}'")
+ if (output) {
+ println("Setting ext property '${key}' with ${file(propsFile).getName()}s value '${val}'")
+ }
}
- //true
}
} catch (Exception e) {
println("Exception reading local.properties")
// Import channel_properties
channelDir = string("${jalviewDir}/${channel_properties_dir}/${propertiesChannelName}")
channelGradleProperties = string("${channelDir}/channel_gradle.properties")
- overrideProperties(channelGradleProperties)
+ overrideProperties(channelGradleProperties, false)
// local build environment properties
// can be "projectDir/local.properties"
- overrideProperties("${projectDir}/local.properties")
+ overrideProperties("${projectDir}/local.properties", true)
// or "../projectDir_local.properties"
- overrideProperties(projectDir.getParent() + "/" + projectDir.getName() + "_local.properties")
+ overrideProperties(projectDir.getParent() + "/" + projectDir.getName() + "_local.properties", true)
////
// Import releaseProps from the RELEASE file