@@ -7,7 +7,6 @@ PROPS = 'src/CommonAssemblyInfo.cs'
7
7
SLN = 'src/FluentNHibernate.sln'
8
8
CONFIG = 'config.json'
9
9
NUSPEC = 'src/FluentNHibernate.nuspec'
10
- CLR_TOOLS_VERSION = "v4.0.30319"
11
10
12
11
module Platform
13
12
@@ -33,16 +32,14 @@ module Platform
33
32
JSON.parse(File.read(CONFIG))
34
33
end
35
34
36
- def self.update_config_version(arg)
37
- current = self.config
38
- current['assembly_info']['version'] = current['nuspec']['version'] = arg
39
- File.write(CONFIG, JSON.pretty_generate(current.to_json))
40
- end
41
-
42
35
end
43
36
44
37
NH_VERSION = Platform.config['build']['nh_precompiler_switch']
45
38
39
+ # Albacore.configure do |config|
40
+ # config.log_level = :verbose
41
+ # end
42
+
46
43
def get_version
47
44
ENV['BUILD_NUMBER'] || Platform.config['default_version_number']
48
45
end
@@ -60,18 +57,17 @@ namespace :ripple do
60
57
args = "restore"
61
58
sh "#{ripple} #{args}"
62
59
end
60
+ task :run_ci_build => ['ripple:restore', 'build:all', 'docs:build', 'package:all' ]
63
61
end
64
62
65
63
namespace :source do
66
64
desc 'Update assembly info with latest version number'
67
65
assemblyinfo :update_version do |info|
68
66
info.output_file = PROPS
69
-
70
- commit_hash = `git log -1 --format="%H%"`
71
67
72
68
info.title = Platform.config['assembly_info']['title']
73
- info.version = info.file_version = get_version
74
- info.informational_version = Platform.config['version']
69
+ info.version = get_version
70
+ info.informational_version = Platform.config['assembly_info'][' version']
75
71
info.company_name = 'http://fluentnhibernate.org'
76
72
info.product_name = 'FluentNHibernate'
77
73
info.description = commit_hash[0..(commit_hash.length - 3)]
@@ -109,7 +105,7 @@ namespace :source do
109
105
msbuild :msbuild, [:nhibernate_version] => :nhibernate_version do |msbuild, args|
110
106
msbuild.properties = {
111
107
configuration: :Release,
112
- DefineConstants: args[:nhibernate_version] ,
108
+ DefineConstants: nh_version_precompiler_switch ,
113
109
WarningLevel: 0
114
110
}
115
111
msbuild.targets [:Clean, :Build]
@@ -159,12 +155,23 @@ namespace :docs do
159
155
end
160
156
161
157
namespace :git do
158
+ desc "Tags the current release"
159
+ task :tag, :assembly_info do |asm, args|
160
+ args.with_defaults(:assembly_info => Platform.config['assembly_info']['version'])
161
+
162
+ sh "git tag \"v#{args.version}\""
163
+ end
164
+
162
165
desc "Updates the version and tags the release"
163
- task :prep_release do |task|
164
- current_version = Platform.config['assembly_info']['version']
165
- sh "git add -A"
166
- sh "git commit -m \"Updated version to #{current_version}\""
167
- sh "git tag \"v#{current_version}\""
166
+ task :prep_release, :assembly_info do |task, args|
167
+ if !args.version.nil?
168
+ task(:update_version).invoke(args.version)
169
+
170
+ sh "git add #{CONFIG} #{NUSPEC}"
171
+ sh "git commit -m \"Updated version to #{args.version}\""
172
+
173
+ task(:tag).invoke(args.version)
174
+ end
168
175
end
169
176
end
170
177
@@ -258,7 +265,7 @@ namespace :package do
258
265
desc 'Package everything (src, bin, docs, nuget)'
259
266
task :all => [:source, :binaries, :docs, :nuget]
260
267
end
261
-
268
+
262
269
def update_xml(xml_path)
263
270
#Open up the xml file
264
271
xml_file = File.new(xml_path)
0 commit comments