forked from DarthFubuMVC/fubumvc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
RakeFile
executable file
·80 lines (60 loc) · 2.42 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
79
80
COMPILE_TARGET = "debug"
require "build_support/BuildUtils.rb"
include FileTest
require 'rubygems'
require 'zip/zip'
require 'zip/zipfilesystem'
RESULTS_DIR = "results"
BUILD_NUMBER = "0.1.0."
PRODUCT = "FubuMVC"
COPYRIGHT = 'Copyright 2008 Chad Myers, Jeremy D. Miller, Joshua Flanagan, et al. All rights reserved.';
COMMON_ASSEMBLY_INFO = 'src/CommonAssemblyInfo.cs';
CLR_VERSION = "v3.5"
versionNumber = ENV["BUILD_NUMBER"].nil? ? 0 : ENV["BUILD_NUMBER"]
props = { :archive => "build" }
desc "Compiles, unit tests, generates the database"
task :all => [:default]
desc "**Default**, compiles and runs tests"
task :default => [:compile, :unit_test]
desc "Displays a list of tasks"
task :help do
taskHash = Hash[*(`rake.cmd -T`.split(/\n/).collect { |l| l.match(/rake (\S+)\s+\#\s(.+)/).to_a }.collect { |l| [l[1], l[2]] }).flatten]
indent = " "
puts "rake #{indent}#Runs the 'default' task"
taskHash.each_pair do |key, value|
if key.nil?
next
end
puts "rake #{key}#{indent.slice(0, indent.length - key.length)}##{value}"
end
end
desc "Update the version information for the build"
task :version do
builder = AsmInfoBuilder.new(BUILD_NUMBER, {'Product' => PRODUCT, 'Copyright' => COPYRIGHT})
buildNumber = builder.buildnumber
puts "The build number is #{buildNumber}"
builder.write COMMON_ASSEMBLY_INFO
end
desc "Prepares the working directory for a new build"
task :clean do
#TODO: do any other tasks required to clean/prepare the working directory
Dir.mkdir props[:archive] unless exists?(props[:archive])
end
desc "Compiles the app"
task :compile => [:clean, :version] do
MSBuildRunner.compile :compilemode => COMPILE_TARGET, :solutionfile => 'src/FubuMVC.sln', :clrversion => CLR_VERSION
AspNetCompilerRunner.compile :webPhysDir => "src/FubuMVC.HelloWorld", :webVirDir => "localhost/xyzzyplugh"
outDir = "src/FubuMVC.StructureMap/bin/#{COMPILE_TARGET}"
Dir.glob(File.join(outDir, "*.{dll,pdb}")){|file|
copy(file, props[:archive]) if File.file?(file)
}
end
desc "Runs unit tests"
task :test => [:unit_test]
desc "Runs unit tests"
task :unit_test => :compile do
runner = NUnitRunner.new :compilemode => COMPILE_TARGET, :source => 'src', :platform => 'x86'
runner.executeTests ['FubuMVC.Tests', 'HtmlTags.Testing']
end
desc "Target used for the CI server"
task :ci => [:unit_test]