4 Jul 13:48
Re: [groovy-dev] ant.inport from groovy?
From: Russel Winder <russel.winder@...>
Subject: Re: [groovy-dev] ant.inport from groovy?
Newsgroups: gmane.comp.lang.groovy.devel
Date: 2008-07-04 11:48:25 GMT
Subject: Re: [groovy-dev] ant.inport from groovy?
Newsgroups: gmane.comp.lang.groovy.devel
Date: 2008-07-04 11:48:25 GMT
On Fri, 2008-07-04 at 12:35 +0100, Chris Miles wrote:
> Hi - I want to invoke a couple of Ant targets before running my gant
> stuff.
>
> I can include my common ant stuff with
> ant.'import' ( file : 'buildSWFcommon.xml' )
> but when I try
>
> target ('try13' : '' ) {
> depends ( 'init' )
> // stuff using pre-defined properties and targets
> ...
> }
> (init is defined in buildSWFcommon.xml) I get
> Target `init' does not exist in this project.
>
> Using -d to gant I find that gant is looking for init in build.xml -
> which is strange.
>
> Can I invoke the buildSWFcommon.xml target 'init' ?
ant.'import' currently loads the XML file into the Ant project but this
does not make the target names available to the Gant framework -- it
should perhaps but currently it does not. An as yet unpublished piece
of work I had in mind for Gant 1.5.0 was to much better integrate the
namespaces of the Ant project and the Gant framework.
Currently (Gant 1.2.0 and later if I remember correctly) there is a tool
AntFile which can be used to include an Ant XML file and which bridges
things so that the targets from the Ant file are Gant targets:
includeTool << gant.tools.AntFile
antFile.includeTargets ( 'ant/xml/file/path/as/string' )
You can use a list of strings as well to include multiple files. Of
course using File objects should be allowed as well but I don't think
they are. Seems like a good thing for a JIRA issue!
--
--
Russel.
====================================================
Dr Russel Winder Partner
Concertant LLP t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road, f: +44 8700 516 084
London SW11 1EN, UK. m: +44 7770 465 077
RSS Feed