forked from Logrythmik/NLog.MongoDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rakefile.rb
52 lines (38 loc) · 1.33 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
require 'albacore'
require './rakefile.config'
namespace :nuget do
command = '.nuget/NuGet.exe'
nuspec = 'NLog.MongoDB.nuspec'
build_directory = 'build'
version = '0.3.0'
task :package => :setup_build do
base_folder = "#{build_directory}/"
sh "#{command} pack -BasePath #{base_folder} -Output #{base_folder} #{nuspec}"
end
directory build_directory
task :setup_build => ['build:release', 'build'] do
cp FileList['NLog.MongoDB/bin/Release/NLog.MongoDB.*'], 'build'
end
task :push => :package do
api_key = NLog_MongoDB::Build.api_key
sh "#{command} setApiKey #{api_key}"
sh "#{command} push #{build_directory}/NLog.MongoDB.#{version}.nupkg"
end
end
desc "runs all unit tests in debug mode"
task :test => 'build:test'
namespace :build do
# loop to create a couple tasks -- one for debug, and one for release
[:debug, :release].each do |configuration|
desc "Builds a #{configuration} version of NLog.MongoDB"
msbuild configuration do |msb|
msb.properties :configuration => configuration
msb.targets = [ :Clean, :Build ]
msb.solution = 'NLog.MongoDb.sln'
end
end
nunit :test => :debug do |nunit|
nunit.command = 'packages/NUnit.2.5.10.11092/tools/nunit-console.exe'
nunit.assemblies 'NLog.MongoDB.Tests/bin/Debug/NLog.MongoDB.Tests.dll'
end
end