How can I define a dirset in Ant, which includes two directories: the project's base directory, and a subdirectory "test"?
It looks like you can't specifically include the root directory of the dirset, using either "/", ".", or "". For example, this includes "./test", but not ".":
<dirset dir="." id="myDirs">
<include name="." />
<include name="test" />
</dirset>
That is not obviously meaningful. Once the root is in, the test subdirectory is included with everything else. Maybe you need to tell us what is going to consume this dirset and what you expect it to do? Process 'test' twice?
Based on your comment, you need to add the root, and then add 'exclude' elements for everything in the root except test.
Or make two dirsets: one with the root excluding all the children, and another with just test.