ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Sills" <>
Subject Question about the Include task
Date Mon, 11 Oct 2010 16:30:51 GMT
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
file after reading a local properties file:


  <property name="build.dir" value="build"/>

  <property file="${build.dir}/"/>

  <include file="${}/common-build.xml" as="common"/>


The defines the "" property:


I would assume that in the common-build.xml I could use:


  <property file="${build.dir}/"/>

  <property file="${}/"/>


However, it doesn't read those properties. In the, I set a property:




and in the common-build.xml I use that property:


  <target name="resolve" depends="init">

    <ivy:configure file="${ivy.settings.dir}/ivysettings.xml"/>

    <ivy:resolve file="${ivy.dep.file}" conf="runtime"/>



The error tells me:


C:\Projects\dsi java common\build\common-build.xml:33: settings file
does not exist: C:\Projects\dsi java


So it's not reading and setting the "ivy.settings.dir" property. Which I
assume means it's not reading my properties file (especially as even if
I change "ivy.settings.dir=." I get the same error).


I tried passing a propertyset with "" as a nested
resource in the include, but then I get an error message telling me that
PropertyResource is not supported in the plugin (I assume the Eclipse
plugin, as I'm using Ant 1.8.1, which should have propertysets, but who
knows? as the error message appears nowhere on the web I can find).


I'm so used to the antcall "inheritall" and "inheritrefs" that perhaps I
am wrong to think that this sort of inheritance should even work.


I would have thought that include would act just like you expect - as
though the contents of the included file were written in the original
build file; perhaps with some special details about overriding targets.
What I wouldn't have expected was such a fuss over properties.


Any and all ideas muchly appreciated.


David Sills


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message