Is it possible for you to set your mailer
to "Text only" if posting to the list? It's much easier to answer to pure Text
mails...
Loops are not our friends :-) (if someone
wishes to get them included into ant-core...)
<script
language="_javascript_">
<![CDATA[
var ant = myProject.createTask("ant"); var echo = myProject.createTask("echo"); var fileset = myProject.createDataType("fileset"); fileset.setDir(new java.io.File(".")); fileset.setIncludes("*/**/build.xml"); var dirScanner = fileset.getDirectoryScanner(test); var files = dirScanner.getIncludedFiles(); for (i = 0; i < files.length; i++) { file = new java.io.File(files[i]); dir = file.getParent(); antfile = file.getName(); ant.setDir(new java.io.File(dir)); ant.setAntfile(antfile); ant.execute(); } ]]></script> Your number 2 could be
<script
language="_javascript_"> <![CDATA[
var ant = myProject.createTask("ant"); var echo = myProject.createTask("echo"); var fileset = myProject.createDataType("fileset"); fileset.setDir(new java.io.File(".")); fileset.setIncludes("*/**/build.xml"); var dirScanner = fileset.getDirectoryScanner(test); var files = dirScanner.getIncludedFiles();
if (files != null && files.length != 0)
myProject.setProperty('sub.build.exists',
'true');
]]></script> The last one can not be solved by
<script>, but should be possible using .bat-files. (At least on NT or
W2K). Complexity depends on your requirements. If one target and up to 8
variable properties are enough for you and it's not a problem if you end up with
properties containing "" (space) you can
1. remove everything between ":start" and
":doneArgs"
2. Change the command-line after
":runAnt" to
%_JAVACMD% -classpath
%LOCALCLASSPATH% -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %1
-Darg1=%2 -Darg2=%3 -Darg3=%4 -Darg4=%5 -Darg5=%6 -Darg6=%7 -Darg7=%8
-Darg8=%9
3) I modified Main to accept only one task at a time. All additional arguments are translated into user-properties. (This one is NOT backward compatible) Yeah, I was thinking of going that route, but I'm way better
at Java than at .bat or sh scripts. (Can this even be done on a windows
environment??). Anyway, I agree with your assessment on this last item,
but I strongly believe ant needs both a conditional, and a looping task. Has
this idea already been shot down?
|
- Re: New core functionality Larry Sanderson
- Re: New core functionality Nico Seessle
- Re: New core functionality Stefan Bodewig
