-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile.rb
72 lines (50 loc) · 1.64 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
require 'rubygems'
puts "Chequing bundled dependencies, please wait...."
system "bundle install --system --quiet"
require 'albacore'
require 'git'
require 'noodle'
require 'rake/clean'
include FileUtils
solution_file = FileList["*.sln"].first
build_file = FileList["*.msbuild"].first
project_name = "MavenThought.MovieLibrary"
commit = Git.open(".").log.first.sha[0..10] rescue 'na'
version = IO.readlines('VERSION')[0] rescue "0.0.0.0"
deploy_folder = "c:/temp/build/#{project_name}.#{version}_#{commit}"
merged_folder = "#{deploy_folder}/merged"
CLEAN.include("main/**/bin", "main/**/obj", "test/**/obj", "test/**/bin")
CLOBBER.include("**/_*", "**/.svn", "lib/*", "**/*.user", "**/*.cache", "**/*.suo")
desc 'Default build'
task :default => ["build:all"]
desc 'Setup requirements to build and deploy'
task :setup => ["setup:dep:local"]
desc "Updates build version, generate zip, merged version and the gem in #{deploy_folder}"
task :deploy => ["deploy:all"]
desc "Run all tests"
task :test => ["test:all"]
namespace :setup do
namespace :dep do
Noodle::Rake::NoodleTask.new :local do |n|
n.groups << :runtime
n.groups << :dev
end
end
end
namespace :build do
desc "Build the project"
msbuild :all, :config do |msb, args|
msb.properties :configuration => args[:config] || :Debug
msb.targets :Build
msb.solution = solution_file
end
desc "Rebuild the project"
task :re => ["clean", "build:all"]
end
namespace :test do
desc 'Run all tests'
nunit :all => :default do |nunit|
nunit.command = "lib/nunit-2.5.7.10213.20100801/net-2.0/nunit-console.exe"
nunit.assemblies FileList["test/**/bin/debug/**/*.Tests.dll"].join " "
end
end