ant properties.xml, , .
template.xml, ( ant):
<?xml version="1.0" encoding="UTF-8"?>
<project
name="workspace-properties"
>
<dirname
property="workspace-properties.basedir"
file="${ant.file.workspace-properties}"
/>
<property environment="env" />
<property
name="ant.home"
value="${env.ANT_HOME}"
/>
<property
name="env.COMPUTERNAME"
value="${env.HOSTNAME}"
/>
<property
name="user.properties.file"
location="${user.home}/.build.properties"
/>
<property file="build.properties" />
<property name="myexec1" location="/usr/bin/myexec1"/>
<property name="myexec2" location="/usr/bin/myexec2"/>
</project>
The important point here is to come up with as many useful default property values as possible, then you can never even create custom files build.properties.
Then you just have <import>this file in your build.xml project.
<project
name="my-project"
>
<dirname
property="my-project.basedir"
file="${ant.file.my-project}"
/>
<import file="${my-project.basedir}/relative/path/to/properties.xml"/>
<target name="using.myexec1">
<echo message="myexec1=${myexec1}"/>
</target>
</project>
If you want to create a special value for myexec1 in my-project, just drop the custom flat build.properties file in the same directory as the build.xml file.
The build.properties file may look like this:
myexec1=c:/custom/path/to/myexec1.exe
source
share