Skip to content

Commit e6a4ea4

Browse files
committed
Move idea checking
1 parent e30b8a7 commit e6a4ea4

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

build.gradle

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -506,27 +506,6 @@ allprojects {
506506
tasks.eclipse.dependsOn(cleanEclipse, copyEclipseSettings)
507507
}
508508

509-
allprojects {
510-
/*
511-
* IntelliJ and Eclipse don't know about the shadow plugin so when we're
512-
* in "IntelliJ mode" or "Eclipse mode" add "runtime" dependencies
513-
* eveywhere where we see a "shadow" dependency which will cause them to
514-
* reference shadowed projects directly rather than rely on the shadowing
515-
* to include them. This is the correct thing for it to do because it
516-
* doesn't run the jar shadowing at all. This isn't needed for the project
517-
* itself because the IDE configuration is done by SourceSets but it is
518-
* *is* needed for projects that depends on the project doing the shadowing.
519-
* Without this they won't properly depend on the shadowed project.
520-
*/
521-
if (isEclipse || isIdea) {
522-
project.plugins.withType(ShadowPlugin).whenPluginAdded {
523-
project.plugins.withType(BuildPlugin).whenPluginAdded {
524-
project.configurations.compile.extendsFrom project.configurations.bundle
525-
}
526-
}
527-
}
528-
}
529-
530509
// we need to add the same --debug-jvm option as
531510
// the real RunTask has, so we can pass it through
532511
class Run extends DefaultTask {

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,24 @@ class BuildPlugin implements Plugin<Project> {
395395
project.plugins.withType(ShadowPlugin).whenPluginAdded {
396396
Configuration bundle = project.configurations.create('bundle')
397397
bundle.dependencies.all(disableTransitiveDeps)
398+
boolean isEclipse = project.ext.has('isEclipse') ? project.isEclipse : false
399+
boolean isIdea = project.ext.has('isIdea') ? project.isIdea : false
400+
if (isEclipse || isIdea) {
401+
/*
402+
* IntelliJ and Eclipse don't know about the shadow plugin so
403+
* when we're in "IntelliJ mode" or "Eclipse mode" add
404+
* "runtime" dependencies eveywhere where we see a "shadow"
405+
* dependency which will cause them to reference shadowed
406+
* projects directly rather than rely on the shadowing to
407+
* include them. This is the correct thing for it to do
408+
* because it doesn't run the jar shadowing at all. This isn't
409+
* needed for the project itself because the IDE configuration
410+
* is done by SourceSets but it is *is* needed for projects
411+
* that depends on the project doing the shadowing. Without
412+
* this they won't properly depend on the shadowed project.
413+
*/
414+
project.configurations.compile.extendsFrom project.configurations.bundle
415+
}
398416
}
399417
}
400418

0 commit comments

Comments
 (0)