gradle: remove obsolete code - usage of resourceDirs/testResourceDirs ext properties
[idea/community.git] / plugins / gradle / tooling-extension-impl / src / org / jetbrains / plugins / gradle / tooling / builder / ModuleExtendedModelBuilderImpl.java
index e52f8c01a083845bada27d3a0f0cb769768a2e16..214dad27db0ec0ea99b43c8dbbdaddd2910b99de 100644 (file)
@@ -15,7 +15,6 @@
  */
 package org.jetbrains.plugins.gradle.tooling.builder;
 
-import groovy.lang.GroovyObject;
 import org.gradle.api.Project;
 import org.gradle.api.Task;
 import org.gradle.api.tasks.SourceSet;
@@ -134,12 +133,9 @@ public class ModuleExtendedModelBuilderImpl implements ModelBuilderService {
     final Set<String> ideaSourceDirectories = new HashSet<String>();
     final Set<String> ideaTestDirectories = new HashSet<String>();
     final Set<String> ideaGeneratedDirectories = new HashSet<String>();
-    final Set<String> ideaExtResourceDirectories = new HashSet<String>();
-    final Set<String> ideaExtTestResourceDirectories = new HashSet<String>();
     final Set<File> excludeDirectories = new HashSet<File>();
 
-    enrichDataFromIdeaPlugin(project, excludeDirectories, ideaSourceDirectories, ideaTestDirectories,
-                             ideaExtResourceDirectories, ideaExtTestResourceDirectories, ideaGeneratedDirectories);
+    enrichDataFromIdeaPlugin(project, excludeDirectories, ideaSourceDirectories, ideaTestDirectories, ideaGeneratedDirectories);
 
     if (ideaSourceDirectories.isEmpty()) {
       sourceDirectories.clear();
@@ -156,11 +152,6 @@ public class ModuleExtendedModelBuilderImpl implements ModelBuilderService {
     ideaTestDirectories.removeAll(testResourceDirectories);
     testDirectories.addAll(ideaTestDirectories);
 
-    resourceDirectories.removeAll(ideaExtTestResourceDirectories);
-    resourceDirectories.addAll(ideaExtResourceDirectories);
-    testResourceDirectories.removeAll(ideaExtResourceDirectories);
-    testResourceDirectories.addAll(ideaExtTestResourceDirectories);
-
     // ensure disjoint directories with different type
     resourceDirectories.removeAll(sourceDirectories);
     testDirectories.removeAll(sourceDirectories);
@@ -224,8 +215,6 @@ public class ModuleExtendedModelBuilderImpl implements ModelBuilderService {
                                                Set<File> excludeDirectories,
                                                Set<String> javaDirectories,
                                                Set<String> testDirectories,
-                                               Set<String> ideaExtResourceDirectories,
-                                               Set<String> ideaExtTestResourceDirectories,
                                                Set<String> ideaGeneratedDirectories) {
 
     IdeaPlugin ideaPlugin = project.getPlugins().getPlugin(IdeaPlugin.class);
@@ -249,25 +238,5 @@ public class ModuleExtendedModelBuilderImpl implements ModelBuilderService {
         ideaGeneratedDirectories.add(file.getPath());
       }
     }
-
-    ideaExtResourceDirectories.addAll(getExtDirs("resourceDirs", ideaModel.getModule()));
-    ideaExtTestResourceDirectories.addAll(getExtDirs("testResourceDirs", ideaModel.getModule()));
-  }
-
-  private static List<String> getExtDirs(String propertyName, GroovyObject ideaModule) {
-    List<String> directories = new ArrayList<String>();
-    Object resourceDirs = ideaModule.getProperty(propertyName);
-    if (resourceDirs instanceof Iterable) {
-      for (Object o : Iterable.class.cast(resourceDirs)) {
-        if (o instanceof File) {
-          directories.add(File.class.cast(o).getPath());
-        }
-        else if (o instanceof String) {
-          directories.add((String)o);
-        }
-      }
-    }
-
-    return directories;
   }
 }