vic-buildr 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +42 -11
- data/Rakefile +5 -3
- data/_buildr +9 -31
- data/addon/buildr/cobertura.rb +5 -218
- data/addon/buildr/drb.rb +281 -0
- data/addon/buildr/emma.rb +5 -220
- data/addon/buildr/nailgun.rb +94 -686
- data/bin/buildr +0 -9
- data/buildr.gemspec +6 -6
- data/doc/images/favicon.png +0 -0
- data/doc/pages/contributing.textile +6 -4
- data/doc/pages/download.textile +11 -0
- data/doc/pages/extending.textile +2 -2
- data/doc/pages/getting_started.textile +4 -4
- data/doc/pages/index.textile +8 -11
- data/doc/pages/more_stuff.textile +50 -22
- data/doc/pages/packaging.textile +1 -1
- data/doc/pages/projects.textile +2 -2
- data/doc/pages/settings_profiles.textile +2 -2
- data/doc/pages/testing.textile +1 -1
- data/doc/pages/whats_new.textile +12 -0
- data/doc/site.haml +1 -0
- data/lib/buildr.rb +2 -4
- data/lib/buildr/core.rb +2 -0
- data/lib/buildr/core/application.rb +304 -149
- data/lib/buildr/core/checks.rb +3 -131
- data/lib/buildr/core/common.rb +0 -4
- data/lib/buildr/core/compile.rb +1 -7
- data/lib/buildr/core/environment.rb +0 -3
- data/lib/buildr/core/filter.rb +7 -3
- data/lib/buildr/core/generate.rb +50 -52
- data/lib/buildr/core/help.rb +2 -1
- data/lib/buildr/core/osx.rb +49 -0
- data/lib/buildr/core/progressbar.rb +1 -1
- data/lib/buildr/core/project.rb +7 -9
- data/lib/buildr/core/test.rb +4 -4
- data/lib/buildr/core/transports.rb +13 -30
- data/lib/buildr/core/util.rb +8 -3
- data/lib/buildr/groovy/bdd.rb +1 -0
- data/lib/buildr/groovy/compiler.rb +1 -1
- data/lib/buildr/ide/eclipse.rb +30 -20
- data/lib/buildr/ide/idea.rb +3 -2
- data/lib/buildr/ide/idea7x.rb +4 -2
- data/lib/buildr/java/ant.rb +1 -1
- data/lib/buildr/java/bdd.rb +9 -5
- data/lib/buildr/java/cobertura.rb +236 -0
- data/lib/buildr/java/commands.rb +2 -1
- data/lib/buildr/java/emma.rb +238 -0
- data/lib/buildr/java/jtestr_runner.rb.erb +2 -0
- data/lib/buildr/java/packaging.rb +6 -2
- data/lib/buildr/java/pom.rb +0 -4
- data/lib/buildr/java/test_result.rb +45 -15
- data/lib/buildr/java/tests.rb +14 -9
- data/lib/buildr/packaging.rb +5 -2
- data/lib/buildr/packaging/archive.rb +488 -0
- data/lib/buildr/packaging/artifact.rb +36 -7
- data/lib/buildr/packaging/artifact_namespace.rb +2 -2
- data/lib/buildr/packaging/gems.rb +3 -3
- data/lib/buildr/packaging/package.rb +1 -1
- data/lib/buildr/packaging/tar.rb +85 -3
- data/lib/buildr/packaging/version_requirement.rb +172 -0
- data/lib/buildr/packaging/zip.rb +24 -682
- data/lib/buildr/packaging/ziptask.rb +313 -0
- data/lib/buildr/scala/compiler.rb +1 -1
- data/lib/buildr/scala/tests.rb +2 -2
- data/rakelib/apache.rake +58 -8
- data/rakelib/package.rake +4 -1
- data/rakelib/rspec.rake +2 -2
- data/rakelib/rubyforge.rake +6 -3
- data/rakelib/scm.rake +1 -1
- data/rakelib/setup.rake +0 -5
- data/rakelib/stage.rake +4 -1
- data/spec/addon/drb_spec.rb +328 -0
- data/spec/core/application_spec.rb +29 -22
- data/spec/core/build_spec.rb +8 -0
- data/spec/core/checks_spec.rb +293 -311
- data/spec/core/common_spec.rb +8 -2
- data/spec/core/compile_spec.rb +17 -1
- data/spec/core/generate_spec.rb +33 -0
- data/spec/core/project_spec.rb +18 -10
- data/spec/core/test_spec.rb +24 -1
- data/spec/ide/eclipse_spec.rb +96 -28
- data/spec/java/ant.rb +5 -0
- data/spec/java/bdd_spec.rb +4 -4
- data/spec/{addon → java}/cobertura_spec.rb +3 -3
- data/spec/{addon → java}/emma_spec.rb +3 -3
- data/spec/java/java_spec.rb +9 -1
- data/spec/java/packaging_spec.rb +19 -2
- data/spec/{addon → java}/test_coverage_spec.rb +7 -1
- data/spec/java/tests_spec.rb +5 -0
- data/spec/packaging/archive_spec.rb +1 -1
- data/spec/{core → packaging}/artifact_namespace_spec.rb +2 -2
- data/spec/packaging/artifact_spec.rb +46 -5
- data/spec/packaging/packaging_spec.rb +1 -1
- data/spec/sandbox.rb +16 -14
- data/spec/spec_helpers.rb +26 -3
- metadata +20 -11
- data/lib/buildr/core/application_cli.rb +0 -139
data/lib/buildr/core/checks.rb
CHANGED
@@ -15,10 +15,7 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
require 'buildr/core/project'
|
18
|
-
|
19
|
-
#require 'test/unit'
|
20
|
-
require 'spec/matchers'
|
21
|
-
require 'spec/expectations'
|
18
|
+
autoload :Spec, 'spec'
|
22
19
|
|
23
20
|
|
24
21
|
module Buildr
|
@@ -118,8 +115,8 @@ module Buildr
|
|
118
115
|
# - All matchers defined by Buildr and RSpec.
|
119
116
|
klass = Class.new
|
120
117
|
klass.instance_eval do
|
121
|
-
context.class.instance_methods
|
122
|
-
define_method(method) { |*args| context.send(method, *args) }
|
118
|
+
context.class.instance_methods.each do |method|
|
119
|
+
define_method(method) { |*args| context.send(method, *args) } unless instance_methods.include?(method)
|
123
120
|
end
|
124
121
|
define_method(:it) { subject }
|
125
122
|
define_method(:description) { description }
|
@@ -252,131 +249,6 @@ module Rake #:nodoc:
|
|
252
249
|
end
|
253
250
|
|
254
251
|
|
255
|
-
module Zip #:nodoc:
|
256
|
-
class ZipEntry
|
257
|
-
|
258
|
-
# :call-seq:
|
259
|
-
# exist() => boolean
|
260
|
-
#
|
261
|
-
# Returns true if this entry exists.
|
262
|
-
def exist?()
|
263
|
-
Zip::ZipFile.open(zipfile) { |zip| zip.file.exist?(@name) }
|
264
|
-
end
|
265
|
-
|
266
|
-
# :call-seq:
|
267
|
-
# empty?() => boolean
|
268
|
-
#
|
269
|
-
# Returns true if this entry is empty.
|
270
|
-
def empty?()
|
271
|
-
Zip::ZipFile.open(zipfile) { |zip| zip.file.read(@name) }.empty?
|
272
|
-
end
|
273
|
-
|
274
|
-
# :call-seq:
|
275
|
-
# contain(patterns*) => boolean
|
276
|
-
#
|
277
|
-
# Returns true if this ZIP file entry matches against all the arguments. An argument may be
|
278
|
-
# a string or regular expression.
|
279
|
-
def contain?(*patterns)
|
280
|
-
content = Zip::ZipFile.open(zipfile) { |zip| zip.file.read(@name) }
|
281
|
-
patterns.map { |pattern| Regexp === pattern ? pattern : Regexp.new(Regexp.escape(pattern.to_s)) }.
|
282
|
-
all? { |pattern| content =~ pattern }
|
283
|
-
end
|
284
|
-
|
285
|
-
end
|
286
|
-
end
|
287
|
-
|
288
|
-
|
289
|
-
class Buildr::ArchiveTask
|
290
|
-
|
291
|
-
class Path #:nodoc:
|
292
|
-
|
293
|
-
# :call-seq:
|
294
|
-
# exist() => boolean
|
295
|
-
#
|
296
|
-
# Returns true if this path exists. This only works if the path has any entries in it,
|
297
|
-
# so exist on path happens to be the opposite of empty.
|
298
|
-
def exist?()
|
299
|
-
!entries.empty?
|
300
|
-
end
|
301
|
-
|
302
|
-
# :call-seq:
|
303
|
-
# empty?() => boolean
|
304
|
-
#
|
305
|
-
# Returns true if this path is empty (has no other entries inside).
|
306
|
-
def empty?()
|
307
|
-
entries.all? { |entry| entry.empty? }
|
308
|
-
end
|
309
|
-
|
310
|
-
# :call-seq:
|
311
|
-
# contain(file*) => boolean
|
312
|
-
#
|
313
|
-
# Returns true if this ZIP file path contains all the specified files. You can use relative
|
314
|
-
# file names and glob patterns (using *, **, etc).
|
315
|
-
def contain?(*files)
|
316
|
-
files.all? { |file| entries.detect { |entry| File.fnmatch(file, entry.to_s, File::FNM_PATHNAME) } }
|
317
|
-
end
|
318
|
-
|
319
|
-
# :call-seq:
|
320
|
-
# entry(name) => ZipEntry
|
321
|
-
#
|
322
|
-
# Returns a ZIP file entry. You can use this to check if the entry exists and its contents,
|
323
|
-
# for example:
|
324
|
-
# package(:jar).path("META-INF").entry("LICENSE").should contain(/Apache Software License/)
|
325
|
-
def entry(name)
|
326
|
-
root.entry("#{@path}#{name}")
|
327
|
-
end
|
328
|
-
|
329
|
-
protected
|
330
|
-
|
331
|
-
def entries() #:nodoc:
|
332
|
-
return root.entries unless @path
|
333
|
-
@entries ||= root.entries.inject([]) { |selected, entry|
|
334
|
-
selected << entry.name.sub(@path, "") if entry.name.index(@path) == 0
|
335
|
-
selected
|
336
|
-
}
|
337
|
-
end
|
338
|
-
|
339
|
-
end
|
340
|
-
|
341
|
-
# :call-seq:
|
342
|
-
# empty?() => boolean
|
343
|
-
#
|
344
|
-
# Returns true if this ZIP file is empty (has no other entries inside).
|
345
|
-
def empty?()
|
346
|
-
path("").empty
|
347
|
-
end
|
348
|
-
|
349
|
-
# :call-seq:
|
350
|
-
# contain(file*) => boolean
|
351
|
-
#
|
352
|
-
# Returns true if this ZIP file contains all the specified files. You can use absolute
|
353
|
-
# file names and glob patterns (using *, **, etc).
|
354
|
-
def contain?(*files)
|
355
|
-
path("").contain?(*files)
|
356
|
-
end
|
357
|
-
|
358
|
-
end
|
359
|
-
|
360
|
-
|
361
|
-
class Buildr::ZipTask #:nodoc:
|
362
|
-
|
363
|
-
# :call-seq:
|
364
|
-
# entry(name) => Entry
|
365
|
-
#
|
366
|
-
# Returns a ZIP file entry. You can use this to check if the entry exists and its contents,
|
367
|
-
# for example:
|
368
|
-
# package(:jar).entry("META-INF/LICENSE").should contain(/Apache Software License/)
|
369
|
-
def entry(entry_name)
|
370
|
-
::Zip::ZipEntry.new(name, entry_name)
|
371
|
-
end
|
372
|
-
|
373
|
-
def entries() #:nodoc:
|
374
|
-
@entries ||= Zip::ZipFile.open(name) { |zip| zip.entries }
|
375
|
-
end
|
376
|
-
|
377
|
-
end
|
378
|
-
|
379
|
-
|
380
252
|
class Buildr::Project
|
381
253
|
include Buildr::Checks
|
382
254
|
end
|
data/lib/buildr/core/common.rb
CHANGED
data/lib/buildr/core/compile.rb
CHANGED
@@ -407,7 +407,7 @@ module Buildr
|
|
407
407
|
@filter = Buildr::Filter.new
|
408
408
|
@filter.using Buildr.settings.profile['filter'] if Hash === Buildr.settings.profile['filter']
|
409
409
|
enhance do
|
410
|
-
|
410
|
+
target.invoke if target
|
411
411
|
end
|
412
412
|
end
|
413
413
|
|
@@ -490,12 +490,6 @@ module Buildr
|
|
490
490
|
end
|
491
491
|
|
492
492
|
after_define do |project|
|
493
|
-
# TODO: Is this necessary?
|
494
|
-
#if project.resources.target
|
495
|
-
# file project.resources.target.to_s=>project.resources do |task|
|
496
|
-
# mkpath task.name, :verbose=>false
|
497
|
-
# end
|
498
|
-
#end
|
499
493
|
if project.compile.target
|
500
494
|
# This comes last because the target path is set inside the project definition.
|
501
495
|
project.build project.compile.target
|
data/lib/buildr/core/filter.rb
CHANGED
@@ -13,6 +13,10 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
+
|
17
|
+
require 'erb'
|
18
|
+
|
19
|
+
|
16
20
|
module Buildr
|
17
21
|
|
18
22
|
# A filter knows how to copy files from one directory to another, applying mappings to the
|
@@ -165,19 +169,19 @@ module Buildr
|
|
165
169
|
reject { |file| @exclude.any? { |pattern| File.fnmatch(pattern, file, File::FNM_PATHNAME) } }
|
166
170
|
files.each do |file|
|
167
171
|
src, dest = File.expand_path(file, source), File.expand_path(file, target.to_s)
|
168
|
-
map[file] = src if !File.exist?(dest) || File.stat(src).mtime
|
172
|
+
map[file] = src if !File.exist?(dest) || File.stat(src).mtime >= File.stat(dest).mtime
|
169
173
|
end
|
170
174
|
map
|
171
175
|
end
|
172
176
|
|
173
|
-
mkpath target.to_s
|
177
|
+
mkpath target.to_s, :verbose=>Buildr.application.options.trace
|
174
178
|
return false if copy_map.empty?
|
175
179
|
|
176
180
|
verbose(Buildr.application.options.trace || false) do
|
177
181
|
copy_map.each do |path, source|
|
178
182
|
dest = File.expand_path(path, target.to_s)
|
179
183
|
if File.directory?(source)
|
180
|
-
mkpath dest
|
184
|
+
mkpath dest, :verbose=>false
|
181
185
|
else
|
182
186
|
mkpath File.dirname(dest)
|
183
187
|
if @mapper.mapper_type
|
data/lib/buildr/core/generate.rb
CHANGED
@@ -20,13 +20,13 @@ require 'buildr/java/pom'
|
|
20
20
|
module Buildr
|
21
21
|
module Generate #:nodoc:
|
22
22
|
|
23
|
-
task
|
23
|
+
task 'generate' do
|
24
24
|
script = nil
|
25
25
|
choose do |menu|
|
26
26
|
menu.header = "To use Buildr you need a buildfile. Do you want me to create one?"
|
27
27
|
|
28
|
-
menu.choice("From maven2 pom file") { script = Generate.from_maven2_pom(
|
29
|
-
menu.choice("From directory structure") { script = Generate.from_directory(
|
28
|
+
menu.choice("From maven2 pom file") { script = Generate.from_maven2_pom('pom.xml').join("\n") } if File.exists?("pom.xml")
|
29
|
+
menu.choice("From directory structure") { script = Generate.from_directory(Dir.pwd).join("\n") }
|
30
30
|
menu.choice("Skip") { }
|
31
31
|
end
|
32
32
|
|
@@ -39,60 +39,58 @@ module Buildr
|
|
39
39
|
|
40
40
|
class << self
|
41
41
|
|
42
|
-
|
43
42
|
HEADER = "# Generated by Buildr #{Buildr::VERSION}, change to your liking\n\n"
|
44
43
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
# Version number for this release
|
52
|
-
VERSION_NUMBER = "1.0.0"
|
53
|
-
#
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
script
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
Dir.chdir(dir) { script << from_directory.flatten.map { |line| " " + line } << "" }
|
44
|
+
def from_directory(path = Dir.pwd, root = true)
|
45
|
+
Dir.chdir(path) do
|
46
|
+
name = File.basename(path)
|
47
|
+
if root
|
48
|
+
script = HEADER.split("\n")
|
49
|
+
header = <<-EOF
|
50
|
+
# Version number for this release
|
51
|
+
VERSION_NUMBER = "1.0.0"
|
52
|
+
# Group identifier for your projects
|
53
|
+
GROUP = "#{name}"
|
54
|
+
COPYRIGHT = ""
|
55
|
+
|
56
|
+
# Specify Maven 2.0 remote repositories here, like this:
|
57
|
+
repositories.remote << "http://www.ibiblio.org/maven2/"
|
58
|
+
|
59
|
+
desc "The #{name.capitalize} project"
|
60
|
+
define "#{name}" do
|
61
|
+
|
62
|
+
project.version = VERSION_NUMBER
|
63
|
+
project.group = GROUP
|
64
|
+
manifest["Implementation-Vendor"] = COPYRIGHT
|
65
|
+
EOF
|
66
|
+
script += header.split("\n")
|
67
|
+
else
|
68
|
+
script = [ %{define "#{name}" do} ]
|
69
|
+
end
|
70
|
+
script << " compile.with # Add classpath dependencies" if File.exist?("src/main/java")
|
71
|
+
script << " resources" if File.exist?("src/main/resources")
|
72
|
+
script << " test.compile.with # Add classpath dependencies" if File.exist?("src/test/java")
|
73
|
+
script << " test.resources" if File.exist?("src/test/resources")
|
74
|
+
if File.exist?("src/main/webapp")
|
75
|
+
script << " package(:war)"
|
76
|
+
elsif File.exist?("src/main/java")
|
77
|
+
script << " package(:jar)"
|
78
|
+
end
|
79
|
+
dirs = FileList["*"].exclude("src", "target", "report").
|
80
|
+
select { |file| File.directory?(file) && File.exist?(File.join(file, "src")) }
|
81
|
+
unless dirs.empty?
|
82
|
+
script << ""
|
83
|
+
dirs.sort.each do |dir|
|
84
|
+
script << from_directory(dir, false).flatten.map { |line| " " + line } << ""
|
85
|
+
end
|
88
86
|
end
|
87
|
+
script << "end"
|
88
|
+
script.flatten
|
89
89
|
end
|
90
|
-
script << "end"
|
91
|
-
script.flatten
|
92
90
|
end
|
93
91
|
|
94
|
-
def from_maven2_pom(root =
|
95
|
-
pom = Buildr::POM.load(
|
92
|
+
def from_maven2_pom(path = 'pom.xml', root = true)
|
93
|
+
pom = Buildr::POM.load(path)
|
96
94
|
project = pom.project
|
97
95
|
|
98
96
|
artifactId = project['artifactId'].first
|
@@ -185,7 +183,7 @@ EOF
|
|
185
183
|
if modules
|
186
184
|
script << ""
|
187
185
|
modules.each do |mod|
|
188
|
-
|
186
|
+
script << from_maven2_pom(File.join(File.dirname(path), mod, 'pom.xml'), false).flatten.map { |line| " " + line } << ""
|
189
187
|
end
|
190
188
|
end
|
191
189
|
script << "end"
|
data/lib/buildr/core/help.rb
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
2
|
+
# of this software and associated documentation files (the "Software"), to deal
|
3
|
+
# in the Software without restriction, including without limitation the rights
|
4
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
5
|
+
# copies of the Software, and to permit persons to whom the Software is
|
6
|
+
# furnished to do so, subject to the following conditions:
|
7
|
+
#
|
8
|
+
# The above copyright notice and this permission notice shall be included in
|
9
|
+
# all copies or substantial portions of the Software.
|
10
|
+
#
|
11
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
12
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
13
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
14
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
15
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
16
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
17
|
+
# SOFTWARE.
|
18
|
+
|
19
|
+
|
20
|
+
# Let's see if we can use Growl. Must be running from console in verbose mode.
|
21
|
+
if $stdout.isatty && verbose
|
22
|
+
notify = lambda do |type, title, message|
|
23
|
+
begin
|
24
|
+
# Loading Ruby Cocoa can slow the build down (hooks on Object class), so we're
|
25
|
+
# saving the best for last and only requiring it at the very end.
|
26
|
+
require 'osx/cocoa'
|
27
|
+
icon = OSX::NSApplication.sharedApplication.applicationIconImage
|
28
|
+
icon = OSX::NSImage.alloc.initWithContentsOfFile(File.join(File.dirname(__FILE__), '../resources/buildr.icns'))
|
29
|
+
|
30
|
+
# Register with Growl, that way you can turn notifications on/off from system preferences.
|
31
|
+
OSX::NSDistributedNotificationCenter.defaultCenter.
|
32
|
+
postNotificationName_object_userInfo_deliverImmediately(:GrowlApplicationRegistrationNotification, nil,
|
33
|
+
{ :ApplicationName=>'Buildr', :AllNotifications=>['Completed', 'Failed'],
|
34
|
+
:ApplicationIcon=>icon.TIFFRepresentation }, true)
|
35
|
+
|
36
|
+
OSX::NSDistributedNotificationCenter.defaultCenter.
|
37
|
+
postNotificationName_object_userInfo_deliverImmediately(:GrowlNotification, nil,
|
38
|
+
{ :ApplicationName=>'Buildr', :NotificationName=>type,
|
39
|
+
:NotificationTitle=>title, :NotificationDescription=>message }, true)
|
40
|
+
rescue Exception
|
41
|
+
# We get here in two cases: system doesn't have Growl installed so one of the OSX
|
42
|
+
# calls raises an exception; system doesn't have osx/cocoa, e.g. MacPorts Ruby 1.9,
|
43
|
+
# so we also need to rescue LoadError.
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
Buildr.application.on_completion { |title, message| notify['Completed', title, message] if verbose }
|
48
|
+
Buildr.application.on_failure { |title, message, ex| notify['Failed', title, message] if verbose }
|
49
|
+
end
|
data/lib/buildr/core/project.rb
CHANGED
@@ -240,18 +240,19 @@ module Buildr
|
|
240
240
|
rake_check_options options, :scope if options
|
241
241
|
raise ArgumentError, 'Only one project name at a time' unless args.size == 1
|
242
242
|
@projects ||= {}
|
243
|
-
name = args.first
|
243
|
+
name = args.first.to_s
|
244
|
+
# Make sure parent project is evaluated (e.g. if looking for foo:bar, find foo first)
|
245
|
+
unless @projects[name]
|
246
|
+
parts = name.split(':')
|
247
|
+
project(parts.first, options || {}) if parts.size > 1
|
248
|
+
end
|
244
249
|
if options && options[:scope]
|
245
250
|
# We assume parent project is evaluated.
|
246
251
|
project = options[:scope].split(':').inject([[]]) { |scopes, scope| scopes << (scopes.last + [scope]) }.
|
247
252
|
map { |scope| @projects[(scope + [name]).join(':')] }.
|
248
253
|
select { |project| project }.last
|
249
254
|
end
|
250
|
-
|
251
|
-
# Parent project not evaluated.
|
252
|
-
name.split(':').tap { |parts| @projects[parts.first].invoke if parts.size > 1 }
|
253
|
-
project = @projects[name]
|
254
|
-
end
|
255
|
+
project ||= @projects[name] # Not found in scope.
|
255
256
|
raise "No such project #{name}" unless project
|
256
257
|
project.invoke
|
257
258
|
project
|
@@ -864,9 +865,6 @@ module Buildr
|
|
864
865
|
# Forces all the projects to be evaluated before executing any other task.
|
865
866
|
# If we don't do that, we don't get to have tasks available when running Rake.
|
866
867
|
namespace 'buildr' do
|
867
|
-
task 'initialize' do
|
868
|
-
projects
|
869
|
-
end
|
870
868
|
|
871
869
|
desc "Freeze the Buildfile so it always uses Buildr version #{Buildr::VERSION}"
|
872
870
|
task 'freeze' do
|