ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Allan <ste...@wrq.com>
Subject RE: Trying to delete files not under source control
Date Fri, 26 Apr 2002 22:29:20 GMT
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:holtdl@yahoo.com]
> Sent: Friday, April 26, 2002 2:32 PM
> To: Ant Users List
> Subject: RE: Trying to delete files not under source control
> 
> 
> --- Steve Allan <stevea@wrq.com> 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
> 
> =====
> (holtdl@yahoo.com)
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/
> 
> --
> 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