BUILDR-689 - Define assets task before the project is defined to avoid "undefined method `project='" if the project attempts to generate into the same directory.
git-svn-id: https://svn.apache.org/repos/asf/buildr/trunk@1534852 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/buildr/repo Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/dbb367cd Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/dbb367cd Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/dbb367cd Branch: refs/heads/master Commit: dbb367cd0f202292ddd2028a0a1ced2557bb5612 Parents: e9dd8f7 Author: Peter Donald <[email protected]> Authored: Tue Oct 22 23:42:14 2013 +0000 Committer: Peter Donald <[email protected]> Committed: Tue Oct 22 23:42:14 2013 +0000 ---------------------------------------------------------------------- CHANGELOG | 3 +++ lib/buildr/core/assets.rb | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/buildr/blob/dbb367cd/CHANGELOG ---------------------------------------------------------------------- diff --git a/CHANGELOG b/CHANGELOG index e170327..baf854f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,7 @@ 1.4.15 (Pending) +* Fixed: BUILDR-689 - Define assets task before the project is + defined to avoid "undefined method `project='" if the + project attempts to generate into the same directory. * Added: BUILDR-679 - Support uploading to a snapshot repository defined by repositories.snapshot_to if the artifact is a snapshot. Submitted by Tammo van Lessen. http://git-wip-us.apache.org/repos/asf/buildr/blob/dbb367cd/lib/buildr/core/assets.rb ---------------------------------------------------------------------- diff --git a/lib/buildr/core/assets.rb b/lib/buildr/core/assets.rb index 3566d9c..bfd3b22 100644 --- a/lib/buildr/core/assets.rb +++ b/lib/buildr/core/assets.rb @@ -72,6 +72,11 @@ module Buildr #:nodoc: Project.local_task("assets") end + before_define do |project| + # Force the construction of the assets task + project.assets.paths + end + # Access the asset task def assets if @assets.nil? @@ -82,11 +87,6 @@ module Buildr #:nodoc: end @assets end - - after_define do |project| - # Force construction - project.assets - end end end end
