Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require 'fileutils'
include FileUtils

version = 'v3.5'
compile_target = ENV.include?('target') ? ENV['target'] : 'Debug'
project = "MyProject"
framework_dir = File.join(ENV['windir'].dup, 'Microsoft.NET', 'Framework', version)
msbuild = File.join(framework_dir, 'msbuild.exe')
team_city = ENV.include?('teamcity_build') ? '/re:TeamCityExtension,Gallio.TeamCityIntegration' : ''

task :default => :build

task :build => [:compile, :test] 

task :compile do
  sh "#{msbuild} #{project}.sln /property:Configuration=#{compile_target}"
end

task :test do
  runner = 'tools\\Gallio\\Gallio.Echo.exe'
  assembly = "Test\\bin\\#{compile_target}\\MyProject.Test.dll"
  sh "#{runner} #{assembly} #{team_city}"
end

desc "Rebuild"
task :rebuild do
  sh "#{msbuild} #{project}.sln /t:Rebuild /property:Configuration=#{compile_target}"
end

desc "Clean"
task :clean do
  sh "#{msbuild} #{project}.sln /t:Clean /property:Configuration=#{compile_target}"
end