forked from haf/Http.fs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
100 lines (83 loc) · 3.38 KB
/
Copy pathRakefile
File metadata and controls
100 lines (83 loc) · 3.38 KB
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
# encoding: UTF-8
require 'bundler/setup'
require 'albacore'
require 'albacore/tasks/release'
require 'albacore/tasks/versionizer'
Configuration = ENV['CONFIGURATION'] || 'Release'
HttpFsStrongName = ENV['HTTPFS_STRONG_NAME'] && true || false
Albacore::Tasks::Versionizer.new :versioning
desc 'create assembly infos'
asmver_files :assembly_info do |a|
a.files = FileList['**/*proj'] # optional, will find all projects recursively by default
a.attributes assembly_description: 'A simple, functional HTTP client library for F#',
assembly_configuration: Configuration,
assembly_company: 'None',
assembly_copyright: 'Contributors',
assembly_version: ENV['LONG_VERSION'],
assembly_file_version: ENV['LONG_VERSION'],
assembly_informational_version: ENV['BUILD_VERSION']
end
desc 'Perform fast build (warn: doesn\'t d/l deps)'
build :quick_compile do |b|
b.prop 'Configuration', Configuration
b.logging = 'detailed'
b.sln = 'Http.fs.sln'
if HttpFsStrongName
b.prop 'AssemblyStrongName', 'true'
end
end
task :paket_bootstrap do
system 'Tools/paket.bootstrapper.exe', clr_command: true unless File.exists? 'Tools/paket.exe'
end
task :paket_replace do
sh %{ruby -pi.bak -e "gsub(/module internal YoLo/, 'module internal HttpFs.YoLo')" paket-files/haf/YoLo/YoLo.fs}
sh %{ruby -pi.bak -e "gsub(/namespace Logary.Facade/, 'namespace HttpFs.Logging')" paket-files/logary/logary/src/Logary.Facade/Facade.fs}
end
task :paket_restore do
system 'Tools/paket.exe', 'restore', clr_command: true
end
desc 'restore all nugets as per the packages.config files'
task :restore => [:paket_bootstrap, :paket_restore, :paket_replace]
desc 'Perform full build'
build :compile => [:versioning, :restore, :assembly_info] do |b|
b.prop 'Configuration', Configuration
b.logging = 'normal'
b.sln = 'Http.fs.sln'
end
directory 'build/pkg'
desc 'package nugets - finds all projects and package them'
nugets_pack :create_nugets => ['build/pkg', :versioning, :compile] do |p|
p.configuration = Configuration
p.files = FileList['HttpFs/HttpFs.fsproj'].
exclude(/Tests/)
p.out = 'build/pkg'
p.exe = 'packages/NuGet.CommandLine/tools/NuGet.exe'
p.with_metadata do |m|
m.id = 'Http.fs'
m.title = 'Http.fs'
m.description = 'A simple, functional HTTP client library for F#'
m.authors = 'Grant Crofton, Henrik Feldt'
m.project_url = 'https://github.com/relentless/Http.fs'
m.version = ENV['NUGET_VERSION']
end
end
namespace :tests do
task :integration do
system 'packages/NUnit.Runners/tools/nunit-console.exe', '--noshadow', %W|
HttpFs.IntegrationTests/bin/#{Configuration}/HttpFs.IntegrationTests.dll|,
clr_command: true
end
task :unit do
system "HttpFs.UnitTests/bin/#{Configuration}/HttpFs.UnitTests.exe", clr_command: true
end
end
task :tests => [:compile, :'tests:unit', :'tests:integration']
task :default => [:tests, :create_nugets]
task :ensure_nuget_key do
raise 'missing env NUGET_KEY value' unless ENV['NUGET_KEY']
end
Albacore::Tasks::Release.new :release,
pkg_dir: 'build/pkg',
depend_on: [:tests, :create_nugets, :ensure_nuget_key],
nuget_exe: 'packages/NuGet.CommandLine/tools/NuGet.exe',
api_key: ENV['NUGET_KEY']