--- 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]>