rake-dotnet 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +2 -6
- data/Rakefile.rb +1 -1
- data/lib/rake_dotnet.rb +18 -30
- metadata +4 -4
data/History.txt
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
=== 0.1.
|
1
|
+
=== 0.1.12 / 2009-08-29
|
2
2
|
|
3
|
-
FIX:
|
4
|
-
|
5
|
-
=== 0.1.10 / 2009-08-24
|
6
|
-
|
7
|
-
FIX: Svn: revision would return the last changed revision, not the actual revision number
|
3
|
+
FIX: Versioner: Cache the version number to a file, so CI can pull/push it and maintain same version number throughout CI pipeline stages
|
8
4
|
|
9
5
|
=== 0.1.9 / 2009-07-07
|
10
6
|
|
data/Rakefile.rb
CHANGED
@@ -5,7 +5,7 @@ require 'hoe'
|
|
5
5
|
require 'Pathname'
|
6
6
|
require 'rake/clean'
|
7
7
|
|
8
|
-
Hoe.new('rake-dotnet', '0.1.
|
8
|
+
Hoe.new('rake-dotnet', '0.1.12') do |p|
|
9
9
|
p.author = 'Peter Mounce'
|
10
10
|
p.description = 'Making a .NET build-automation dev\'s life easier, one angle-bracket at a time'
|
11
11
|
p.email = 'pete@neverrunwithscissors.com'
|
data/lib/rake_dotnet.rb
CHANGED
@@ -83,6 +83,7 @@ CLEAN.include("#{SRC_DIR}/**/obj")
|
|
83
83
|
CLEAN.include("#{SRC_DIR}/**/bin")
|
84
84
|
CLEAN.include("#{SRC_DIR}/**/AssemblyInfo.cs")
|
85
85
|
CLEAN.include("#{SRC_DIR}/**/AssemblyInfo.vb")
|
86
|
+
CLEAN.include('version.txt')
|
86
87
|
CLOBBER.include(OUT_DIR)
|
87
88
|
|
88
89
|
VERBOSE = ENV['VERBOSE'] ? ENV['VERBOSE'] : false
|
@@ -913,8 +914,7 @@ class SvnInfo < Svn
|
|
913
914
|
def revision
|
914
915
|
puts cmd if VERBOSE
|
915
916
|
out = `#{cmd}`
|
916
|
-
|
917
|
-
return rev
|
917
|
+
out.match(/Revision: (\d+)/)[1]
|
918
918
|
end
|
919
919
|
|
920
920
|
def path
|
@@ -925,53 +925,41 @@ end
|
|
925
925
|
|
926
926
|
class Versioner
|
927
927
|
def initialize(template_file=nil, opts={})
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
@bin_out = opts[:bin_out] || File.join(OUT_DIR, 'bin')
|
928
|
+
tf_path = template_file || 'version.template.txt'
|
929
|
+
@tf = Pathname.new(tf_path)
|
930
|
+
@vf = Pathname.new(tf_path.sub('.template', ''))
|
932
931
|
end
|
933
932
|
|
934
933
|
def get
|
935
|
-
|
934
|
+
return @vf.read.chomp if @vf.exist?
|
935
|
+
|
936
|
+
v = "#{maj_min}.#{build}.#{revision}"
|
937
|
+
@vf.open('w') {|f| f.write(v) }
|
938
|
+
|
939
|
+
return v
|
936
940
|
end
|
937
941
|
|
942
|
+
def maj_min
|
943
|
+
return @tf.read.chomp
|
944
|
+
end
|
945
|
+
|
938
946
|
def build
|
939
|
-
|
940
|
-
if ENV['TEAMCITY_BUILDCONF_NAME']
|
941
|
-
pb = get_from_previous_binaries('.*-v\d+\.\d+\.(\d+)\.\d+')
|
942
|
-
return pb unless pb.nil?# use a previous binaries-build if one exists
|
943
|
-
# otherwise use the current environment variable
|
944
|
-
bn = ENV['BUILD_NUMBER']
|
945
|
-
end
|
947
|
+
bn = ENV['BUILD_NUMBER']
|
946
948
|
return 0 if bn == nil || !bn.match(/\d+/)
|
947
949
|
return bn
|
948
950
|
end
|
949
951
|
|
950
952
|
def revision
|
951
953
|
if (Pathname.new('.svn').exist?)
|
952
|
-
if ENV['TEAMCITY_BUILDCONF_NAME']
|
953
|
-
pb = get_from_previous_binaries('.*-v\d+\.\d+\.\d+\.(\d+)')
|
954
|
-
return pb unless pb.nil?
|
955
|
-
end
|
956
954
|
return SvnInfo.new(:path => '.').revision
|
957
955
|
else
|
956
|
+
# TODO: return something numeric but sane for non-numeric revision numbers (eg DVCSs)
|
958
957
|
return '0' # YYYYMMDD is actually invalid for a {revision} number.
|
959
958
|
end
|
960
959
|
end
|
961
|
-
|
962
|
-
def get_from_previous_binaries(regex)
|
963
|
-
fl = FileList.new("#{@bin_out}*")
|
964
|
-
fl.each do |e|
|
965
|
-
re = regexify(@bin_out)
|
966
|
-
unless e.match(/#{re}/).nil?
|
967
|
-
matches = e.match(/#{regex}/)
|
968
|
-
return matches[1] unless matches.nil?
|
969
|
-
end
|
970
|
-
end
|
971
|
-
return nil
|
972
|
-
end
|
973
960
|
end
|
974
961
|
|
962
|
+
RDNVERSION = Versioner.new.get
|
975
963
|
|
976
964
|
|
977
965
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-dotnet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter MouncePeter Mounce
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-29 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.11.0
|
34
34
|
version:
|
35
35
|
description: Making a .NET build-automation dev's life easier, one angle-bracket at a time
|
36
36
|
email: pete@neverrunwithscissors.compete@neverrunwithscissors.com
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
requirements: []
|
76
76
|
|
77
77
|
rubyforge_project: rake-dotnet
|
78
|
-
rubygems_version: 1.3.
|
78
|
+
rubygems_version: 1.3.4
|
79
79
|
signing_key:
|
80
80
|
specification_version: 3
|
81
81
|
summary: Build automation for .NET builds
|