-
Notifications
You must be signed in to change notification settings - Fork 9
/
rakefile.rb
161 lines (144 loc) · 5.31 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
require 'rubygems'
require 'albacore'
require './Properties.rb'
require 'fileutils'
desc "compiles, runs tests and creates zip file"
task :all => [:default]
desc "compiles, runs tests and creates zip file"
task :default => [:compile, :tests, :package]
desc "Versioning"
task :version do
puts "The build number is #{RELEASE_BUILD_NUMBER}"
Rake::Task["agent:assemblyinfo"].execute
Rake::Task["agent_service:assemblyinfo"].execute
Rake::Task["update_service:assemblyinfo"].execute
Rake::Task["common:assemblyinfo"].execute
Rake::Task["diffie_hellman:assemblyinfo"].execute
Rake::Task["diffie_hellmanSpecs:assemblyinfo"].execute
Rake::Task["agentSpecs:assemblyinfo"].execute
end
namespace :agent do
desc "Update the version information for agent library"
assemblyinfo :assemblyinfo do |asm|
asm.version = RELEASE_BUILD_NUMBER
asm.company_name = COMPANY
asm.product_name = PRODUCT
asm.description = DESCRIPTION
asm.copyright = COPYRIGHT
asm.output_file = File.join(ABSOLUTE_PATH,'src','Rackspace.Cloud.Server.Agent','Properties','AssemblyInfo.cs')
end
end
namespace :common do
desc "Update the version information for common library"
assemblyinfo :assemblyinfo do |asm|
asm.version = RELEASE_BUILD_NUMBER
asm.company_name = COMPANY
asm.product_name = PRODUCT
asm.description = DESCRIPTION
asm.copyright = COPYRIGHT
asm.output_file = File.join(ABSOLUTE_PATH,'src','Rackspace.Cloud.Server.Common','Properties','AssemblyInfo.cs')
end
end
namespace :agentSpecs do
desc "Update the version information for agentSpecs"
assemblyinfo :assemblyinfo do |asm|
asm.version = RELEASE_BUILD_NUMBER
asm.company_name = COMPANY
asm.product_name = PRODUCT
asm.description = DESCRIPTION
asm.copyright = COPYRIGHT
asm.output_file = File.join(ABSOLUTE_PATH,'src','Rackspace.Cloud.Server.Agent.Specs','Properties','AssemblyInfo.cs')
end
end
namespace :diffie_hellmanSpecs do
desc "Update the version information for diffie_hellmanSpecs library"
assemblyinfo :assemblyinfo do |asm|
asm.version = RELEASE_BUILD_NUMBER
asm.company_name = COMPANY
asm.product_name = PRODUCT
asm.description = DESCRIPTION
asm.copyright = COPYRIGHT
asm.output_file = File.join(ABSOLUTE_PATH,'src','Rackspace.Cloud.Server.DiffieHellman.Specs','Properties','AssemblyInfo.cs')
end
end
namespace :diffie_hellman do
desc "Update the version information for diffie hellman library"
assemblyinfo :assemblyinfo do |asm|
asm.version = RELEASE_BUILD_NUMBER
asm.company_name = COMPANY
asm.product_name = PRODUCT
asm.description = DESCRIPTION
asm.copyright = COPYRIGHT
asm.output_file = File.join(ABSOLUTE_PATH,'src','Rackspace.Cloud.Server.Agent.DiffieHellman','Properties','AssemblyInfo.cs')
end
end
desc "Compile the solution"
msbuild :compile => :version do |msb|
msb.command = MSBUILD_EXE
msb.properties :configuration => COMPILE_TARGET
msb.targets :Rebuild
msb.verbosity = 'minimal'
msb.solution = SLN_FILE
end
desc "Run unit tests"
task :tests => [:agent_specs, :diffiehellman_specs]
desc "Run agent unit tests"
nunit :agent_specs => :compile do |nunit|
nunit.command = NUNIT_CMD_EXE
nunit.assemblies AGENT_UNIT_TEST_DLL
nunit.options '/xml=agent-unit-tests-results.xml'
end
desc "Run diffiehellman unit tests"
nunit :diffiehellman_specs => :compile do |nunit|
nunit.command = NUNIT_CMD_EXE
nunit.assemblies DIFFIEHELLMAN_UNIT_TEST_DLL
nunit.options '/xml=diffiehellman-unit-tests-results.xml'
end
desc "Packaging"
task :package do
Dir.mkdir BUILDS_DIR if !File.directory?(BUILDS_DIR)
Rake::Task["agent_service:zip"].execute
Rake::Task["update_service:zip"].execute
end
namespace :agent_service do
desc "Update the version information for agent service library"
assemblyinfo :assemblyinfo do |asm|
asm.version = RELEASE_BUILD_NUMBER
asm.company_name = COMPANY
asm.product_name = PRODUCT
asm.description = DESCRIPTION
asm.copyright = COPYRIGHT
asm.output_file = File.join(ABSOLUTE_PATH,'src','Rackspace.Cloud.Server.Agent.Service','Properties','AssemblyInfo.cs')
end
desc "Create zip for agent service"
zip do |zip|
file = 'AgentService.zip'
File.delete(file) if File.exists?(file)
zip.output_path = BUILDS_DIR
zip.directories_to_zip AGENT_SERVICE_DIR
zip.additional_files = ["installagentservice.bat"]
zip.output_file = file
puts "Agent Service zip file created"
end
end
namespace :update_service do
desc "Update the version information for udpate service library"
assemblyinfo :assemblyinfo do |asm|
asm.version = RELEASE_BUILD_NUMBER
asm.company_name = COMPANY
asm.product_name = PRODUCT
asm.description = DESCRIPTION
asm.copyright = COPYRIGHT
asm.output_file = File.join(ABSOLUTE_PATH,'src','Rackspace.Cloud.Server.Agent.UpdaterService','Properties','AssemblyInfo.cs')
end
desc "Create zip for update service"
zip do |zip|
file = 'UpdateService.zip'
File.delete(file) if File.exists?(file)
zip.output_path = BUILDS_DIR
zip.directories_to_zip UPDATE_SERVICE_DIR
zip.additional_files = ["installupdateservice.bat"]
zip.output_file = file
puts "Update Service zip file created"
end
end