This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
rakefile.rb
117 lines (83 loc) · 2.89 KB
/
rakefile.rb
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
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
108
109
110
111
112
113
require 'albacore'
require 'find'
# Find any tests that end with '.tests.dll' for the given build type
# assuming that is built into bin/<build_type>
def find_tests(root, build_type)
paths = []
re = Regexp.new(".*/bin/#{build_type}.*Tests\.dll$", Regexp::IGNORECASE)
Find.find(root) do |path|
paths << path if path =~ re
end
return paths
end
# Define the root relative to this file.
ROOT=File.expand_path('.', File.dirname(__FILE__))
PACKAGES_DIR=File.join(ROOT, 'packages')
# What we're building
SOLUTION=File.join(ROOT, 'Refractored.MvxPlugins.sln' )
# Nuget binary
NUGET_EXE = File.join(ROOT, '.nuget/nuget.exe')
# Multi-cpu compile, no logo, low verbosity
COMPILER_SWITCHES = {
'M' => true,
'verbosity' => 'normal',
'nologo' => true
}
# Relative to this file
desc 'Restore nuget packages'
task :restore_packages do
FileList["**/packages.config"].each do |filepath|
sh "#{NUGET_EXE} install #{filepath} -OutputDirectory #{PACKAGES_DIR}"
end
end
desc "Update nuget"
exec :update_nuget do |cmd|
cmd.command = NUGET_EXE
cmd.parameters = "update -Self"
end
desc 'Set up everything if checked out for the first time'
task :setup => [:restore_packages]
desc 'Clean entire build'
task :clean => ["release:clean", "debug:clean"]
desc 'Build everything'
task :build => ["debug:build", "release:build"]
desc 'Clean, rebuild'
task :preflight => [:setup, :clean, :build]
########################################################################################################################
# Debug tasks
########################################################################################################################
namespace 'debug' do
desc 'Build'
msbuild :build do |msb|
msb.properties = { :configuration => :Debug }
msb.targets = [ :Build ]
msb.other_switches = COMPILER_SWITCHES
msb.solution = SOLUTION
end
desc 'Clean'
msbuild :clean do |msb|
msb.properties = { :configuration => :Debug }
msb.targets = [ :Clean ]
msb.other_switches = COMPILER_SWITCHES
msb.solution = SOLUTION
end
end
########################################################################################################################
# Release tasks
########################################################################################################################
namespace 'release' do
desc 'Build'
msbuild :build do |msb|
msb.properties = { :configuration => :Release, :platform => 'Any CPU' }
msb.targets = [ :Build ]
msb.other_switches = COMPILER_SWITCHES
msb.solution = SOLUTION
end
desc 'Clean'
msbuild :clean do |msb|
msb.properties = { :configuration => :Release, :platform => 'Any CPU' }
msb.targets = [ :Clean ]
msb.other_switches = COMPILER_SWITCHES
msb.solution = SOLUTION
end
end