-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
47 lines (36 loc) · 1.22 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
require 'rake/clean'
require 'rake/tasklib'
require 'albacore'
NUNIT_EXE = "tools/Nunit/bin/net-2.0/nunit-console.exe"
SOLUTION_PATH = "."
OUTPUT_PATH = "build"
CONFIG = ENV['CONFIG'] || "Debug"
ENVIRONMENT = ENV['ENVIRONMENT'] || "dev"
CLEAN.include(OUTPUT_PATH)
task :default => "build:all"
namespace :build do
task :all => [:clean, :compile, :config, :test]
desc "Build solutions using MSBuild"
msbuild :compile do |msb|
msb.properties = {:configuration => CONFIG}
msb.targets [:Clean, :Build]
msb.solution = FileList["#{SOLUTION_PATH}/*.sln"]
end
desc "Generate app and web config files for correct environment"
task :config do
["app", "web"].each do |config_type|
FileList["src/**/#{config_type}.config"].each do |file|
e = ExpandTemplates.new
e.data_file = "config/environments/#{ENVIRONMENT}.yml"
e.expand_files = {"config/#{config_type}.template.config" => file }
e.expand
end
end
end
desc "Runs tests with NUnit"
nunit :test=>[:compile] do |nunit|
nunit.path_to_command = NUNIT_EXE
nunit.assemblies = FileList["#{OUTPUT_PATH}/tests/**/*.Tests.dll"]
nunit.options << "/xml=#{OUTPUT_PATH}/TestResults.xml" << "/nologo"
end
end