ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conelly, Luis (EM, DDEMESIS)" <Luis.Cone...@ge.com>
Subject build.xml
Date Fri, 14 Nov 2003 21:44:57 GMT
Hi all

	This is probably more a XML question than an Ant question; however somebody might know how
to do it:

	I have this huge build.xml file with 800+ script lines. This has become quite a bit annoying
to maintain. Then I'd like to modularize the script into several files, to make easier the
maintenance (properties in one file, build tasks in other, update tasks located in some other
file and so on)

	However, I am not pretty sure if I am allowed to "include" xml files into one master.xml
file. I have done as follows:

common-properties.xml file
-----------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <properties>
	<property environment="env"/>
    	<property name="src" location="src"/>
    	<property name="dest.home" location="../xxx_yyy"/>
    	<property name="build" location="${dest.home}/classes"/>
    	<property name="jsp.home" location="${dest.home}/jsp"/>
    	<property name="dist" location="${dest.home}/dist"/>
    	<property name="classpath" location="${env.CLASSPATH}"/>
    </properties>	


master.xml 
-----------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <project name="common-props" default="init">
        <include file="common-properties.xml"/> <!-- prior file-->
	<target name="init">
            <echo message="${env.CLASSPATH}"/>
        </target>
    </project>


	However, when I try to execute the 'init' target, I got following error:

C:\Projects\GNF\eDocs>ant -f master.xml init
Buildfile: master.xml

BUILD FAILED
file:C:/Projects/master.xml:3: Unexpected element "include"

	I have seen this kind of 'include' in some other build files, but I am not pretty sure if
this is the right way to do it.

	Any help / observation / indication will be appreciated

	Regards
	Luis

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


Mime
View raw message