You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2012/05/31 06:15:43 UTC

svn commit: r1344557 - in /buildr/trunk: CHANGELOG lib/buildr/ide/idea.rb

Author: donaldp
Date: Thu May 31 04:15:42 2012
New Revision: 1344557

URL: http://svn.apache.org/viewvc?rev=1344557&view=rev
Log:
 Fix the add_exploded_war_artifact method on the idea project by adding in missing method `partition_dependencies`

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/ide/idea.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=1344557&r1=1344556&r2=1344557&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Thu May 31 04:15:42 2012
@@ -1,4 +1,6 @@
 1.4.8 (Pending)
+* Fixed:  Fix the add_exploded_war_artifact method on the idea project by adding in missing method
+          `partition_dependencies`.
 * Fixed:  Fix the extension of the gwt plugin so that it can be required as an addon.
 
 1.4.7 (2012-05-29)

Modified: buildr/trunk/lib/buildr/ide/idea.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/ide/idea.rb?rev=1344557&r1=1344556&r2=1344557&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/ide/idea.rb (original)
+++ buildr/trunk/lib/buildr/ide/idea.rb Thu May 31 04:15:42 2012
@@ -727,6 +727,28 @@ module Buildr
       def resolve_path(path)
         resolve_path_from_base(path, "$PROJECT_DIR$")
       end
+
+    private
+
+      def partition_dependencies(dependencies)
+        libraries = []
+        projects = []
+
+        dependencies.each do |dependency|
+          artifacts = Buildr.artifacts(dependency)
+          artifacts_as_strings = artifacts.map(&:to_s)
+          project = Buildr.projects.detect do |project|
+            [project.packages, project.compile.target, project.resources.target, project.test.compile.target, project.test.resources.target].flatten.
+              detect { |component| artifacts_as_strings.include?(component.to_s) }
+          end
+          if project
+            projects << project
+          else
+            libraries += artifacts
+          end
+        end
+        return libraries.uniq, projects.uniq
+      end
     end
 
     module ProjectExtension