Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ant: accept path in addition to fileset option #3312
We just started using checkstyle in our Java 6 codebase with Ant. It seems that Ant is going through a mild revolution in terms of Resource Collections in its data types, which is a good thing.
I bring this up because the checkstyle ant task only takes a single file or a fileset as input. The problem is that I have my source files in several directories that are defined as a path, a sourcepath that is used with many tasks including javac, javadoc, etc. Unfortunately Ant doesn’t make it easy to convert from a path to a fileset(http://stackoverflow.com/a/1700641/1015848), and the ant-contrib task of pathtofileset doesn’t actually make a fileset of the files in the path, just of the paths themselves. If I do this and pass the new fileset to the checkstyle ant task it doesn’t find any java files.
When I discussed this on the ant mailing list, it was suggested that checkstyle support paths as well as filesets for specifying source files. http://mail-archives.apache.org/mod_mbox/ant-user/200903.mbox/%3c49CBFEA9.firstname.lastname@example.org%3e
I had a quick look at doing this in the checkstyle task. With the assumption that a provided path specifies a number of root directories that are expanded into source trees, doesn’t seem too difficult. To handle all resource types appears to be quite a bit more effort at first glance but still not complex.
Right now we have