forked from bjankord/Categorizr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile.rb
70 lines (60 loc) · 1.84 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
require 'albacore'
require 'fileutils'
task :default => :build
task :build => ['build:specs']
namespace :build do
msbuild :compile, [:target] => ['clean:build'] do |msb, args|
msb.targets [:clean, :rebuild]
msb.properties = {
:configuration => args[:target] || :Debug,
:outdir => "#{Dir.pwd}/build/"
}
msb.verbosity = "minimal"
msb.solution = "Categorizr.sln"
end
mspec :specs => :compile do |mspec|
mspec.command = "packages/Machine.Specifications.0.5.8/tools/mspec-clr4.exe"
mspec.assemblies "build/Categorizr.Specs.dll"
end
end
namespace :clean do
task :build do
rm_rf("build") if File.directory? "build"
end
task :release do
rm_rf("release") if File.directory? "release"
end
end
task :publish, [:apikey] => ['build', 'clean:release'] do |task, args|
Rake::Task['build:compile'].execute({:target => :Release})
mkdir_p("release/lib/net20")
cp "build/Categorizr.dll", "release/lib/net20"
Rake::Task['nuget:create'].invoke
Rake::Task['nuget:pack'].invoke
Rake::Task['nuget:push'].invoke(args.apikey)
end
namespace :nuget do
nuspec :create do |nuspec|
nuspec.id = "Categorizr"
nuspec.version = "0.1.1"
nuspec.authors = "Rory Fitzpatrick"
nuspec.description = "A modern device detection script"
nuspec.title = "Categorizr"
nuspec.projectUrl = "https://github.com/stormid/Categorizr"
nuspec.tags = "mobile device-detection"
nuspec.working_directory = "release"
nuspec.output_file = "Categorizr.nuspec"
nuspec.copyright = "Rory Fitzpatrick 2012, Brett Jankford 2011"
end
nugetpack :pack do |nuget|
nuget.command = ".nuget/Nuget.exe"
nuget.nuspec = "release/Categorizr.nuspec"
nuget.base_folder = "release"
nuget.output = "release"
end
nugetpush :push, [:apikey] do |nuget, args|
nuget.command = ".nuget/Nuget.exe"
nuget.package = "release\\Categorizr.0.1.1.nupkg"
nuget.apikey = args.apikey
end
end