buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject [1/6] buildr git commit: Update the Intellij IDEA plugin to correctly identify project paths as resource directories.
Date Sun, 20 Sep 2015 06:30:13 GMT
Repository: buildr
Updated Branches:
  refs/heads/master 787ae30a3 -> 749991e4c


Update the Intellij IDEA plugin to correctly identify project paths as resource directories.


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

Branch: refs/heads/master
Commit: b165a35aabdad11c547601aa60c3d875652ce2b7
Parents: 787ae30
Author: Peter Donald <peter@realityforge.org>
Authored: Sun Sep 20 16:21:10 2015 +1000
Committer: Peter Donald <peter@realityforge.org>
Committed: Sun Sep 20 16:21:10 2015 +1000

----------------------------------------------------------------------
 CHANGELOG              |  2 ++
 lib/buildr/ide/idea.rb | 37 +++++++++++++++++++++++--------------
 2 files changed, 25 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/b165a35a/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 9c6abad..487f23a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
 1.4.24 (Pending)
+* Change: Update the Intellij IDEA plugin to correctly identify project paths as resource
+          directories.
 * Change: Update the default GWT version used in the GWT addon to the latest release 2.7.0.
 * Fixed:  Fix GWT addon to explicitly add gwt-dev artifact to gwt compile path now that
           the bug that allowed unintended sharing has been fixed.

http://git-wip-us.apache.org/repos/asf/buildr/blob/b165a35a/lib/buildr/ide/idea.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/ide/idea.rb b/lib/buildr/ide/idea.rb
index b98515c..4fd3449 100644
--- a/lib/buildr/ide/idea.rb
+++ b/lib/buildr/ide/idea.rb
@@ -213,17 +213,19 @@ module Buildr #:nodoc:
       end
 
       def main_source_directories
-        @main_source_directories ||= [
-          buildr_project.compile.sources,
-          buildr_project.resources.sources
-        ].flatten.compact
+        @main_source_directories ||= [buildr_project.compile.sources].flatten.compact
+      end
+
+      def main_resource_directories
+        @main_resource_directories ||= [buildr_project.resources.sources].flatten.compact
       end
 
       def test_source_directories
-        @test_source_directories ||= [
-          buildr_project.test.compile.sources,
-          buildr_project.test.resources.sources
-        ].flatten.compact
+        @test_source_directories ||= [buildr_project.test.compile.sources].flatten.compact
+      end
+
+      def test_resource_directories
+        @test_resource_directories ||= [buildr_project.test.resources.sources].flatten.compact
       end
 
       def excluded_directories
@@ -568,12 +570,19 @@ module Buildr #:nodoc:
       def generate_content(xml)
         xml.content(:url => 'file://$MODULE_DIR$') do
           # Source folders
-          {
-            :main => self.main_source_directories,
-            :test => self.test_source_directories
-          }.each do |kind, directories|
-            directories.map { |dir| dir.to_s }.compact.sort.uniq.each do |dir|
-              xml.sourceFolder :url => file_path(dir), :isTestSource => (kind == :test
? 'true' : 'false')
+          [
+            {:dirs => self.main_source_directories},
+            {:type => 'resource', :dirs => self.main_resource_directories},
+            {:test => true, :dirs => self.test_source_directories},
+            {:test => true, :type => 'resource', :dirs => self.test_resource_directories},
+          ].each do |content|
+            content[:dirs].map { |dir| dir.to_s }.compact.sort.uniq.each do |dir|
+              options = {}
+              options[:url] = file_path(dir)
+              options[:isTestSource] = (content[:test] ? 'true' : 'false') if content[:type]
!= 'resource'
+              options[:type] = 'java-resource' if content[:type] == 'resource' &&
!content[:test]
+              options[:type] = 'java-test-resource' if content[:type] == 'resource' &&
!content[:test]
+              xml.sourceFolder options
             end
           end
 


Mime
View raw message