forked from shawnmclean/Mandrill-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile.rb
85 lines (73 loc) · 2.44 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
include Rake::DSL
require 'albacore'
require 'version_bumper'
require './rakefile.config'
MANDRILL_CORE_DIR = 'src/Mandrill/bin/release/Mandrill.dll'
MANDRIL_MONO_DIR = 'src/Mandrill.Mono/bin/release/Mandrill.dll'
task :deploy,[:build] => [:zip, :nuget_push] do
end
zip :zip => :output do | zip |
Dir.mkdir("build") unless Dir.exists?("build")
zip.directories_to_zip "out"
zip.output_file = "Mandrill.v#{bumper_version.to_s}.zip"
zip.output_path = "build"
end
output :output => :test do |out|
out.from '.'
out.to 'out'
out.file MANDRILL_CORE_DIR, :as=>'Mandrill.dll'
out.file 'LICENSE.txt'
out.file 'README.md'
out.file 'VERSION'
end
desc "Test"
nunit :test => :build do |nunit|
nunit.command = "tools/NUnit/nunit-console.exe"
nunit.assemblies "tests/bin/Release/Mandrill.Tests.dll"
end
desc "Build"
msbuild :build => :assemblyinfo do |msb|
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "Mandrill.sln"
end
nugetpush :nuget_push => :nup do |nuget|
nuget.command = "nuget.exe"
nuget.package = "Mandrill.#{bumper_version.to_s}.nupkg"
nuget.apikey = "#{Configuration::Build.api_key}"
nuget.create_only = true
end
##This does not work from albacore.
#nugetpack :nup => :nus do |nuget|
# nuget.command = "tools/NuGet/NuGet.exe"
# nuget.nuspec = "Mandrill.nuspec"
# nuget.base_folder = "out/"
# nuget.output = "build/"
#end
##use this until patched
task :nup => :nus do
sh "tools/NuGet/NuGet.exe pack -BasePath out/ -Output build/ out/Mandrill.nuspec"
end
nuspec :nus => :output do |nuspec|
nuspec.id="Mandrill"
nuspec.version = bumper_version.to_s
nuspec.authors = "Shawn Mclean, Eli Schleifer"
nuspec.description = "Mandrill .Net is a quick and easy wrapper for getting started with the Mandrill API."
nuspec.title = "Mandrill"
nuspec.language = "en-US"
nuspec.licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0"
nuspec.dependency "RestSharp", "104.1.0.0"
nuspec.dependency "Newtonsoft.Json", "4.5.10"
nuspec.projectUrl = "https://github.com/shawnmclean/Mandrill-dotnet"
nuspec.working_directory = "out/"
nuspec.output_file = "Mandrill.nuspec"
nuspec.file "Mandrill.dll", "lib"
end
assemblyinfo :assemblyinfo do |asm|
asm.version = bumper_version.to_s
asm.file_version = bumper_version.to_s
asm.company_name = "Self"
asm.product_name = "Mandrill"
asm.copyright = "Shawn Mclean (c) 2012"
asm.output_file = "AssemblyInfo.cs"
end