Al Le
2017-05-29 10:04:52 UTC
Hello,
in my ant script I'd like to define a macro (via macrodef) which would call the 'java' task as a part of its body/implementation.
In the java task call in the macro, I want to just specify the main class name and the classpath. The parameters (which are usually specified via nested 'arg' elements) should be as variable as they are in the original java task.
How would I accomplish this?
What I've come up with until now is:
<macrodef name="execMyProgram">
<element name="programArgs" implicit="true" description="'arg' entries for the program, use like in the java task"/>
<sequential>
<java classname="my.class.name" classpathref="my.classpath">
<programArgs/>
</java>
</sequential>
</macrodef>
Then I use the macro as follows:
<execMyProgram>
<programArgs>
<arg value="arg1"/>
<arg value="arg2"/>
</programArgs>
</executeProcessMonitor>
But I get the error message: The <java> type doesn't support the nested "programArgs" element.
Thank you for the help!
AL
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@ant.apache.org
For additional commands, e-mail: user-***@ant.apache.org
in my ant script I'd like to define a macro (via macrodef) which would call the 'java' task as a part of its body/implementation.
In the java task call in the macro, I want to just specify the main class name and the classpath. The parameters (which are usually specified via nested 'arg' elements) should be as variable as they are in the original java task.
How would I accomplish this?
What I've come up with until now is:
<macrodef name="execMyProgram">
<element name="programArgs" implicit="true" description="'arg' entries for the program, use like in the java task"/>
<sequential>
<java classname="my.class.name" classpathref="my.classpath">
<programArgs/>
</java>
</sequential>
</macrodef>
Then I use the macro as follows:
<execMyProgram>
<programArgs>
<arg value="arg1"/>
<arg value="arg2"/>
</programArgs>
</executeProcessMonitor>
But I get the error message: The <java> type doesn't support the nested "programArgs" element.
Thank you for the help!
AL
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@ant.apache.org
For additional commands, e-mail: user-***@ant.apache.org