You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by to...@apache.org on 2016/08/14 06:26:34 UTC

[1/3] buildr git commit: BUILDR-454: Definition-level parent-child references-by-name fail in 1.4.0 but not in 1.3.5

Repository: buildr
Updated Branches:
  refs/heads/master 24724f998 -> 2f1437922


BUILDR-454: Definition-level parent-child references-by-name fail in 1.4.0 but not in 1.3.5


Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/a850d8c9
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/a850d8c9
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/a850d8c9

Branch: refs/heads/master
Commit: a850d8c98bf32a5f8fe14e274155efdf822dcb45
Parents: 42a016d
Author: Antoine Toulme <an...@lunar-ocean.com>
Authored: Sat Aug 13 22:44:02 2016 -0700
Committer: Antoine Toulme <an...@lunar-ocean.com>
Committed: Sat Aug 13 22:44:02 2016 -0700

----------------------------------------------------------------------
 lib/buildr/core/project.rb | 15 ++++++++++++++-
 spec/core/project_spec.rb  | 17 +++++++++++------
 2 files changed, 25 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/a850d8c9/lib/buildr/core/project.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/core/project.rb b/lib/buildr/core/project.rb
index 1b34eb4..4511ae4 100644
--- a/lib/buildr/core/project.rb
+++ b/lib/buildr/core/project.rb
@@ -220,6 +220,11 @@ module Buildr #:nodoc:
           # Enhance the project using the definition block.
           project.enhance { project.instance_exec project, &block } if block
 
+          # Mark the project as defined
+          project.enhance do |project|
+            project.send :define!
+          end
+
           # Top-level project? Invoke the project definition. Sub-project? We don't invoke
           # the project definiton yet (allow project calls to establish order of evaluation),
           # but must do so before the parent project's definition is done.
@@ -253,7 +258,7 @@ module Buildr #:nodoc:
         end
         project ||= @projects[name] # Not found in scope.
         raise "No such project #{name}" unless project
-        project.invoke unless no_invoke || Buildr.application.current_scope.join(":").to_s == project.name.to_s
+        project.invoke unless  project.defined? || no_invoke || Buildr.application.current_scope.join(":").to_s == project.name.to_s
         project
       end
 
@@ -614,7 +619,15 @@ module Buildr #:nodoc:
       @calledback ||= {}
     end
 
+    def defined?
+      @defined
+    end
+
   protected
+    def define!
+      @defined = true
+    end
+    
 
     # :call-seq:
     #   base_dir = dir

http://git-wip-us.apache.org/repos/asf/buildr/blob/a850d8c9/spec/core/project_spec.rb
----------------------------------------------------------------------
diff --git a/spec/core/project_spec.rb b/spec/core/project_spec.rb
index 97bbf01..b9f591a 100644
--- a/spec/core/project_spec.rb
+++ b/spec/core/project_spec.rb
@@ -83,6 +83,16 @@ describe Project do
     Buildr.define('foo') { define('bar') { project('baz:bar') } }
     lambda { project('foo') }.should raise_error(RuntimeError, /Circular dependency/)
   end
+
+  it 'should handle non-circular dependencies' do
+    Buildr.define "root" do
+      define "child" do
+        puts project('root')._('foo.resource')
+      end
+    end
+
+    lambda { project('root') }.should_not raise_error
+  end
 end
 
 describe Project, ' property' do
@@ -533,7 +543,7 @@ describe Buildr, '#project' do
     project('foo:bar').project('baz').should be(project('foo:baz'))
   end
 
-  it 'should fine a project from its parent by proximity' do
+  it 'should find a project from its parent by proximity' do
     define 'foo' do
       define('bar') { define 'baz' }
       define 'baz'
@@ -542,11 +552,6 @@ describe Buildr, '#project' do
     project('foo:bar').project('baz').should be(project('foo:bar:baz'))
   end
 
-  it 'should invoke project before returning it' do
-    define('foo').should_receive(:invoke).once
-    project('foo')
-  end
-
   it 'should fail if called without a project name' do
     lambda { project }.should raise_error(ArgumentError)
   end


[3/3] buildr git commit: BUILDR-454 add changelog

Posted by to...@apache.org.
BUILDR-454 add changelog


Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/2f143792
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/2f143792
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/2f143792

Branch: refs/heads/master
Commit: 2f14379226c3616f426819e5d58e18551ed2cf7f
Parents: 41522d4
Author: Antoine Toulme <an...@lunar-ocean.com>
Authored: Sat Aug 13 23:26:24 2016 -0700
Committer: Antoine Toulme <an...@lunar-ocean.com>
Committed: Sat Aug 13 23:26:24 2016 -0700

----------------------------------------------------------------------
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/2f143792/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 4a49eb6..b32d947 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -22,6 +22,7 @@
 * Fixed:  BUILDR-695 transitive doesn't support ${project.parent.version} in POM.
 * Fixed:  BUILDR-653 Using Eclipse compiler (ECJ)
 * Fixed:  BUILDR-476 Buildr doesn't respect company repository manager
+* Fixed:  BUILDR-454 Definition-level parent-child references-by-name fail in 1.4.0 but not in 1.3.5. Submitted by Rhett Sutphin.
 * Change: Update the custom_pom addon to generate poms with exclusions section that excludes
           all transitive dependencies. This is required as buildr dependencies are not
           transitive while Maven's dependencies are transitive by default.


[2/3] buildr git commit: Merge branch 'BUILDR-454'

Posted by to...@apache.org.
Merge branch 'BUILDR-454'


Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/41522d42
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/41522d42
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/41522d42

Branch: refs/heads/master
Commit: 41522d4244cbcacdf7236566298f8c17e58322de
Parents: 24724f9 a850d8c
Author: Antoine Toulme <an...@lunar-ocean.com>
Authored: Sat Aug 13 23:24:31 2016 -0700
Committer: Antoine Toulme <an...@lunar-ocean.com>
Committed: Sat Aug 13 23:24:31 2016 -0700

----------------------------------------------------------------------
 lib/buildr/core/project.rb | 15 ++++++++++++++-
 spec/core/project_spec.rb  | 17 +++++++++++------
 2 files changed, 25 insertions(+), 7 deletions(-)
----------------------------------------------------------------------