Class: RakeDotNet::MsBuildCmd

Inherits:
Object
  • Object
show all
Defined in:
lib/rake_dotnet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project = 'default.proj', properties = {}, targets = [], verbosity = 'n', working_dir = nil) ⇒ MsBuildCmd

Returns a new instance of MsBuildCmd.



726
727
728
729
730
731
732
733
# File 'lib/rake_dotnet.rb', line 726

def initialize(project='default.proj', properties={}, targets=[], verbosity='n', working_dir=nil)
	@project = project
	@properties = properties
	@targets = targets
	@verbosity = verbosity
	@working_dir = working_dir
	@exe = '"' + File.join(ENV['windir'].dup, 'Microsoft.NET', 'Framework', 'v3.5', 'msbuild.exe') + '"'
end

Instance Attribute Details

#projectObject

Returns the value of attribute project.



724
725
726
# File 'lib/rake_dotnet.rb', line 724

def project
  @project
end

#propertiesObject

Returns the value of attribute properties.



724
725
726
# File 'lib/rake_dotnet.rb', line 724

def properties
  @properties
end

#targetsObject

Returns the value of attribute targets.



724
725
726
# File 'lib/rake_dotnet.rb', line 724

def targets
  @targets
end

#verbosityObject

Returns the value of attribute verbosity.



724
725
726
# File 'lib/rake_dotnet.rb', line 724

def verbosity
  @verbosity
end

Instance Method Details

#cmdObject



735
736
737
# File 'lib/rake_dotnet.rb', line 735

def cmd
	"#{@exe} #{project} /maxcpucount /v:#{@verbosity} /p:#{properties} /t:#{targets}"
end

#runObject



739
740
741
742
743
744
745
746
# File 'lib/rake_dotnet.rb', line 739

def run
	if @working_dir
		chdir(@working_dir) do
			puts cmd if VERBOSE
			sh cmd
		end
	end
end