3 ms·
Or maybe you want to loop through a set of files and perform a set of operations on them. If you did start putting clever code into Ant files, they'd get so hu
by srgseg 16y ago
Or maybe you want to loop through a set of files and perform a set of operations on them.
If you did start putting clever code into Ant files, they'd get so huge they'd be unmanageable. It's really really easy to just write your own Ant plugins in Java.
Then your build files are very straightforward and readable, and just look like a set of simple file operations and method calls.
Then Ant becomes really powerful - you can even write some plugins that take a web server out of service using telnet to Cisco LocalDirector, SCP a deployment build across and all sorts of other clever stuff.
Plugin example:
public class MyTask extends Task {
private String param1;
private String param2;
public void execute() throws BuildException {
// do something
}
}
Then in the XML:
<myTask param1="..." param2="..." />
- extension 16y agoIf you have to drop into raw Java to accomplish anything exceptional, it largely defeats the purpose of build scripting.