-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathRakefile.rb
33 lines (27 loc) · 853 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
require 'rake'
require 'albacore'
$projectSolution = 'src/MongoMigrations.sln'
$artifactsPath = "build"
$nugetFeedPath = ENV["NuGetDevFeed"] || 'build'
$nugetExe = ENV["NUGET_EXE"] || 'nuget'
$srcPath = File.expand_path('src')
task :build => [:build_release]
task :restore_packages do
sh "#{$nugetExe} restore #{$projectSolution}"
end
msbuild :build_release => [:clean, :restore_packages] do |msb|
msb.properties :configuration => :Release
msb.targets :Build
msb.solution = $projectSolution
end
task :clean do
puts "Cleaning"
FileUtils.rm_rf $artifactsPath
bins = FileList[File.join($srcPath, "**/bin")].map{|f| File.expand_path(f)}
bins.each do |file|
sh %Q{rmdir /S /Q "#{file}"}
end
end
task :nuget => [:build] do
sh "#{$nugetExe} pack src\\MongoMigrations\\MongoMigrations.csproj /OutputDirectory " + $nugetFeedPath
end