buildr 1.2.4 → 1.2.5

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/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 1.2.5 (8/13/2007)
2
+ * Fixed: Buildr not finding buildfile in parent directory, or switching to parent directory.
3
+ * Fixed: checks.rb:103: warning: multiple values for a block parameter (2 for 1)
4
+ * Fixed: ZIPs include empty META-INF directory.
5
+
1
6
  1.2.4 (8/3/2007)
2
7
  * Added: Forking option for JUnit test framework: :once to fork for each project, :each to fork for each test case, and false to not fork. (Tammo van Lessen)
3
8
  * Added: Path traversal in Zip, so zip.path("foo/bar").path("..") returns zip.path("foo").
@@ -24,9 +24,10 @@ require "builder"
24
24
 
25
25
 
26
26
  module Buildr
27
- VERSION = "1.2.4".freeze # unless const_defined?(:VERSION)
27
+ VERSION = "1.2.5".freeze # unless const_defined?(:VERSION)
28
28
  end
29
29
 
30
+
30
31
  # Now it's safe to load Buildr, after we set up the Rake Application.
31
32
  require "core/application"
32
33
  require "core/project"
@@ -55,6 +56,3 @@ class Object #:nodoc:
55
56
  end
56
57
  # Project has visibility to everything in the Buildr namespace. (See above for constants)
57
58
  class Project ; include Buildr ; end
58
-
59
- # Load .rake files form tasks directory, and buildr.rb files.
60
- Buildr.load_tasks_and_local_files
@@ -3,7 +3,10 @@ module Buildr
3
3
  # When running from +rake+, we already have an Application setup and must plug into it,
4
4
  # since the top-level tasks come from there. When running from +buildr+, we get to load
5
5
  # Rake and set everything up, and we use our own Application full of cool Buildr features.
6
- unless defined?(Rake)
6
+ if defined?(Rake)
7
+ Rake.application.top_level_tasks.unshift task("buildr:initialize")
8
+ else
9
+
7
10
  require "rake"
8
11
 
9
12
  class Application < Rake::Application #:nodoc:
@@ -41,6 +44,7 @@ module Buildr
41
44
  opts = GetoptLong.new(*command_line_options)
42
45
  opts.each { |opt, value| do_option(opt, value) }
43
46
  collect_tasks
47
+ top_level_tasks.unshift "buildr:initialize"
44
48
  end
45
49
 
46
50
  def run()
@@ -65,7 +69,6 @@ module Buildr
65
69
  when "--freeze"
66
70
  find_buildfile
67
71
  puts "Freezing the Buildfile so it always uses Buildr version #{Buildr::VERSION}"
68
- gem =
69
72
  original = File.read(rakefile)
70
73
  if original =~ /gem\s*(["'])buildr\1/
71
74
  modified = original.sub(/gem\s*(["'])buildr\1\s*,\s*(["']).*\2/, %{gem "buildr", "#{Buildr::VERSION}"})
@@ -88,20 +91,19 @@ module Buildr
88
91
  end
89
92
 
90
93
  def find_buildfile()
91
- unless have_rakefile
92
- here = Dir.pwd
93
- Dir.chdir("..") do
94
- if Dir.pwd == here || options.nosearch
95
- error = "No Buildfile found (looking for: #{@rakefiles.join(', ')})"
96
- if STDIN.isatty
97
- chdir(original_dir) { task("generate").invoke }
98
- exit 1
99
- else
100
- raise error
101
- end
94
+ here = Dir.pwd
95
+ while ! have_rakefile
96
+ Dir.chdir("..")
97
+ if Dir.pwd == here || options.nosearch
98
+ error = "No Buildfile found (looking for: #{@rakefiles.join(', ')})"
99
+ if STDIN.isatty
100
+ chdir(original_dir) { task("generate").invoke }
101
+ exit 1
102
+ else
103
+ raise error
102
104
  end
103
- find_buildfile
104
105
  end
106
+ here = Dir.pwd
105
107
  end
106
108
  end
107
109
 
@@ -143,7 +145,6 @@ module Buildr
143
145
  end
144
146
 
145
147
  Rake.application = Buildr::Application.new
146
-
147
148
  end
148
149
 
149
150
 
@@ -176,5 +177,10 @@ module Buildr
176
177
  [Rake.application.rakefile].compact + @build_files
177
178
  end
178
179
 
180
+ task "buildr:initialize" do
181
+ Buildr.load_tasks_and_local_files
182
+ end
183
+
179
184
  end
185
+
180
186
  end
@@ -100,7 +100,7 @@ module Buildr
100
100
  klass = Class.new
101
101
  klass.instance_eval do
102
102
  context.class.instance_methods(false).each do |method|
103
- define_method(method) { |args| context.send(method, args) }
103
+ define_method(method) { |*args| context.send(method, *args) }
104
104
  end
105
105
  define_method(:it) { subject }
106
106
  define_method(:description) { description }
@@ -628,7 +628,8 @@ module Buildr
628
628
 
629
629
  # Forces all the projects to be evaluated before executing any other task.
630
630
  # If we don't do that, we don't get to have tasks available when running Rake.
631
- task("buildr:projects") { projects }
632
- Rake.application.top_level_tasks.unshift "buildr:projects"
631
+ task "buildr:initialize" do
632
+ projects
633
+ end
633
634
 
634
635
  end
@@ -38,10 +38,9 @@ module Buildr
38
38
  @manifest = false
39
39
  @meta_inf = []
40
40
 
41
- meta_inf_path = path("META-INF")
42
41
  prepare do
43
42
  @prerequisites << manifest if String === manifest || Rake::Task === manifest
44
- [meta_inf].flatten.map { |file| file.to_s }.uniq.each { |file| meta_inf_path.include file }
43
+ [meta_inf].flatten.map { |file| file.to_s }.uniq.each { |file| path("META-INF").include file }
45
44
  end
46
45
 
47
46
  enhance do
@@ -52,24 +51,7 @@ module Buildr
52
51
  lines = String === manifest || Rake::Task === manifest ? manifest_lines_from(File.read(manifest.to_s)) :
53
52
  manifest_lines_from(manifest)
54
53
  @manifest_tmp.write((MANIFEST_HEADER + lines).join("\n"))
55
- =begin
56
- @manifest_tmp.write MANIFEST_HEADER
57
- case manifest
58
- when Hash
59
- @manifest_tmp.write(manifest.map { |pair| pair.map{ |s| s.to_s }.join(": ") }.sort.join("\n") << "\n")
60
- when Array
61
- @manifest_tmp.write(manifest.reject { |section| section.empty? }.map { |section|
62
- section.map { |pair| pair.join(": ") }.sort.join("\n").concat("\n")
63
- }.join("\n") << "\n")
64
- when Proc, Method
65
- @manifest_tmp.write manifest.call
66
- when String, Rake::Task
67
- @manifest_tmp.write File.read(manifest.to_s)
68
- else
69
- fail "Invalid manifest, expecting Hash, Array, file name/task or proc/method."
70
- end
71
- =end
72
- meta_inf_path.include @manifest_tmp.path, :as=>"MANIFEST.MF"
54
+ path("META-INF").include @manifest_tmp.path, :as=>"MANIFEST.MF"
73
55
  end
74
56
  end
75
57
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: buildr
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.2.4
7
- date: 2007-08-03 00:00:00 -07:00
6
+ version: 1.2.5
7
+ date: 2007-08-13 00:00:00 -07:00
8
8
  summary: A build system that doesn't suck
9
9
  require_paths:
10
10
  - lib