forked from mrak/stubby4net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
101 lines (84 loc) · 2.74 KB
/
Rakefile
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
require 'albacore'
require 'version_bumper'
description = "A small server for stubbing external systems during development."
title = "stubby4net"
product = "stubby"
company = "Eric Mrak"
copyright = "Copyright 2013"
nuspec_file = 'stubby/stubby.nuspec'
version = bumper_version.to_s.strip
nupkg = "nuget/stubby.#{version}.nupkg"
desc "Generate nuspec file"
nuspec :nuspec do |ns|
ns.id = product
ns.version = version
ns.authors = company
ns.description = description
ns.title = title
ns.language = "en_US"
ns.licenseUrl = "https://raw.github.com/mrak/stubby4net/master/LICENSE.txt"
ns.projectUrl = "https://github.com/mrak/stubby4net"
ns.iconUrl = "http://stub.by/favicon.ico"
ns.tags = "stub mock testing server"
ns.copyright = copyright
ns.file 'bin/stubby.exe', 'lib'
ns.file 'bin/Release/stubby.xml', 'lib'
ns.output_file = nuspec_file
end
desc "Create nupkg files"
exec :package => [:nuspec, :default] do |cmd|
cmd.command = '/home/mrak/bin/nuget'
cmd.parameters 'pack ' + nuspec_file + ' -Symbols -BasePath stubby -OutputDirectory nuget'
end
desc "Publish to NuGet"
exec :publish => :package do |pub|
pub.command = '/home/mrak/bin/nuget'
pub.parameters "push #{nupkg}"
end
desc "Publish to Chocolatey"
exec :chocolatey => :package do |choc|
choc.command = 'cpush'
choc.parameters nupkg
end
desc "Install locally as a command"
task :install => :package do
%x{cd nuget; cinst stubby -source %cd%}
end
desc "Generate AsseblyInfo.cs"
assemblyinfo :assemblyinfo do |asm|
asm.version = version
asm.file_version = version
asm.company_name = company
asm.product_name = product
asm.title = title
asm.description = description
asm.copyright = copyright
asm.com_visible = false
asm.com_guid = "afa901aa-9750-470b-9d6f-a03ed5b5ae92"
asm.namespaces "System.Runtime.CompilerServices"
asm.custom_attributes :InternalsVisibleTo => "unit"
asm.output_file = "stubby/Properties/AssemblyInfo.cs"
end
desc "Build"
exec :build => :assemblyinfo do |xb|
xb.command = 'xbuild'
xb.parameters '/nologo /p:Configuration=Release /target:Build stubby4net.sln'
end
#msbuild :build => :assemblyinfo do |msb|
#msb.command = "xbuild"
#msb.properties = { :configuration => :Release }
#msb.targets = [ :Clean, :Build ]
#msb.solution = "stubby4net.sln"
#end
desc "Merge together assemblies"
exec :merge => :build do |ilm|
ilm.command = 'ILmerge.exe'
ilm.parameters '/wildcards /out:stubby/bin/stubby.exe stubby/bin/Release/stubby.exe stubby/bin/Release/*.dll'
puts 'merging...'
end
desc "Test"
nunit :test => :build do |nunit|
nunit.command = 'nunit-console4'
nunit.assemblies 'unit/bin/Release/unit.dll', 'integration/bin/Release/integration.dll'
end
task :default => [:test, :merge]