forked from haf/Topshelf.FSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
79 lines (64 loc) · 2.22 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
require 'bundler/setup'
require 'fileutils'
require 'albacore'
require 'albacore/tasks/versionizer'
require 'albacore/tasks/release'
directory 'build'
Configuration = ENV['CONFIGURATION'] || 'Release'
build :clean_sln do |b|
b.prop 'Configuration', Configuration
b.sln = 'src/Topshelf.FSharp.sln'
b.target = 'Clean'
end
desc 'clean the solution directory'
task :clean => :clean_sln do
puts 'Removing build/'
FileUtils.rm_rf './build/'
end
Albacore::Tasks::Versionizer.new :versioning
asmver_files :asmver => :versioning do |a|
a.files = FileList['**/*proj']
a.attributes assembly_description: 'Topshelf F# API',
assembly_configuration: Configuration,
assembly_copyright: "(c) #{Time.now.year} by Henrik Feldt",
assembly_version: ENV['LONG_VERSION'],
assembly_file_version: ENV['LONG_VERSION'],
assembly_informational_version: ENV['BUILD_VERSION']
end
namespace :bin do
nugets_restore :restore do |p|
p.out = 'src/packages'
p.exe = 'tools/NuGet.exe'
end
build :compile_quick do |b|
b.prop 'Configuration', Configuration
b.sln = 'src/Topshelf.FSharp.sln'
end
desc 'compile Topshelf.FSharp'
task :compile => [:restore, 'build', :asmver, :compile_quick]
directory 'build/pkg'
nugets_pack :nugets_quick => 'build/pkg' do |p|
p.configuration = Configuration
p.files = FileList['src/**/*.{csproj,fsproj,nuspec}'].
exclude(/Tests|Specs|Example/)
p.out = 'build/pkg'
p.exe = 'tools/NuGet.exe'
p.with_metadata do |m|
m.description = 'Topshelf F# API'
m.authors = 'Henrik Feldt'
m.version = ENV['NUGET_VERSION']
m.project_url = 'https://github.com/haf/Topshelf.FSharp'
end
end
desc 'package nugets - finds all projects and package them'
task :nugets => [:compile, :nugets_quick]
end
task :ensure_key do
raise "missing NUGET_KEY" unless ENV['NUGET_KEY']
end
Albacore::Tasks::Release.new :release,
pkg_dir: 'build/pkg',
depend_on: [:'bin:nugets', :ensure_key],
nuget_exe: 'tools/NuGet.exe',
api_key: ENV['NUGET_KEY']
task :default => [:'bin:compile', :'bin:nugets']