-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrakefile
More file actions
71 lines (58 loc) · 1.51 KB
/
rakefile
File metadata and controls
71 lines (58 loc) · 1.51 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
require 'rake'
require 'rake/testtask'
require 'pathname'
require 'rubygems'
require 'fileutils'
include FileUtils
class String
def slash(path)
if self =~ /\/$/
return self + path
end
return self + '/' + path
end
end
version = 'v3.5'
compileTarget = 'debug'
project = "Machine.SqlMap"
frameworkDir = File.join(ENV['windir'].dup, 'Microsoft.NET', 'Framework', version)
msbuild = File.join(frameworkDir, 'msbuild.exe')
task :setup => [ "setup:all" ]
file ".setup-done" => [ "rakefile" ] do
Rake::Task["setup:all"].invoke
end
namespace :setup do
task :all do
touch ".setup-done"
end
end
desc "Build and run specs"
task :default => [ "build", "specs:run" ]
desc "Build"
task :build => [ ".setup-done" ] do
sh "#{msbuild} Source/#{project}.sln"
end
namespace :specs do
task :view => :run do
system "start Specs/#{project}.Specs.html"
end
task :run do
puts 'Running Specs...'
sh "Libraries/Machine/Specifications/Machine.Specifications.ConsoleRunner.exe", "Build/Debug/#{project}.Specs.dll", "--html", "Specs/#{project}.Specs.html"
puts "Wrote specs to Specs/#{project}.Specs.html, run 'rake specs:view' to see them"
end
end
desc "Open solution in VS"
task :sln do
Thread.new do
system "devenv Source/#{project}.sln"
end
end
desc "Rebuild"
task :rebuild => [ ".setup-done" ] do
sh "#{msbuild} #{project}.sln /t:Rebuild"
end
desc "Clean"
task :clean do
sh "#{msbuild} #{project}.sln /t:Clean"
end