73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
# File 'lib/msbuild.rb', line 73
def self.runProjFile(attributes)
version = attributes.fetch(:clrversion, 'v4.0.30319')
compileTarget = attributes.fetch(:compilemode, 'debug')
projFile = attributes[:projFile]
if Platform.is_nix
msbuildFile = `which xbuild`.chop
attributes[:properties] << "TargetFrameworkProfile="""""
else
frameworkDir = File.join(ENV['windir'].dup, 'Microsoft.NET', 'Framework', version)
msbuildFile = File.join(frameworkDir, 'msbuild.exe')
end
properties = attributes.fetch(:properties, [])
switchesValue = ""
properties.each do |prop|
switchesValue += " /property:#{prop}"
end
= attributes.fetch(:extraSwitches, [])
.each do |switch|
switchesValue += " /#{switch}"
end
targets = attributes.fetch(:targets, [])
targetsValue = ""
targets.each do |target|
targetsValue += " /t:#{target}"
end
sh "#{msbuildFile} #{projFile} #{targetsValue} #{switchesValue}"
end
|