-
Notifications
You must be signed in to change notification settings - Fork 1
/
rakefile.rb
41 lines (32 loc) · 1003 Bytes
/
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
require 'rubygems'
require 'albacore'
MSBUILD_PATH = "C:/Windows/Microsoft.NET/Framework/v4.0.30319/"
BUILD_PATH = File.expand_path('build')
LIB_PATH = File.expand_path('lib')
SOLUTION = "src/ServiceRunner.sln"
COMPILE_TARGET = "Release"
nuget = 'nuget'
#load "VERSION.txt"
task :default => ["build:all"]
namespace :build do
task :all => [:clean, :compile]
assemblyinfo :versioning do |asm|
BUILD_VERSION=File.read('VERSION.txt').strip;
asm.output_file = "src/CommonAssemblyInfo.cs"
asm.version = "#{BUILD_VERSION}"
end
task :clean do
rm_rf "#{BUILD_PATH}"
rm_rf "#{LIB_PATH}"
end
task :compile => [:versioning] do
mkdir "#{BUILD_PATH}"
sh "#{MSBUILD_PATH}msbuild.exe /p:Configuration=#{COMPILE_TARGET} #{SOLUTION}"
copyOutputFiles "src/ServiceRunner/bin/#{COMPILE_TARGET}", "*.exe", "#{BUILD_PATH}"
end
def copyOutputFiles(fromDir, filePattern, outDir)
Dir.glob(File.join(fromDir, filePattern)){|file|
copy(file, outDir) if File.file?(file)
}
end
end