Browse Source

Minor tweaking of IDEA deps.

Luke Taylor 15 years ago
parent
commit
566328fea4
1 changed files with 16 additions and 3 deletions
  1. 16 3
      build.gradle

+ 16 - 3
build.gradle

@@ -47,6 +47,8 @@ configure (aspectjProjects) {
 
 apply from: "$rootDir/gradle/dist.gradle"
 
+apply plugin: 'idea'
+
 configure(javaProjects) {
     apply plugin: 'idea'
     apply plugin: 'eclipse'
@@ -57,11 +59,22 @@ configure(javaProjects) {
         gradleCacheVariable = 'GRADLE_CACHE'
         outputDir = "$rootProject.projectDir/intellij/out" as File
         testOutputDir = "$rootProject.projectDir/intellij/testOut" as File
+        whenConfigured { module ->
+            def allClasses = module.dependencies.findAll() { dep ->
+                if (dep instanceof org.gradle.plugins.idea.model.ModuleLibrary
+                    && dep.classes.find { path ->
+                        path.url.matches('.*jcl-over-slf4j.*') ||
+                        path.url.matches('.*servlet-api.*') ||
+                        path.url.matches('.*jsp-api.*')
+                    }) {
+                    dep.scope = 'COMPILE'
+                    dep.exported = false
+                }
+            }
+        }
     }
 }
 
-apply plugin: 'idea'
-
 ideaModule {
     excludeDirs += file('.gradle')
     excludeDirs += file('buildSrc/build')
@@ -70,7 +83,7 @@ ideaModule {
 
 ideaProject {
     javaVersion = '1.6'
-    subprojects = javaProjects
+    subprojects = [rootProject] + javaProjects
     withXml { node ->
         // Use git
         def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }