Yep. You can statically include other xml snippets using the XML semantics
for doing so. The only bad part of this is that the snippets themselves are
not well-formed XML documents. The &loadProperties; below is where the
snippet gets 'pasted'.
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "../../../sitewide/build/project.dtd" [
<!ENTITY sitewideTargets SYSTEM
"../../../sitewide/build/sitewideTargets.xml">
<!ENTITY loadProperties SYSTEM
"../../../sitewide/build/loadProperties.xml">
]>
<project name="myproj" default="main" basedir="..">
&loadProperties;
<path id="project.classpath">
<path refid="sitewide.lib.classpath"/>
</path>
&sitewideTargets;
...
jason pettiss
AGEA Corporation
http://www.agea.com
-----Original Message-----
From: Krzysztof Czarny [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 11, 2001 3:33 AM
To: ant
Subject: Some targets inside another buildfile
Hi!
Every project's buildfile that I wrote has some common
parts. E.g.:
<property name="build.classesdir"
value="${build}/classes"/>
<target name="compile">
<mkdir dir="${build.classesdir}"/>
<javac srcdir="${src}"
destdir="${build.classesdir}"/>
</target>
I'd like to move them into another common buildfile
and then 'include' this new buildfile into the main
project buildfile and use them in a normal way:
<!-- main project buildfile -->
<property name="src" value="."/>
<property name="build" value="build"/>
<include file="common.xml"/> <!-- it uses defined
property -->
<target name="test" depends="compile">
<echo message="${build.classesdir}"/>
</target>
Is it possible?
Regards,
Krzysztof
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com