Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add /nologo and /filelogger params to msbuild #75

Open
mxriverlynn opened this issue Jun 5, 2010 · 2 comments
Open

add /nologo and /filelogger params to msbuild #75

mxriverlynn opened this issue Jun 5, 2010 · 2 comments

Comments

@mxriverlynn
Copy link
Owner

Rejmond Sejic provided this version of the msbuild task via email, to add the /nologo and /filelogger parameters to the msbuild command. need to integrate this into the dev branch for the next release:

require 'albacore_lib/albacore_helper'

class MSBuild
  extend AttrMethods
  include RunCommand
  include YAMLConfig
  include Logging
  
  attr_accessor :solution, :verbosity, :nologo, :logfile
  attr_array :targets
  attr_hash :properties
  
  def initialize
    @path_to_command = build_path_to_command
    @nologo = false
    super()
  end
  
  def build_path_to_command
    win_dir = ENV['windir'] || ENV['WINDIR']
    win_dir = 'C:/Windows' if win_dir.nil?
    
    File.join(win_dir.dup, 'Microsoft.NET', 'Framework', 'v3.5', 'MSBuild.exe')
  end
  
  def build
    build_solution(@solution)
  end
  
  def build_solution(solution)
    check_solution solution
    
    command_parameters = []
    command_parameters << "\"#{solution}\""
    command_parameters << "\"/verbosity:#{@verbosity}\"" if @verbosity != nil
    command_parameters << build_properties if @properties != nil
    command_parameters << "\"/target:#{build_targets}\"" if @targets != nil
    command_parameters << "\"/nologo\"" if @nologo
    command_parameters << "\"/fileLogger\" \"/fileloggerparameters:LogFile=#{@logfile}.log\"" if @logfile != nil
    
    result = run_command "MSBuild", command_parameters.join(" ")
    
    failure_message = 'MSBuild Failed. See Build Log For Detail'
    fail_with_message failure_message if !result
  end
  
  def check_solution(file)
    return if file
    msg = 'solution cannot be nil'
    fail_with_message msg
  end
  
  def build_targets
    @targets.join ";"
  end

  def build_properties
    option_text = []
    @properties.each do |key, value|
      option_text << "/p:#{key}\=\"#{value}\""
    end
    option_text.join(" ")
  end
end

... note: just need to take the params he provided, not the entire class.

@haf
Copy link
Collaborator

haf commented Jan 31, 2012

Is this incorporated yet?

@mxriverlynn
Copy link
Owner Author

no - this was never completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants