From: Ben Soares Date: Wed, 30 Oct 2019 12:31:02 +0000 (+0000) Subject: JAL-3210 Fixed local.properties setting. Some tidying. X-Git-Tag: Release_2_11_4_0~45^2~18^2~88 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ce0d0a188dc7362f95bb966dc4634d58aee8eb28;p=jalview.git JAL-3210 Fixed local.properties setting. Some tidying. --- diff --git a/build.gradle b/build.gradle index 8378a28..b7f2162 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,23 @@ plugins { id 'com.install4j.gradle' version '7.0.9' } +// 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 = getProperty(key) != null + setProperty(key, val) + if (over) { + println("Overriding property '${key}' with local.properties value '${val}'") + } + } +} + repositories { jcenter() mavenCentral() @@ -33,15 +50,15 @@ dependencies { } mainClassName = launcherClass -def cloverInstrDir = file("$buildDir/$cloverSourcesInstrDir") -def classes = "$jalviewDir/$classesDir" +def cloverInstrDir = file("${buildDir}/${cloverSourcesInstrDir}") +def classes = "${jalviewDir}/${classesDir}" if (clover.equals("true")) { use_clover = true - classes = "$buildDir/$cloverClassesDir" + classes = "${buildDir}/${cloverClassesDir}" } else { use_clover = false - classes = "$jalviewDir/$classesDir" + classes = "${jalviewDir}/${classesDir}" } // configure classpath/args for j8/j11 compilation @@ -53,22 +70,6 @@ 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 @@ -1278,6 +1279,9 @@ task jalviewjsSetEclipseWorkspace { def propVal = null if (project.hasProperty(propKey)) { propVal = project.getProperty(propKey) + if (propVal.startsWith("~/")) { + propVal = System.getProperty("user.home") + propVal.substring(1) + } } def propsFileName = "${jalviewjsBuildDir}/${jalviewjs_eclipse_workspace_location_file}" def eclipseWsDir = propVal @@ -1324,7 +1328,7 @@ task jalviewjsEclipsePaths { def eclipseProduct def eclipseRoot = jalviewjs_eclipse_root - if (eclipseRoot.startsWith("~")) { + if (eclipseRoot.startsWith("~/")) { eclipseRoot = System.getProperty("user.home") + eclipseRoot.substring(1) } if (OperatingSystem.current().isMacOsX()) { @@ -1722,6 +1726,7 @@ task jalviewjsServer { } outputs.file(htmlFile) + outputs.upToDateWhen({false}) } task cleanJalviewjsAll { diff --git a/gradle.properties b/gradle.properties index 9539579..3cadc78 100644 --- a/gradle.properties +++ b/gradle.properties @@ -196,4 +196,4 @@ jalviewjs_j2s_stdout = j2s-transpile.out jalviewjs_j2s_to_console = true - +testp=gradle.properties