forked from restful-routing/restful-routing
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
64 lines (52 loc) · 1.73 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
require 'rubygems'
require 'albacore'
PROJECT = 'RestfulRouting'
task :default => [:clean, :compile, :spec]
desc 'removes build files'
task :clean do
FileUtils.rm_rf("build")
end
desc 'generates assembly info'
assemblyinfo :assemblyinfo do |asm|
asm.version = "1.4.2"
asm.product_name = "RestfulRouting"
asm.title = "RestfulRouting"
asm.description = "RestfulRouting is a routing library for ASP.NET MVC based on the Rails 3 routing DSL."
asm.output_file = "src/RestfulRouting/Properties/AssemblyInfo.cs"
end
desc 'compile'
msbuild :compile => [:clean, :assemblyinfo] do |msb|
msb.solution = "src\\#{PROJECT}.sln"
msb.verbosity = 'minimal'
msb.properties = {
:configuration => :Release,
:BuildInParallel => :false,
:Architecture => 'x86'
}
msb.targets :Rebuild
FileUtils.mkdir_p 'build'
Dir.glob(File.join("src/#{PROJECT}/bin/Release", "*.{dll,pdb,xml,exe}")) do |file|
copy(file, 'build')
end
end
desc 'runs specs'
mspec :spec do |mspec|
mspec.command = 'tools\\mspec\\mspec-x86-clr4.exe'
mspec.assemblies "src\\#{PROJECT}.Spec\\bin\\Release\\#{PROJECT}.Spec.dll"
mspec.html_output = "build\\specs.html"
end
desc 'Create the nuget distribution package'
task :package => :compile do
system "src\\.nuget\\nuget.exe pack RestfulRouting.nuspec -o build"
end
desc 'Release to nuget'
task :release => :package do
version = IO.read("RestfulRouting.nuspec").match(%r{\<version\>(.*)\</version\>})[1]
raise("This version has already been committed.") if `git tag`.split(/\n/).include?(version)
nuspecs = Dir['build/*.nupkg']
raise "Could not find nupkg file" unless nuspecs.size == 1
system "nuget push #{nuspecs.first}"
system "git tag \"v#{version}\""
system "git push origin master"
system "git push origin master --tags"
end