Suggest ant add "AOP" task to enhance it.By "AOP" task,You could enhance old ant task but need't modify old ant task code! Such as,if you want to do some ant task many times,you have to write it many times. But now if you use "AOP" task,you could write it once <apply executable="ls"> <aoploop> <list var="command expr="issql,sqlplus"/> </aoploop> <arg value="${command}"/> </apply> This is a simple example,<aoploop> is a "AOP" task,I could run apply twice by it,one is run "issql" command ,another is "sqlplus" command,but I need't modify the code of "apply" task. I think this way is very useful in many place,if you interest it I could send source code to you!
You can attach source to this bugrep if you want, but from your example above I, so far, have no idea what you're talking about.
we dont yet use any "aspects" in ant, though there has been some thought in the past to use attributes in different namespaces, eg ant:failonerror="true" to control some parts of Ant's execution. for the particular problem you cite -iterative execution, I would use the Ant-contrib <for> and <foreach> commands, that explicitly do iteration
Thank you very much for your answer,I download Ant-contrib and read it just now.I think it's better than my "AOP" task But I think this is another way that ant could become more powerful with "AOP",as this way could extend the function of old ant task but need't modify it's code. Ant is a very useful tool for me,I wish I could do something for it,^_^ I modify IntrospectionHelper.java and UnknownElement.java to support it Such as: IntrospectionHelper.java private NestedCreator getNestedCreator(){ ... //by dcming if(nc == null){ nc = createAopTask(project,parentUri,parent,elementName,child); } .... } I paste source code,you could search "dcming",then could find modified
Created attachment 16384 [details] Source code for AOP task
Created attachment 16385 [details] Source code for AOP task
We are accustomed to (and much more appreciative of) code submissions made in the form of unified diffs so we can quickly see what modifications have been made.