buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesus M. Rodriguez" <jmro...@gmail.com>
Subject Re: Buildr + Checkstyle
Date Tue, 10 Apr 2012 03:54:50 GMT
We put our checkstyle task in a separate file: buildr/checkstyle.rb

http://bit.ly/HVG1G2

And it's a simple call in our buildfile

http://bit.ly/Hx7kcT

As you can see we just specified the directory directly.


Sincerely,
jesus rodriguez


On Mon, Apr 9, 2012 at 11:38 PM, Chris Adams <chris@edatasource.com> wrote:
> 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
>
>
>
>

Mime
View raw message