buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Adams <ch...@edatasource.com>
Subject Re: Buildr + Addon
Date Tue, 10 Apr 2012 17:19:57 GMT
Thanks Peter,

So, I'm trying to do it slightly different, but what I've done is the following:

1. Downloaded the findbugs.rb add-on
2. Put the add-on into a subfolder within my project ('buildconf/modules/findbugs.rb')
3. Updated my buildfile.rb to include 'require 'buildconf/modules/findbugs'

However, when I execute 'builder findbugs:html' I get the error 'Don't know how to build task
'findbugs:html'.  I have also tried executing 'builder findbugs' same result.

Sorry for my ignorance in this matter.

- Chris


On Apr 9, 2012, at 10:52 PM, Peter Donald wrote:

> Hi,
> 
> In the next release of buildr (not sure when that is happening?)
> there will be checkstyle support baked in (as well as findbugs,
> jdepend, pmd etc). You can see the next set of addons in [1] and the
> checkstyle one in particular is [2]. You can rename [2] to end with
> .rake and drop it in a tasks directory and start using it straight
> away. In one of our projects we have something like
> 
> 
> project ... do
> 
>  checkstyle.config_directory = _('planner/etc/checkstyle')
>  checkstyle.source_paths << project('planner:shared')._(:source, :main, :java)
>  checkstyle.source_paths << project('planner:client')._(:source, :main, :java)
>  checkstyle.source_paths << project('planner:client')._(:test, :main, :java)
>  checkstyle.source_paths << project('planner:server')._(:source, :main, :java)
>  checkstyle.source_paths << project('planner:server')._(:test, :main, :java)
> end
> 
> 
> [1] https://github.com/apache/buildr/tree/trunk/addon/buildr
> [2] https://github.com/apache/buildr/blob/trunk/addon/buildr/checkstyle.rb
> 
> On Tue, Apr 10, 2012 at 1: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
>> 
>> 
>> 
>> 
> 
> 
> 
> -- 
> Cheers,
> 
> Peter Donald


Mime
View raw message