Hi,
I am trying to integrate checkstyle with builder. Thus far, this is what I have
come up with:
task :checkstyle do
begin
ant('checkstyle') do |ant|
rm_rf 'reports/checkstyle_report.xml'
mkdir_p 'reports'
ant.taskdef :resource=>"checkstyletask.properties",
:classpath=>Buildr.artifacts(CHECKSTYLE).each(&:invoke).map(&:name).join(File::PATH_SEPARATOR)
ant.checkstyle :config=>"buildconf/checkstyle.xml" do
ant.formatter :type=>'plain'
ant.formatter :type=>'xml',
:toFile=>"reports/checkstyle_report.xml"
ant.property :key=>'javadoc.method.scope', :value=>'public'
ant.property :key=>'javadoc.type.scope', :value=>'package'
ant.property :key=>'javadoc.var.scope', :value=>'package'
ant.property :key=>'javadoc.lazy', :value=>'false'
ant.fileset :dir=>path_to(:src,:main,:java),
:includes=>'**/*.java'
end
end
end
end
However, the problem I'm having is that path_to(:src, :main, :java) is at the
top-level parent directory (where my buildfile is located)… How would I make
the ":dir" relative to the current sub-project that the user is within or if
they are building from the root, all the sub-projects?
Thanks for any help/info you can provide.
Chris Adams