Class: RakeDotNet::FxCopCmd
- Inherits:
-
Object
- Object
- RakeDotNet::FxCopCmd
- Defined in:
- lib/rake_dotnet.rb
Instance Attribute Summary collapse
-
#apply_out_xsl ⇒ Object
Returns the value of attribute apply_out_xsl.
-
#culture ⇒ Object
Returns the value of attribute culture.
-
#dependencies_path ⇒ Object
Returns the value of attribute dependencies_path.
-
#dlls ⇒ Object
Returns the value of attribute dlls.
-
#echo_to_console ⇒ Object
Returns the value of attribute echo_to_console.
-
#ignore_autogen ⇒ Object
Returns the value of attribute ignore_autogen.
-
#out_file ⇒ Object
Returns the value of attribute out_file.
-
#out_xsl ⇒ Object
Returns the value of attribute out_xsl.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
-
#xsl_echo_to_console ⇒ Object
Returns the value of attribute xsl_echo_to_console.
Instance Method Summary collapse
- #cmd ⇒ Object
- #console ⇒ Object
- #files_to_analyse ⇒ Object
-
#initialize(dlls, params = {}) {|_self| ... } ⇒ FxCopCmd
constructor
A new instance of FxCopCmd.
- #run ⇒ Object
Constructor Details
#initialize(dlls, params = {}) {|_self| ... } ⇒ FxCopCmd
Returns a new instance of FxCopCmd.
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/rake_dotnet.rb', line 470 def initialize(dlls, params={}) @dlls = dlls @exe_dir = params[:fxcop_exe_dir] || File.join(TOOLS_DIR, 'fxcop') @exe = params[:fxcop_exe] || File.join(@exe_dir, 'fxcopcmd.exe') @apply_out_xsl = params[:apply_out_xsl] @culture = params[:culture] @dependencies_path = params[:dependencies_path] @echo_to_console = params[:echo_to_console] @ignore_autogen = params[:ignore_autogen] || true @out_file = params[:out_file] @out_xsl = File.join(@exe_dir, 'Xml', params[:out_xsl]) unless params[:out_xsl].nil? @summary = params[:summary] @verbose = params[:verbose] @xsl_echo_to_console = params[:xsl_echo_to_console] yield self if block_given? end |
Instance Attribute Details
#apply_out_xsl ⇒ Object
Returns the value of attribute apply_out_xsl.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def apply_out_xsl @apply_out_xsl end |
#culture ⇒ Object
Returns the value of attribute culture.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def culture @culture end |
#dependencies_path ⇒ Object
Returns the value of attribute dependencies_path.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def dependencies_path @dependencies_path end |
#dlls ⇒ Object
Returns the value of attribute dlls.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def dlls @dlls end |
#echo_to_console ⇒ Object
Returns the value of attribute echo_to_console.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def echo_to_console @echo_to_console end |
#ignore_autogen ⇒ Object
Returns the value of attribute ignore_autogen.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def ignore_autogen @ignore_autogen end |
#out_file ⇒ Object
Returns the value of attribute out_file.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def out_file @out_file end |
#out_xsl ⇒ Object
Returns the value of attribute out_xsl.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def out_xsl @out_xsl end |
#summary ⇒ Object
Returns the value of attribute summary.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def summary @summary end |
#verbose ⇒ Object
Returns the value of attribute verbose.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def verbose @verbose end |
#xsl_echo_to_console ⇒ Object
Returns the value of attribute xsl_echo_to_console.
468 469 470 |
# File 'lib/rake_dotnet.rb', line 468 def xsl_echo_to_console @xsl_echo_to_console end |
Instance Method Details
#cmd ⇒ Object
514 515 516 |
# File 'lib/rake_dotnet.rb', line 514 def cmd "\"#{@exe}\" #{files_to_analyse} #{console} #{out_file} #{out_xsl} #{apply_out_xsl}" end |
#console ⇒ Object
490 491 492 |
# File 'lib/rake_dotnet.rb', line 490 def console '/console' if @echo_to_console || @out_file.nil? end |
#files_to_analyse ⇒ Object
494 495 496 497 498 499 500 |
# File 'lib/rake_dotnet.rb', line 494 def files_to_analyse list = '' @dlls.each do |dll| list += "/file:\"#{dll}\" " end list = list.chop end |
#run ⇒ Object
518 519 520 521 522 |
# File 'lib/rake_dotnet.rb', line 518 def run puts cmd if VERBOSE sh cmd puts "##teamcity[importData type='FxCop' path='#{File.(@out_file)}']" if ENV['BUILD_NUMBER'] end |