Ignore local.cfg by default. Provide an EXAMPLE. Make sure Maven assembly handles local.cfg. Make sure Ant build reads local.cfg

This commit is contained in:
Tim Donohue
2015-11-11 11:50:32 -06:00
parent ab8960ad3f
commit c75e5bc578
4 changed files with 26 additions and 22 deletions

6
.gitignore vendored
View File

@@ -24,8 +24,14 @@ nb-configuration.xml
META-INF/
## Ignore all *.properties file in root folder, EXCEPT build.properties (the default)
## KEPT FOR BACKWARDS COMPATIBILITY WITH 5.x (build.properties is now replaced with local.cfg)
/*.properties
!/build.properties
# Ignore a local.cfg file in root folder, if it exists
/local.cfg
# Also ignore it under dspace/config
/dspace/config/local.cfg
##Mac noise
.DS_Store

View File

@@ -42,6 +42,14 @@
<exclude>LICENSE_HEADER</exclude>
</excludes>
</fileSet>
<!-- If local.cfg is in the root folder, copy it to config folder -->
<fileSet>
<directory>..</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>local.cfg</include>
</includes>
</fileSet>
<!-- Copy necessary subdirectories to resulting directory -->
<!-- First, copy over our configurations -->
<fileSet>

View File

@@ -47,7 +47,6 @@ Common usage:
<!-- ============================================================= -->
<!-- Will be using various environment variables -->
<!-- ============================================================= -->
<property environment="env" />
@@ -62,30 +61,21 @@ Common usage:
</not>
</condition>
<!-- Default configuration to use. This may be overridden. -->
<property name="config" value="config/dspace.cfg" />
<!-- Default configurations to use. This may be overridden. -->
<!-- First, the default localized config file -->
<property name="config" value="config/local.cfg" />
<!-- Next, the default dspace.cfg -->
<property name="dspace-config" value="config/dspace.cfg" />
<!-- Give user a chance to override without editing this file
(and without typing -D each time s/he compiles it) -->
<property file="${user.home}/.dspace.properties" />
<!-- First, set the dspace.dir property so it can be
interpolated when loading the config file.
This crudely mimics the way ConfigurationManager interpolates properties.
Note that it ONLY works for directories that interpolate ${dspace.dir}
but that _should_ cover all cases used in this build configuration.
-->
<loadproperties srcFile="${config}">
<filterchain>
<linecontainsregexp>
<regexp pattern="^\s*dspace\.dir\s+" />
</linecontainsregexp>
</filterchain>
</loadproperties>
<!-- Load the configuration -->
<!-- Load the configurations -->
<!-- In Ant, properties are immutable, so the first one "wins". In this case,
we load the local.cfg FIRST, so that its settings are used by default. -->
<property file="${config}" />
<property file="${dspace-config}" />
<!-- Timestamp date used when creating backup directories -->
<tstamp>
@@ -338,7 +328,7 @@ Common usage:
<!--
Copy designated dspace.cfg
-->
<copy file="${config}" tofile="config-temp/dspace.cfg" preservelastmodified="true" />
<copy file="${dspace-config}" tofile="config-temp/dspace.cfg" preservelastmodified="true" />
<!--
If designated config isn't the one in config/dspace.cfg then lets put a copy of that next to it
@@ -351,7 +341,7 @@ Common usage:
</copy>
<!--
Prepare properly filtered files
Copy over all other config files (not including dspace.cfg)
-->
<copy todir="config-temp" preservelastmodified="true" overwrite="true" failonerror="false">
<fileset dir="config" excludes="dspace.cfg" />
@@ -771,7 +761,7 @@ Common usage:
<fileset dir="config" excludes="dspace.cfg" />
</copy>
<copy file="${config}" tofile="${dspace.dir}/config/dspace.cfg" preservelastmodified="true" />
<copy file="${dspace-config}" tofile="${dspace.dir}/config/dspace.cfg" preservelastmodified="true" />
<echo file='${dspace.dir}/config/ant.properties' message='ant.version = ${ant.version}'/>