JAL-3210 Now add/override gradle.properties with local.properties
authorBen Soares <bsoares@dundee.ac.uk>
Tue, 29 Oct 2019 23:28:16 +0000 (23:28 +0000)
committerBen Soares <bsoares@dundee.ac.uk>
Tue, 29 Oct 2019 23:28:16 +0000 (23:28 +0000)
.gitignore
build.gradle

index c30231b..f313551 100644 (file)
@@ -19,6 +19,7 @@ TESTNG
 /site
 /.gradle
 /build
+/local.properties
 /utils/HelpLinksChecker.touch
 /getdown/website
 /getdown/full_app
index c9b1332..535efc8 100644 (file)
@@ -53,6 +53,22 @@ def compile_source_compatibility
 def compile_target_compatibility
 
 ext {
+  // local build environment properties
+  def localProps = "${jalviewDir}/local.properties"
+  if (file(localProps).exists()) {
+    def p = new Properties()
+    def localPropsFIS = new FileInputStream(localProps)
+    p.load(localPropsFIS)
+    localPropsFIS.close()
+    p.each {
+      key, val -> 
+      def over = project.properties.get(key) != null
+      project.properties.put(key, val)
+      if (over) {
+        println("Overriding property '${key}' with local.properties value")
+      }
+    }
+  }
   getdownWebsiteDir = "${jalviewDir}/${getdown_website_dir}/${JAVA_VERSION}"
   getdownDir = ""
   reportRsyncCmd = false