Class: Nbuild::MSBuildCmd
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(params = {}) ⇒ MSBuildCmd
constructor
A new instance of MSBuildCmd.
Methods inherited from Cmd
Constructor Details
#initialize(params = {}) ⇒ MSBuildCmd
Returns a new instance of MSBuildCmd.
5 6 7 8 9 10 11 |
# File 'lib/nbuild/msbuild_cmd.rb', line 5 def initialize params={} @params = params version = params.delete(:framework_version) version ||= '3.5' path = ENV['MS_NET_FRAMEWORK_HOME'] || 'C:\WINDOWS\Microsoft.NET\Framework' @path = "#{path}\\v#{version}" end |
Instance Method Details
#command ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/nbuild/msbuild_cmd.rb', line 13 def command p = @params.dup project = p.delete(:project) raise 'msbuild: a project or solution parameter is required' unless project targets = p.delete(:targets) t = "/t:#{targets.join(';')}" if targets properties = p.map {|k,v| "/p:\"#{k}\"=\"#{v.gsub(';','%3B')}\""} "\"#{@path}\\msbuild.exe\" #{project} #{t} #{properties.join(' ')}" end |