ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurt Mahan <kma...@xmission.com>
Subject Re: including build files the xml way?
Date Mon, 09 Oct 2000 16:08:41 GMT
> Could you give a small example of what the included files look like? --
> are they just your average normal-type ant build-files?

Sure -- here's a simple example:

----------
rules.xml:
----------

<!-- ====================================================================== -->
<!-- "test" target                                                          -->
<!-- ====================================================================== -->

<target name="test" depends="main, compile">

    <echo message="include test target" />

</target>


---------
defs.xml:
---------

<!-- ====================================================================== -->
<!-- Defines                                                                -->
<!-- ====================================================================== -->

<property name="src.dir" value="foobar"/>


----------
build.xml:
----------

<?xml version="1.0"?>

<!-- ====================================================================== -->
<!-- DOCTYPE - declare entities for including files                         -->
<!-- ====================================================================== -->

<!DOCTYPE project [
    <!ENTITY Defs SYSTEM "file:./defs.xml">
    <!ENTITY Rules SYSTEM "file:./rules.xml">
]>

<!-- ====================================================================== -->
<!-- Ant Boiler Plate                                                       -->
<!-- ====================================================================== -->

<project name="Boiler" default="test" basedir=".">

<!-- ====================================================================== -->
<!-- include global defs                                                    -->
<!-- ====================================================================== -->

&Defs;

<!-- ====================================================================== -->
<!-- "main" target                                                          -->
<!-- ====================================================================== -->

<target name="main">

    <echo message="Main Target" />
    <echo message="Ant Home = ${ant.home}" />
    <echo message="Source Dir = ${src.dir}" />

</target>

<!-- ====================================================================== -->
<!-- "compile" Compile the main source code                                 -->
<!-- ====================================================================== -->

<target name="compile">
</target>

<!-- ====================================================================== -->
<!-- include the other entities                                             -->
<!-- ====================================================================== -->

&Rules;


</project>


Mime
View raw message