-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
80 lines (59 loc) · 1.88 KB
/
Rakefile
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
72
73
74
75
76
77
78
msbuild = 'c:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild'
msbuild_file = "MavenThought.MovieLibrary.msbuild"
msbuild_cmd = "#{msbuild} #{msbuild_file}"
task :default => [:build]
desc "Builds the project"
task :build do
call_target msbuild_cmd, :build
end
desc "Cleans the release and debug files"
task :clean do
call_target msbuild_cmd, :clean
end
desc "Rebuild the application by cleaning and then building"
task :rebuild => [:clean, :build] do
#nothing to do....
end
desc "Runs all the tests"
task :test => ["test:all"]
namespace :test do
desc "Builds and then runs all the tests under test folder"
task :all => [:build] do
call_target msbuild_cmd, :test
end
desc "Runs the test class that matches the name"
task :class, [:testee] => [:build] do |t, args|
call_target msbuild_cmd, :testclass, "Testee=#{args.testee}"
end
desc "Runs the test for an assembly"
task :assembly, [:testee] => [:build] do |t, args|
call_target msbuild_cmd, :testassembly, "Testee=#{args.testee}"
end
desc "Runs the test for a feature (tagee without @)"
task :feature, [:tagee] => [:build] do |t, args|
call_target msbuild_cmd, :feature, "Tag=#{args.tagee}"
end
desc "Runs all the features tests"
task :features => [:build] do
call_target msbuild_cmd, :features
end
end
namespace :tools do
desc "Runs stylecop and generates a report on the Output folder"
task :stylecop do
call_target msbuild_cmd, :stylecop
end
end
desc "Builds, Tests and then deploy the library as .zip to the deploy folder"
task :deploy do
call_target msbuild_cmd, :deploy
end
desc "Changes assemlbies version to the one specified"
task :release, [:version] do |t, args|
call_target msbuild_cmd, :UpdateAssemblyVersion, "Version=#{args.version}"
end
def call_target cmd, target_name, parameters = nil
line = "#{cmd} /t:#{target_name}"
line = line.concat " /p:#{parameters}" unless parameters.nil?
sh line
end