ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Lybarger" <Mark.Lybar...@CBC-Companies.com>
Subject RE: ant script task examples
Date Fri, 01 Oct 2004 15:15:15 GMT
i solved my problem with something like:

  <target name="sub">
    <echo id="theEcho"> processing: ${msg}</echo>
  </target>
  

  <target name="sub2">
    <script language="javascript"><![CDATA[

		antcall = acdv.createTask("antcall");
        antcall.setTarget("sub");
		var param = antcall.createParam();
		param.setName("msg");
		param.setValue("test");
		antcall.perform()
        
    ]]></script>
  </target>

i found a good article on:
http://www.javaranch.com/newsletter/200312/ScriptingAnt.html


> -----Original Message-----
> From: Mark Lybarger 
> Sent: Friday, October 01, 2004 10:34 AM
> To: Ant Users List
> Subject: RE: ant script task examples
> 
> 
> Thanks for all the help thus far.  One small issue left.
> 
> > -----Original Message-----
> > From: Velagapudi, Murali [mailto:murali.velagapudi@citigroup.com]
> > Sent: Friday, October 01, 2004 9:57 AM
> > To: Ant Users List
> > Subject: RE: ant script task examples
> > 
> > 
> > 
> > Mark,
> > 
> >   Here is the some sample which is close to what you have 
> > asked ,have a look into this.hope will be use full to you
> >  <target name="listoffiles" > 
> >  <script language="javascript">
> >  <![CDATA[ 
> >  importClass(java.lang.System);
> >  importClass(java.io.BufferedReader);
> >  importClass(java.io.FileReader);
> >  br=BufferedReader(new FileReader("file/dirname"));
> >  while ((str = br.readLine()) != null ) {
> >  	if(str.endsWith(".java"))
> >  		{
> > 		 System.out.prinltn("in if condition");
> >         	 // you can call you task/logic in this part 
> > ,this is as good as your java program
> 
> 		How can i call out to an target passing in a 
> property of the filename here?
> 
> 
> >         	    
> >         	 }              
> >           } 
> >            
> >   ]]></script>
> >  </target>
> > 
> > thanks,
> > Murali
> > 
> > -----Original Message-----
> > From: Mark Lybarger [mailto:Mark.Lybarger@CBC-Companies.com]
> > Sent: Friday, October 01, 2004 9:50 AM
> > To: Ant Users List (E-mail)
> > Subject: ant script task examples
> > 
> > 
> > does anyone know where some examples of using the ant script 
> > task can be found?  i'm looking to use a simple script which 
> > iterates over each file in a directory and calls another ant 
> > task passing in the filename.
> > 
> > thanks!
> > ~mark
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > 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
> 
> 
> 


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


Mime
View raw message