From: <el...@us...> - 2011-02-04 00:24:29
|
Revision: 19341 http://jedit.svn.sourceforge.net/jedit/?rev=19341&view=rev Author: elberry Date: 2011-02-04 00:24:23 +0000 (Fri, 04 Feb 2011) Log Message: ----------- Updating copy_properties script to look for properties starting with je.ci. This will makes it not need to know which properties exactly to copy over. Modified Paths: -------------- build-support/trunk/ci/copy_properties.groovy Modified: build-support/trunk/ci/copy_properties.groovy =================================================================== --- build-support/trunk/ci/copy_properties.groovy 2011-02-03 22:58:18 UTC (rev 19340) +++ build-support/trunk/ci/copy_properties.groovy 2011-02-04 00:24:23 UTC (rev 19341) @@ -7,50 +7,36 @@ def env = System.env String workspace = props.get("user.dir") +String storeComment = "## THIS FILE IS GENERATED BASED ON SYSTEM PROPERTIES SUPPLIED TO HUDSON, AND IS USUALLY REPLACED ON EACH BUILD." println "Copying properties over to appropriate directories" -String xsl = props.get("docbook.xsl") -String catalog = props.get("docbook.catalog") -String xsltproc = props.get("xsltproc.executable") -String fopDir = props.get("fop.dir") -String launch4j = props.get("launch4j.dir") -String installDir = props.get("install.dir") -String pluginsDir = props.get("jedit.plugins.dir") -String jeditJarsDir = props.get("jedit.jars.dir") -String wineExecutable = props.get("wine.executable") -String winepathExecutable = props.get("winepath.executable") -String innoCompiler = props.get("innosetup.compiler.executable") -String innoViaWine = props.get("innosetup.via.wine") - -def jeditProps = """## THIS FILE IS GENERATED BASED ON SYSTEM PROPERTIES SUPPLIED TO HUDSON, AND IS USUALLY REPLACED ON EACH BUILD. -ci.workspace=${workspace} -docbook.xsl=${xsl} -docbook.catalog=${catalog} -xsltproc.executable=${xsltproc} -fop.dir=${fopDir} -launch4j.dir=${launch4j} -wine.executable=${wineExecutable} -winepath.executable=${winepathExecutable} -innosetup.compiler.executable=${innoCompiler} -innosetup.via.wine=${innoViaWine} -""" - -def pluginProps = """${jeditProps} -install.dir=${installDir} -jedit.plugins.dir=${pluginsDir} -jedit.jars.dir=${jeditJarsDir} -""" - -File jeditPropsFile = new File(workspace, "jedit/build.properties") +def coreProps = new Properties() +def pluginProps = new Properties() +props.each { key, value -> + if(key.startsWith("je.ci.")) { + println "jEdit CI prop found - ${key}: ${value}" + if(key.startsWith("je.ci.pl.")) { + def cleanKey = key - 'je.ci.pl.' + println " clean key: ${cleanKey}" + pluginProps.setProperty(cleanKey, value) + } else { + def cleanKey = key - 'je.ci.' + println " clean key: ${cleanKey}" + coreProps.setProperty(cleanKey, value) + } + } +} +File corePropsFile = new File(workspace, "jedit/build.properties") // make sure stuff exists. -jeditPropsFile.parentFile.exists() ?: jeditPropsFile.parentFile.mkdirs() ?: { - System.err.println("'${jeditPropsFile.parentFile}' did not exist, and could not be created. Exiting.") +corePropsFile.parentFile.exists() ?: corePropsFile.parentFile.mkdirs() ?: { + System.err.println("'${corePropsFile.parentFile}' did not exist, and could not be created. Exiting.") System.exit(1) }() -jeditPropsFile.exists() ?: jeditPropsFile.createNewFile() ?: { - System.err.println("'${jeditPropsFile}' did not exist, and could not be created. Exiting.") +corePropsFile.exists() ?: corePropsFile.createNewFile() ?: { + System.err.println("'${corePropsFile}' did not exist, and could not be created. Exiting.") System.exit(1) }() +coreProps.store(corePropsFile.newWriter(), storeComment) File pluginPropsFile = new File(workspace, "jedit/jars/build.properties") // make sure stuff exists. @@ -62,9 +48,6 @@ System.err.println("'${pluginPropsFile}' did not exist, and could not be created. Exiting.") System.exit(1) }() - -// Overwrite the existing props -jeditPropsFile.setText(jeditProps) -pluginPropsFile.setText(pluginProps) - +pluginProps.putAll(coreProps) +pluginProps.store(pluginPropsFile.newWriter(), storeComment) /* ::mode=groovy:noTabs=true:maxLineLen=120:wrap=soft:: */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |