-
Notifications
You must be signed in to change notification settings - Fork 0
/
rakefile.rb
92 lines (72 loc) · 2.1 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
require 'rake'
require 'rake/clean'
require 'fileutils'
require 'erb'
require 'configatron'
=begin Supplementary Build Files
build\utils - Utilities for the build
build\tasks\configuration.rb - Project specific configuration
build\tasks\machine_specs.rb
build\tasks\deployment.rb - Packaging tasks
=end
%w[utils tasks].each do|folder|
Dir.glob(File.join(File.dirname(__FILE__),"build/#{folder}/*.rb")).each do|item|
require item
end
end
Rake::Task['configure'].invoke
%w[expand_all_template_files].each do|build_task|
Rake::Task[build_task].invoke
end
[
configatron.artifacts_dir,
configatron.specs.dir
].each do |item|
CLEAN.include(item)
end
Rake::Task['expand_all_template_files'].invoke
@project_files = FileList.new("#{configatron.source_dir}/**/*.csproj")
#configuration files
config_files = FileList.new(File.join(configatron.source_dir,'config','*.erb')).select{|fn| ! fn.include?('app.config')}
#target folders that can be run from VS
solution_file = "solution.sln"
task :default => ["specs:run"]
task :init => :clean do
[
configatron.artifacts_dir,
configatron.specs.dir,
configatron.specs.report_dir,
configatron.distribution.zip.dir,
configatron.distribution.nuget.dir
].each do |folder|
FileUtils.mkdir_p folder if ! File.exists?(folder)
end
end
namespace :build do
desc 'compiles the project'
task :compile => :init do
opts = {
:version => 'v4\Full',
:switches => { :verbosity => :minimal, :target => :Build },
:properties => {
:Configuration => configatron.target,
:TrackFileAccess => false
}
}
@project_files.each do |project|
MSBuildRunner.build opts.merge({ :project => project }),
{
:OutputPath => configatron.artifacts_dir.to_absolute
}
end
end
task :from_ide do
config_files.each do |file|
[configatron.artifacts_dir].each do|folder|
FileUtils.cp(file.name_without_template_extension,
folder.join(file.base_name_without_extension))
end
end
end
task :rebuild => ["clean","compile"]
end