albacore 2.0.0.rc.9 → 2.0.0.rc.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
1
  require 'rake'
2
+ require 'time'
2
3
 
3
4
  module Albacore
4
5
  class Application
@@ -31,7 +31,9 @@ module Albacore
31
31
  end
32
32
  Albacore.subscribe :build_version do |version|
33
33
  # tell teamcity our decision
34
- ::Albacore.puts "##teamcity[buildNumber '#{version.build_number}']"
34
+ ::Albacore.puts "##teamcity[buildNumber '#{version.build_number}']" # available as 'build.number' in TC
35
+ ::Albacore.puts "##teamcity[setParameter name='build.version' value='#{version.build_version}']"
36
+ ::Albacore.puts "##teamcity[setParameter name='build.version.formal' value='#{version.formal_version}']"
35
37
  end
36
38
  Albacore.subscribe :progress do |p|
37
39
  # tell teamcity of our progress
@@ -1,4 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ require 'albacore/logging'
2
3
  require 'albacore/package'
3
4
 
4
5
  module Albacore
@@ -1,12 +1,63 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  require 'rake'
4
+ require 'pathname'
5
+
4
6
  require 'albacore/albacore_module'
5
7
  require 'albacore/logging'
6
- require 'pathname'
7
8
 
8
9
  # module methods for handling paths
9
- module Albacore::Paths
10
+ module Paths
11
+ extend self
12
+
13
+ # returns the operating system separator character as a string
14
+ def separator
15
+ ::Albacore.windows? ? '\\' : '/'
16
+ end
17
+
18
+ # normalize the slashes of the path to what the operating system prefers
19
+ def normalise_slashes path
20
+ return path unless path.respond_to? :gsub
21
+ raise ArgumentError, "path is nil" if path.nil?
22
+ ::Rake::Win32.windows? ? path.gsub('/', '\\') : path.gsub('\\', '/')
23
+ end
24
+
25
+ # make a single string-command from a given executable string, by quoting each parameter
26
+ # individually. You can also use Albacore::CrossPlatformCmd#system given an array
27
+ # of 'stringly' things.
28
+ def make_command executable, parameters
29
+ raise ArgumentError, "executable is nil" if executable.nil?
30
+ params = parameters.collect{|p| '"' + p + '"'}.join ' '
31
+ exe = normalise_slashes executable
32
+ %Q{"#{exe}" #{params}}
33
+ end
34
+
35
+ # normalise slashes in an executable/parameters combo
36
+ def normalise executable, parameters
37
+ raise ArgumentError, "executable is nil" if executable.nil?
38
+ parameters = parameters.collect{ |p| (p === String) ? p : p.to_s }
39
+ exe = normalise_slashes executable
40
+ ["#{exe}", parameters]
41
+ end
42
+
43
+ # join an Enumerable of paths by normalising slashes on each of the segments, then
44
+ # joining them
45
+ def join *paths
46
+ raise ArgumentError, 'no paths given' if paths.nil?
47
+
48
+ joined = paths[1..-1].inject(PathnameWrap.new(normalise_slashes(paths[0]))) do |s, t|
49
+ s + normalise_slashes(t)
50
+ end
51
+
52
+ PathnameWrap.new joined
53
+ end
54
+
55
+ # join an Enumerable of paths by normalising slashes on each of the segments, then
56
+ # joining them, returning a string
57
+ def join_str *paths
58
+ join(*paths).to_s
59
+ end
60
+
10
61
  class PathnameWrap
11
62
  include ::Albacore::Logging
12
63
 
@@ -36,7 +87,7 @@ module Albacore::Paths
36
87
  end
37
88
 
38
89
  def to_s
39
- Paths.normalise_slashes p
90
+ ::Albacore::Paths.normalise_slashes p
40
91
  end
41
92
 
42
93
  def ==(o)
@@ -55,59 +106,9 @@ module Albacore::Paths
55
106
  to_s.gsub /\\/, '/'
56
107
  end
57
108
  end
58
-
59
- class << self
60
-
61
- # returns the operating system separator character as a string
62
- def separator
63
- ::Albacore.windows? ? '\\' : '/'
64
- end
65
-
66
- # normalize the slashes of the path to what the operating system prefers
67
- def normalise_slashes path
68
- return path unless path.respond_to? :gsub
69
- raise ArgumentError, "path is nil" if path.nil?
70
- ::Rake::Win32.windows? ? path.gsub('/', '\\') : path.gsub('\\', '/')
71
- end
72
-
73
- # make a single string-command from a given executable string, by quoting each parameter
74
- # individually. You can also use Albacore::CrossPlatformCmd#system given an array
75
- # of 'stringly' things.
76
- def make_command executable, parameters
77
- raise ArgumentError, "executable is nil" if executable.nil?
78
- params = parameters.collect{|p| '"' + p + '"'}.join ' '
79
- exe = normalise_slashes executable
80
- %Q{"#{exe}" #{params}}
81
- end
82
-
83
- # normalise slashes in an executable/parameters combo
84
- def normalise executable, parameters
85
- raise ArgumentError, "executable is nil" if executable.nil?
86
- parameters = parameters.collect{ |p| (p === String) ? p : p.to_s }
87
- exe = normalise_slashes executable
88
- ["#{exe}", parameters]
89
- end
90
-
91
- # join an Enumerable of paths by normalising slashes on each of the segments, then
92
- # joining them
93
- def join *paths
94
- raise ArgumentError, 'no paths given' if paths.nil?
95
-
96
- joined = paths[1..-1].inject(PathnameWrap.new(normalise_slashes(paths[0]))) do |s, t|
97
- s + normalise_slashes(t)
98
- end
99
-
100
- PathnameWrap.new joined
101
- end
102
-
103
- # join an Enumerable of paths by normalising slashes on each of the segments, then
104
- # joining them, returning a string
105
- def join_str *paths
106
- join(*paths).to_s
107
- end
108
- end
109
109
  end
110
110
 
111
111
  # Paths should be accessible if you require this file
112
- self.include Albacore
113
-
112
+ module Albacore::Paths
113
+ self.extend ::Paths
114
+ end
@@ -7,14 +7,14 @@ module ::Rake
7
7
 
8
8
  # get the original dir that rake was called from as a string
9
9
  def albacore_original_dir *args
10
- ::Albacore::Paths::PathnameWrap.new(old_original_dir(*args)).to_s
10
+ ::Paths::PathnameWrap.new(old_original_dir(*args)).to_s
11
11
  end
12
12
 
13
13
  alias_method :original_dir, :albacore_original_dir
14
14
 
15
15
  # get the original dir that rake was called from a Pathname
16
16
  def original_dir_path
17
- ::Albacore::Paths::PathnameWrap.new(old_original_dir())
17
+ ::Paths::PathnameWrap.new(old_original_dir())
18
18
  end
19
19
  end
20
20
  end
@@ -87,6 +87,8 @@ module Albacore
87
87
  end
88
88
  def handle_directory dll, exe, &block
89
89
  if @opts.get(:copy_local)
90
+ # TODO: #mktmpdir is not always reliable; consider contributing a patch to ruby?
91
+ # Fails sometimes with "directory already exists"
90
92
  Dir.mktmpdir 'alba-test' do |dir|
91
93
  sut, runners = Paths.join(dir, 'sut').to_s, Paths.join(dir, 'runners').to_s
92
94
  [sut, runners].each { |d| FileUtils.mkdir_p d }
@@ -1,3 +1,3 @@
1
1
  module Albacore
2
- VERSION = "2.0.0.rc.9"
2
+ VERSION = "2.0.0.rc.10"
3
3
  end
@@ -2,7 +2,7 @@ require 'albacore/package_repo'
2
2
 
3
3
  describe ::Albacore::PackageRepo do
4
4
  subject do
5
- PackageRepo.new '.'
5
+ Albacore::PackageRepo.new '.'
6
6
  end
7
7
  it 'can find latest amongst a number of packages in the repo' do
8
8
  should respond_to(:find_latest)
data/spec/package_spec.rb CHANGED
@@ -2,7 +2,7 @@ require 'albacore/package'
2
2
 
3
3
  describe ::Albacore::Package do
4
4
  subject do
5
- Package.new 'NLog', 'path/to/asm.dll'
5
+ Albacore::Package.new 'NLog', 'path/to/asm.dll'
6
6
  end
7
7
  it do
8
8
  should respond_to :id
data/spec/paths_spec.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'albacore/paths'
2
2
 
3
- describe ::Albacore::Paths.method(:join), 'when joining path segments' do
3
+ describe Paths.method(:join), 'when joining path segments' do
4
4
  let :s do
5
5
  Paths.separator
6
6
  end
@@ -81,7 +81,7 @@ describe ::Albacore::Paths.method(:join), 'when joining path segments' do
81
81
  end
82
82
  end
83
83
 
84
- describe ::Albacore::Paths.method(:join_str), 'when joining path segments' do
84
+ describe Paths.method(:join_str), 'when joining path segments' do
85
85
  let :s do
86
86
  Paths.separator
87
87
  end
data/spec/project_spec.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'spec_helper'
2
2
  require 'albacore/semver'
3
3
  require 'albacore/project'
4
+ require 'albacore/paths'
4
5
 
5
6
  describe Albacore::Project, "when loading packages.config" do
6
7
  subject do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: albacore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc.9
4
+ version: 2.0.0.rc.10
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-03-11 00:00:00.000000000 Z
13
+ date: 2014-04-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -317,7 +317,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
317
317
  version: '0'
318
318
  segments:
319
319
  - 0
320
- hash: -3459761293197322545
320
+ hash: 996579621817901824
321
321
  required_rubygems_version: !ruby/object:Gem::Requirement
322
322
  none: false
323
323
  requirements:
@@ -326,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
326
  version: 1.3.1
327
327
  requirements: []
328
328
  rubyforge_project: albacore
329
- rubygems_version: 1.8.23
329
+ rubygems_version: 1.8.23.2
330
330
  signing_key:
331
331
  specification_version: 3
332
332
  summary: Dolphin-safe and awesome Mono and .Net Rake-tasks