I'm not very good with Ant, but we're using it as a build tool. Right now, we can run "ant test" and it'll run through all the unit tests.
However, I'd love to be able to do something like ant test some_module
and have it accept some_module
as a parameter, and only test that.
I haven't been able to find how to pass command line args to Ant - any ideas?
One solution might be as follows. (I have a project that does this.)
Have a separate target similar to
test
with afileset
that restricts the test to one class only. Then pass the name of that class using-D
at the ant command line:In the build.xml (highly reduced):
You can also define a property with an optional default value that can be replaced via command line, e.g.
and run it as:
You could try this to access one target at a time. Add these lines to your build.xml file :
This allows you to enter the module you want to execute and execute that itself instead of running the whole build.xml
You might need to make a few more changes to your build.xml for this to work perfectly.