-
Notifications
You must be signed in to change notification settings - Fork 30
/
rakefile.rb
81 lines (65 loc) · 2.57 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
require 'albacore'
desc "Build all the code"
task :build => 'build:mount_files'
namespace :build do
task :clean => ['build/nuget', 'dist'] do
#rm_f FileList['build/nuget/*']
end
msbuild :compile => :clean do |msb|
msb.properties :configuration => :Release
msb.targets :Build
msb.solution = 'ObjectWorkFlow.sln'
end
directory 'build/nuget'
directory 'build/nuget/lib'
directory 'dist'
task :mount_files => [:compile, 'build/nuget', 'build/nuget/lib'] do
cp 'compile/objectflow.stateful/bin/release/objectflow.core.dll', 'build/nuget/lib/objectflow.core.dll'
cp 'compile/objectflow.stateful/bin/release/objectflow.core.xml', 'build/nuget/lib/objectflow.core.xml'
cp 'compile/objectflow.stateful/bin/release/objectflow.stateful.dll', 'build/nuget/lib/objectflow.stateful.dll'
cp 'compile/objectflow.stateful/bin/release/objectflow.stateful.xml', 'build/nuget/lib/objectflow.stateful.xml'
cp 'LICENSE.txt', 'build/nuget/LICENSE.txt'
end
end
desc "does everything for a release, aside from bumping the version"
task :default => :package
desc "Build the entire NuGet package, but don't upload it"
task :package => 'package:build_package'
namespace :package do
desc "create the nuspec file"
nuspec :make_spec do |nu|
nu.id = 'StatefulObjectflow'
nu.version = get_version
nu.authors = 'Tim Kellogg'
nu.owners = 'Tim Kellogg'
nu.description = "Objectflow is a library for creating simple, lightweight workflows for .NET applications"
nu.summary = "Objectflow is a library for creating simple, lightweight workflows for .NET applications"
nu.language = 'en-US'
nu.licenseUrl = 'https://github.com/tkellogg/objectflow/blob/master/LICENSE.txt'
nu.projectUrl = 'https://github.com/tkellogg/objectflow'
nu.working_directory = 'build/nuget'
nu.output_file = 'stateful_objectflow.nuspec'
nu.tags = 'workflow'
end
nugetpack :build_package => [:build, :make_spec, 'dist'] do |nu|
nu.base_folder = 'build/nuget'
nu.nuspec = 'build/nuget/stateful_objectflow.nuspec'
nu.output = 'dist'
end
end
desc "print out the current assembly version"
task :version do
puts "Version is: #{get_version}"
end
# look at AssemblyInfo.cs and extract version
def get_version
version = '0.5.0.0'
File.open 'objectflow.stateful/Properties/AssemblyInfo.cs' do |f|
txt = f.read
if /\[assembly: AssemblyVersion\("([^"]+)"\)\]\s*/ =~ txt
version = $~[1]
puts "Version is #{version}"
end
end
version
end