ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: How to specify depends as a list of elements, rather than an attribute?
Date Fri, 03 May 2002 18:44:55 GMT
No, unfortunately, Ant does not currently support dependency lists except
with the depends="..." attribute.

    Erik

----- Original Message -----
From: "Scott Ellsworth" <scott@alodar.com>
To: "Ant List" <ant-user@jakarta.apache.org>
Sent: Friday, May 03, 2002 2:26 PM
Subject: How to specify depends as a list of elements, rather than an
attribute?


> Hi, all.
>
> Does ANT allow an element-based statement of target dependencies, rather
> than an attribute based one?  In other words, is there any way to say:
>
> <target name="build-thing">
>    <depends>
>    build-subthing1
>    </depends>
>    <depends>
>    build-subthing2
>    </depends>
>   -- other stuff
> </target>
>
> rather than
>
> <target name="build-thing" depends="build-subthing1, build-subthing2">
>   -- other stuff
> </target>
>
> Why do I want this?
>
> I generate my build.xml from a list in an xml file via xslt.  I have a
> project named "thing" that depends on other projects subthing1 and
> subthing2.  I want to produce a target with the name build-thing with
> depends="build-subthing1, build-subthing2"
>
> I currently have a projectlist.xml that specifies these as:
>
> <project name="thing">
>    <dependency type="project" name="subthing1"/>
>    <dependency type="project" name="subthing2"/>
> </project>
>
> By simply applying a style task to
>
>    <xsl:for-each select="project">
>      <target name="build-{@name}" depends="init">
>        -- other stuff
>      </target>
>    </xsl:for-each>
>
> gives me a build.xml with
>
> <target name="build-thing" depends="init">
>   -- other stuff
> </target>
>
> XSLT like:
>
>    <xsl:for-each select="project">
>      <target name="build-{@name}" depends="init">
>        <xsl:for-each select="depends">
>          <depends>
>            build-{@name}
>          </depends>
>        </xsl:for-each>
>        -- other stuff
>      </target>
>    </xsl:for-each>
>
> would give me
>
> <target name="build-thing">
>    <depends>
>    build-subthing1
>    </depends>
>    <depends>
>    build-subthing2
>    </depends>
>   -- other stuff
> </target>
>
> I cannot figure out how to make xslt give me
>
> <target name="build-thing" depends="build-subthing1, build-subthing2">
>   -- other stuff
> </target>
>
> I am constrained against using javascript, as they want this entirely
> done either in core ant or in xslt space.
>
> Scott
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message