lib/core/project.rb in buildr-1.2.1 vs lib/core/project.rb in buildr-1.2.2
- old
+ new
@@ -302,14 +302,10 @@
# Get parent project, but do not invoke it's definition to prevent circular
# dependencies (it's being invoked right now, so calling project() will fail).
@parent = task(split[0...-1].join(":"))
raise "No parent project #{split[0...-1].join(":")}" unless @parent && Project === parent
end
- # We only need this because each task (and a project is a task) already has
- # a @base_dir variable (and base_dir method), and we want it lazily evaluated.
- # See all the logic that happens when we call base_dir.
- @base_dir = nil
end
# :call-seq:
# base_dir() => path
#
@@ -323,13 +319,13 @@
# /home/foo/ <-- base_directory of project "foo"
# /home/foo/Buildfile <-- builds "foo"
# /home/foo/bar <-- sub-project "foo:bar"
def base_dir()
if @base_dir.nil?
- if @parent
+ if parent
# For sub-project, a good default is a directory in the parent's base_dir,
# using the same name as the project.
- @base_dir = File.join(@parent.base_dir, name.split(":").last)
+ @base_dir = File.join(parent.base_dir, name.split(":").last)
else
# For top-level project, a good default is the directory where we found the Buildfile.
@base_dir = Dir.pwd
end
end