ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b <bho...@gmail.com>
Subject Re: Deriving something from <srcfile/> from within <apply>
Date Thu, 06 Apr 2006 16:13:51 GMT
Matt,
You did correctly understand the problem I am trying to solve.

I will look into the <for> that you mentioned.

However, my problem could be easily solved if I could access the value 
of the current <srcfile/> via a property.   That is, if whatever 
<srcfile/> resolves to during an iteration of <APPLY> could also be 
accessed by property ${srcfile}.

Same is true for <targetfile/>, but I personally have no use for that (yet).

Thanks..



Matt Benson wrote:
> So your utility requires, for the file "foo.in", e.g.:
> 
> utility foo.in blahfoo.in
> 
> but the target file is determined automatically?
> (<mapper> w/o <targetfile>)
> 
> In this case I might have to recommend antcontrib's
> <for>.  Even if we added the ability to duplicate
> <srcfile> and/or <targetfile>, "foo.in" would still be
> a separate argument from "blah".
> 
> -Matt
> 
> --- b <bholio@gmail.com> wrote:
> 
>> I'm trying to code up an <APPLY> in ANT.
>>
>> I need to run a utility which takes 2 parameters, 1)
>> a source file name 
>> (<srcfile/>), and 2) something derived from the
>> source file name (<arg 
>> value="...">).   The output of this program is a
>> file, whose name is 
>> derived from the source file name (<targetfile/>,
>> which is used for 
>> timestamp checking.
>>
>> My problem is deriving the 2nd parameter.  I can't
>> use a <mapper> 
>> because it is already in use to handle <srcfile/>
>> and <targetfile/>.
>>
>> Does <srcfile/> ever get put into a property that I
>> can access?  Then it 
>> would be simple.  I can add <arg
>> value="blahblahblah${srcfile}">
>>
>> Otherwise, I think I am stuck.   Although I could
>> alter the utility to 
>> accept 'blahblahblah' as a parameter and derive parm
>> 2 myself in the 
>> utility, I would rather not do that.  I'd just as
>> soon go back to Make.
>>
>> Also, ant apprently won't allow me to specify
>> <srcfile/> twice.
>>
>> loose Example of what I'm tyring...
>>
>>          <apply executable="utility"
>> relative="true">
>>              <srcfile/>
>>              <arg value="blah${srcfile}/>   
>> ****problem here****
>>              <fileset refid="sourceFiles"/>
>>              <mapper type="glob" from="*.in"
>> to="*.in.done"/>
>>          </apply>
>>
>> Any hints?
>> Thanks..
>>
>>
>>
>>
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> user-unsubscribe@ant.apache.org
>> For additional commands, e-mail:
>> user-help@ant.apache.org
>>
>>
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

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


Mime
View raw message