ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Pettiss" <>
Subject RE: Some targets inside another buildfile
Date Tue, 11 Sep 2001 17:20:26 GMT
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
	<!ENTITY loadProperties SYSTEM
<project name="myproj" default="main" basedir="..">


  <path id="project.classpath">
		<path refid="sitewide.lib.classpath"/>



jason pettiss
AGEA Corporation

-----Original Message-----
From: Krzysztof Czarny []
Sent: Tuesday, September 11, 2001 3:33 AM
To: ant
Subject: Some targets inside another buildfile

Every project's buildfile that I wrote has some common
parts. E.g.:
<property name="build.classesdir"
<target name="compile">
  <mkdir dir="${build.classesdir}"/>
  <javac srcdir="${src}"
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}"/>

Is it possible?


Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger

View raw message