Mark

I'm trying to something similar (see below) but I get the following XML error:

C:\>ant -buildfile frameworkx-build.xml -projecthelp
Buildfile: frameworkx-build.xml

BUILD FAILED

C:\frameworkx-build.xml:3: The content beginning "<!" is not legal markup. Perhaps the "!" (&#21;) character should be a letter.

Total time: 0 seconds

Any idea what is the problem?

Thanks

Mick

=========================================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [
    <!ENTITY fwTargets SYSTEM "framework-build.xml">
]>
<project name="frameworkx" default="main" basedir=".">
    <!-- Give user a chance to override without editing this file
       (and without typing -D each time it compiles it) -->
    <property name="name" value="frameworkx"/>
    &fwTargets;
</project>



-----Original Message-----
From: Mark Hewitt [mailto:MHewitt@Armature.com]
Sent: 04 April 2001 16:36
To: 'ant-user@jakarta.apache.org'
Subject: RE: Build.xml and reuse


I have per-project and shared xml files to achieve this.

The project build.xml has pieces like this:

...

<!-- Include standard entities
-->

<!DOCTYPE project [
    <!ENTITY commonProperties SYSTEM "../admin/common.xml">
    <!ENTITY projectProperties SYSTEM "project.xml">
    <!ENTITY commonTargets SYSTEM "../admin/targets.xml">
]>


<!-- Start of project build description
-->

<project name="XXX" default="compile" basedir=".">

...


<!-- ======================================================================
-->
<!-- Import all the common build targets
-->
<!-- ======================================================================
-->

    &commonTargets;


<!-- ======================================================================
-->
<!-- inclusion : Import all the common and project-specific properties
-->
<!-- ======================================================================
-->
    <target name="inclusion">
        &commonProperties;
        &projectProperties;
    </target>


Which all works nicely for me!

#!/mjh

-----Original Message-----
From: Danil Suits [mailto:DSuits@kana.com]
Sent: 28 March 2001 20:30
To: 'ant-user@jakarta.apache.org'
Subject: Build.xml and reuse



Has anyone experimented with reusing the targets within the build.xml file?

I frequently find myself wanting to work on only a subsystem of the project.
I could add a new target to the build.xml file - but that publishes my local
work to every developers machine, which isn't appropriate in this case.

What I'm currently considering is moving the contents of the project to a
new file (common.xml), replacing them in build.xml with an XML include, then
creating mybuild.xml which includes common.xml, plus whatever other changes
I need.  build.xml remains under source control, as does common.xml, but
mybuild.xml is not under control.

I'm sure this will work, and I'm also sure that it is kind of clumsy - has
anybody discovered a better way to achieve target reuse?

Thanks,
Danil