ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Rosengren <eric.roseng...@rtswireless.com>
Subject RE: Build.xml and reuse
Date Fri, 06 Apr 2001 19:53:37 GMT
Is there a way to use an environment variable for the URI in the !ENTITY?
I'm using multiple build.xml files in various sub-directories. 
It would be easier to add new packages to the project without having to
worry
if the relative pathing was correct. 
I tried the obvious (and naive) $MYFILE, but no luck.
Is there a way in XML to tell the parser to substitute an environment
variable?

Thanks,
Eric


Mark Hewitt <MHewitt@Armature.com> wrote:

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


Eric Rosengren
Aether Systems (RTS Wireless)
eric.rosengren@rtswireless.com
516-918-4664

Mime
View raw message