[EMAIL PROTECTED] wrote:
>
> I'd like to be able to include/import other ant build files into my build.xml
>
> For example I am thinking of defining generar properties in a general.xml
> and the project specific things in the build.xml file as usual. in build.xml
> I'd like to somehow include/import general.xml.
>
> Maybe it should be XML's job to handle things like this but I am not aware
> that
> there is any support for this from XML. XSL for example allows this using it's
> own xsl:import xsl:include tags.
>
> One could even go further and include just a part of it by specifiying an
> XPATH.
> Implementation should be rather easy when using the xpathapi class coming with
> xalan.
>
> any comments ?
>
> - Sven
I like your suggestion, I have thougth about the same thing.
Right now I solve my similar problems by having a common
file with properties that I include in several places
something like
<property file="${properties.common}" />
Then I also have an antfile with common targets that I call
with something like
<target name="newenvfiles" depends="">
<ant antfile="${buildfiles.dir}/build-common-targets.xml"
target="newenvfiles" />
</target>
This is NOT an elegant solution.
If the features you propose were available I think it would
be possible to write ant-code that is easier to understand
and maintain.
If anyone has something to propose that is better than my
current solution I am very interested in hearing from you!
/Regards,
Peter