Class: Buildr::FindBugs::FindBugsTask
- Inherits:
-
Rake::Task
- Object
- Rake::Task
- Buildr::FindBugs::FindBugsTask
- Defined in:
- lib/buildr-findBugs.rb
Instance Attribute Summary collapse
- #auxAnalyzePath ⇒ Object
- #auxClasspath ⇒ Object
- #excludeFilter ⇒ Object
- #jvmargs ⇒ Object
-
#project ⇒ Object
readonly
Returns the value of attribute project.
- #report ⇒ Object
- #sourcePath ⇒ Object
Instance Method Summary collapse
-
#initialize(*args) ⇒ FindBugsTask
constructor
:nodoc:.
-
#with(options) ⇒ Object
:call-seq: with(options) => self.
Constructor Details
#initialize(*args) ⇒ FindBugsTask
:nodoc:
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/buildr-findBugs.rb', line 28 def initialize(* args) #:nodoc: super enhance([:compile]) do mkpath File.dirname(report) #otherwise Findbugs can't create the file Buildr.ant('findBugs') do |ant| antClasspath = FindBugs.requires.join(File::PATH_SEPARATOR) excludeFilterFile = File.(excludeFilter) ant.taskdef :name=>'findBugs', :classname=>'edu.umd.cs.findbugs.anttask.FindBugsTask', :classpath => antClasspath ant.findBugs :output => "xml", :outputFile => report, :classpath => antClasspath, :pluginList => '', :jvmargs => jvmargs, :excludeFilter => excludeFilterFile do ant.sourcePath :path => sourcePath ant.auxAnalyzePath :path => auxAnalyzePath ant.auxClasspath { |aux| auxClasspath.each { |dep| aux.pathelement :location => dep } } unless auxClasspath.empty? end end end end |
Instance Attribute Details
#auxAnalyzePath ⇒ Object
59 60 61 |
# File 'lib/buildr-findBugs.rb', line 59 def auxAnalyzePath @auxAnalyzePath || project.compile.target end |
#auxClasspath ⇒ Object
63 64 65 |
# File 'lib/buildr-findBugs.rb', line 63 def auxClasspath @auxClasspath || project.compile.dependencies end |
#excludeFilter ⇒ Object
71 72 73 |
# File 'lib/buildr-findBugs.rb', line 71 def excludeFilter @excludeFilter || project.path_to("exclude_filter.xml") end |
#jvmargs ⇒ Object
67 68 69 |
# File 'lib/buildr-findBugs.rb', line 67 def jvmargs @jvmargs || "-Xmx512m" end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
24 25 26 |
# File 'lib/buildr-findBugs.rb', line 24 def project @project end |
#report ⇒ Object
51 52 53 |
# File 'lib/buildr-findBugs.rb', line 51 def report @report || project.path_to(:reports, "findbugs.xml") end |
#sourcePath ⇒ Object
55 56 57 |
# File 'lib/buildr-findBugs.rb', line 55 def sourcePath @sourcePath || project.compile.sources.select { |source| File.directory?(source.to_s) }.join(File::PATH_SEPARATOR) end |
Instance Method Details
#with(options) ⇒ Object
:call-seq:
with() => self
Passes options to the task and returns self.
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/buildr-findBugs.rb', line 80 def with() .each do |key, value| begin send "#{key}=", value rescue NoMethodError raise ArgumentError, "#{self.class.name} does not support the option #{key}" end end self end |