ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Ant <project> extension, templatized build files
Date Fri, 03 May 2002 15:12:03 GMT
Very interesting Peter! Thanks for sharing that with us. Quick question
though. Why is 'call-project-target' applying <style> to the sub-project
(before calling the sub-project's target) instead of simply having
'for-all-projects' depend on 'build-files'? And both 'for-all-projects' and
'call-project-target' appear to be _private_ targets, not to be called
directly from the command line, so shouldn't you rename them
'-for-all-projects' and '-call-project-target' to prevent it?

To Wannheden, Knut [Knut@paranor.ch], I would be very interested is seeing
your solution, if you can share that with us that is!

Here's a simplification of Myrmidon's main build.xml file I'm referring to
in the first paragraph.

<project name="Myrmidon" default="main">

    [...]

    <target name="build-files"
            description="Generates the project build files">
        <style in="buildtools/project.xml"
               out="buildtools/${buildfile.name}"
               style="${build.xsl}"
               processor="trax" />
        [same for all sub-projects]
    </target>

    <target name="jars" description="Builds the jars for all projects">
        <antcall target="for-all-projects">
            <param name="build-subproject.target" value="jars"/>
        </antcall>
    </target>
    [same for all public targets]

    <target name="for-all-projects">
        <antcall target="call-project-target">
            <param name="build-subproject.project" value="buildtools"/>
        </antcall>
        [same for all sub-projects]
    </target>

    <target name="call-project-target">
        <style in="${build-subproject.project}/project.xml"
               out="${build-subproject.project}/${buildfile.name}"
               style="${build.xsl}"
               processor="trax" />
        <ant dir="${build-subproject.project}"
             antfile="${buildfile.name}"
             target="${build-subproject.target}"/>
    </target>

</project>

-----Original Message-----
From: Peter Donald [mailto:peter@apache.org] 
Sent: Friday, May 03, 2002 6:25 AM
To: Ant Developers List
Subject: Re: Ant <project> extension, templatized build files

[...]

For an example of XSLT in action download the jakarta-ant-myrmidon 
CVS. The following are the files to look at

jakarta-ant-myrmidon/build.xml
jakarta-ant-myrmidon/tools/xsl/build.xsl
jakarta-ant-myrmidon/*/project.xml

The first file acts as the "driver" script and generates all required build 
scripts and then delegates to them. The second is the xsl sheet used to 
transform the project descriptors into real build files. The project 
descriptors just contain unique data for each project.

Anyways I like it as a user but Adam/Darrell wrote it so they may have some 
comments on how hard/easy it was to write.

Cheers,

Peter Donald

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message