1
1
require 'fileutils'
2
2
require 'albacore'
3
- require './tools/albacore/nuspec_patch'
4
3
5
4
NH_VERSION = '4.x'
6
5
6
+ # Albacore.configure do |config|
7
+ # config.log_level = :verbose
8
+ # end
9
+
7
10
module Platform
8
11
9
12
def self.is_nix
@@ -30,7 +33,7 @@ def get_version
30
33
ENV['BUILD_NUMBER'] || '1.4.0.0'
31
34
end
32
35
33
- task :default => ['ripple', 'build:all']
36
+ task :default => ['ripple:update', 'source:update_version ', 'build:all']
34
37
35
38
namespace :ci do
36
39
task :run_ci_build => [
@@ -40,24 +43,30 @@ namespace :ci do
40
43
]
41
44
end
42
45
43
- task :ripple do
44
- ripple = Platform.runtime("buildsupport/ripple.exe")
45
- args = "restore"
46
- sh "#{ripple} #{args}"
46
+ namespace :ripple do
47
+ desc 'Restores NuGet package binaries'
48
+ task :update do |cmd|
49
+ ripple = Platform.runtime("buildsupport/ripple.exe")
50
+ args = "restore"
51
+ sh "#{ripple} #{args}"
52
+ end
47
53
end
48
54
49
55
namespace :source do
50
56
desc 'Update assembly info with latest version number'
51
- assemblyinfo :update_version do |asm|
52
- asm.output_file = 'src/CommonAssemblyInfo.cs'
57
+ assemblyinfo :update_version do |info|
58
+ info.output_file = 'src/CommonAssemblyInfo.cs'
59
+
60
+ commit_hash = `git log -1 --format="%H%"`
53
61
54
- asm.version = get_version
55
- asm.company_name = 'http://fluentnhibernate.org'
56
- asm.product_name = 'FluentNHibernate'
57
- asm.copyright = "Copyright 2008-#{Time.new.year} James Gregory and contributors (Paul Batum, Hudson Akridge et al). All rights reserved."
58
- asm.namespaces = ['System.Security']
62
+ info.version = info.file_version = get_version
63
+ info.company_name = 'http://fluentnhibernate.org'
64
+ info.product_name = 'FluentNHibernate'
65
+ info.description = commit_hash[0..(commit_hash.length - 3)]
66
+ info.copyright = "Copyright 2008-#{Time.new.year} James Gregory and contributors (Paul Batum, Hudson Akridge et al). All rights reserved."
67
+ info.namespaces = ['System.Security']
59
68
60
- puts "The build number is #{asm .version}"
69
+ puts "The new build number is #{info .version}"
61
70
end
62
71
63
72
task :nhibernate_version, :nhibernate_version do |t,args|
@@ -70,15 +79,17 @@ namespace :source do
70
79
71
80
nh_version_precompiler_switch = 'NH' + args.nhibernate_version.gsub('.', '')
72
81
73
- puts nh_version_precompiler_switch
82
+ puts 'Precompiler switch: ' + nh_version_precompiler_switch
74
83
75
84
msb.properties = {
76
85
configuration: :Release,
77
86
DefineConstants: nh_version_precompiler_switch,
78
- WarningLevel: 0,
87
+ WarningLevel: 0
79
88
}
80
89
msb.targets [:Clean, :Build]
81
90
msb.solution = 'src/FluentNHibernate.sln'
91
+ msb.verbosity = :minimal
92
+ msb.parameters = ["/p:TargetFrameworkVersion=v4.0"]
82
93
end
83
94
end
84
95
@@ -96,6 +107,7 @@ namespace :specs do
96
107
nunit :nunit do |nunit|
97
108
nunit.command = 'src/packages/NUnit.2.5.7.10213/Tools/nunit-console-x86.exe'
98
109
nunit.assemblies 'src/FluentNHibernate.Testing/bin/Release/FluentNHibernate.Testing.dll'
110
+ nunit.parameters = [ "/framework:net-4.0" ]
99
111
end
100
112
end
101
113
@@ -158,7 +170,7 @@ namespace :package do
158
170
zip.output_path = 'dist'
159
171
end
160
172
161
- nuspec do |nu|
173
+ nuspec do |nu|
162
174
nu.id = 'FluentNHibernate'
163
175
nu.version = get_version()
164
176
nu.authors = 'James Gregory and contributors'
@@ -167,23 +179,25 @@ namespace :package do
167
179
nu.language = 'en-US'
168
180
nu.licenseUrl = 'http://github.com/jagregory/fluent-nhibernate/raw/master/LICENSE.txt'
169
181
nu.projectUrl = 'http://fluentnhibernate.org'
170
- nu.dependency 'NHibernate', '[3.3.1.4000, 4.0) '
171
- nu.working_directory = 'build'
182
+ nu.dependency 'NHibernate', '4.0'
183
+ nu.working_directory = Dir.pwd
172
184
nu.output_file = 'fluentnhibernate.nuspec'
173
- nu.file 'FluentNHibernate.dll', 'lib'
174
- nu.file 'FluentNHibernate.xml', 'lib'
185
+ nu.file 'FluentNHibernate.dll', 'lib/net40'
186
+ nu.file 'FluentNHibernate.pdb', 'lib/net40'
187
+ nu.file 'FluentNHibernate.xml', 'lib/net40'
175
188
nu.tags = 'orm dal nhibernate conventions'
189
+ nu.pretty_formatting = true
176
190
end
177
-
191
+
178
192
nugetpack do |nu|
179
193
nu.command = 'tools/nuget/NuGet.exe'
180
- nu.nuspec = 'build/fluentnhibernate .nuspec'
181
- nu.base_folder = 'build '
194
+ nu.nuspec = 'src/FluentNHibernate .nuspec'
195
+ nu.base_folder = 'Release '
182
196
nu.output = 'dist'
183
197
end
184
198
185
199
desc 'Create nuget spec and package'
186
- task :nuget => [:nuspec, : nugetpack]
200
+ task :nuget => [:nugetpack]
187
201
188
202
desc 'Package everything (src, bin, docs, nuget)'
189
203
task :all => [:source, :binaries, :docs, :nuget]
0 commit comments