Diane,

This is great stuff!

Thanks.

PS - I see now that I needed to use vmlauncher=no to keep those quotes from
gettting stripped off of my sed command.

-- Steve
// WRQ has 21 years of experience providing integration software and
// services for host-intensive environments. To learn more about our
// Reflection and Verastream products, visit http://www.wrq.com/products/



> -----Original Message-----
> From: Diane Holt [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 2:32 PM
> To: Ant Users List
> Subject: RE: Trying to delete files not under source control
> 
> 
> --- Steve Allan <[EMAIL PROTECTED]> wrote:
> > I'm not able to go to 1.5 right now, but your example is still very
> > instructive.  And, since those dishes are taunting you, I'd 
> love to see
> > how it would done in javascript as well.
> 
> Contributing to my delinquency, huh? :)  Here you go:
> 
>   <target name="doit">
>     <exec executable="p4" outputproperty="p4files" vmlauncher="no">
>       <arg line='have | cut -d"-" -f2'/>
>     </exec>
>     <script language="javascript"> <![CDATA[
>       importClass(java.io.File);
>       importClass(java.util.StringTokenizer);
>       var filelist;
>       var fromStr = projname.getProperty("basedir");
>       var pathSep = projname.getProperty("path.separator");
>       var p4files = projname.getProperty("p4files");
>       var files = new StringTokenizer(p4files);
>       while (files.hasMoreTokens()) {
>         var f = files.nextToken();
>         /* Make sure we don't have separator stew */
>         var file = new File(f);
>         /* Now put it back into a string */
>         var path = new String(file);
>         var filename = 
> path.substring(fromStr.length()+pathSep.length());
>         if(filelist == null) {
>           filelist = filename;
>         } else {
>           filelist = filelist + filename;
>         }
>         if(files.hasMoreTokens()) {
>           filelist = filelist.concat(',');
>         }
>       }
>       projname.setProperty("shipFilesPerforce", filelist);
>       ]]>
>     </script>
>     <echo>shipFilesPerforce = ${shipFilesPerforce}</echo>
>   </target>
> 
> Diane
> 
> =====
> ([EMAIL PROTECTED])
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to