ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Shea <m...@nitido.com>
Subject Re: Question about the Include task
Date Mon, 11 Oct 2010 18:04:45 GMT
If I understand your issue, you have a build.xml file in a common-build 
dir, and you want to load properties from files in the common-build 
directory, and also from the directory of the build that is referencing 
your common build?

I do this in my builds:

build.xml for a given project:
--------------------------
<project name="some-project">
<!-- Load local properties - this must define "common-build.dir"-->
<property file="${basedir}/local.properties"/>

<!-- Define location of common build.xml file -->
<property name="common-build.xml" value="${common-build.dir}/build.xml"/>

<!-- Import the common build file xml file-->
<import file="${common.build.xml}"/>
</project>


common-build.xml, shared by all projects:
--------------------------
<project name="common-build" .....>

<!-- Get directory storing the "common-build" build.xml file -->
<dirname property="common-build.basedir" file="${ant.file.common-build}" />

<!-- Load project-specific build.properties -->
<property file="${basedir}/build.properties"/>

<!-- Load common build.properties -->
<property file="${common-build.basedir}/build.properties />

<!-- Do lots of other stuff here.... -->

</project>

  Btw, although it's not perfect (and last time I tried I couldn't get 
it to work with ant 1.8), I find the Eclipse Ant debugger very useful, 
especially for debugging issues of unset properties.


Mike Shea.


On 10-10-11 12:30 PM, David Sills wrote:
> I'm having a real problem with the Include task (unfortunately, it's
> hard to search for useful information on this task, as "include" and
> "task" are really common on the archive lists). I'm trying to reuse
> variables that are set within each separate project in an included Ant
> build file outside the projects, but this does not seem to work at all.
>
>
>
> In other words, in my build file I start by including the common build
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message