Skip to content

Commit b088863

Browse files
committed
Iter
1 parent 117fb41 commit b088863

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ subprojects {
314314
if (shadowed) {
315315
/*
316316
* Include the source of shadowed upstream projects so we don't
317-
* to publish their javadoc.
317+
* have to publish their javadoc.
318318
*/
319319
project.evaluationDependsOn(upstreamProject.path)
320320
project.javadoc.source += upstreamProject.javadoc.source

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

+4
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,10 @@ class BuildPlugin implements Plugin<Project> {
847847
* compilation. Unfortunately, by default it is not used for
848848
* *test* source compilation and isn't used in tests at all. This
849849
* change makes it available for test compilation.
850+
*
851+
* Note that this isn't going to work properly with qa projects
852+
* but they have no business applying the shadow plugin in the
853+
* firstplace.
850854
*/
851855
SourceSet testSourceSet = project.sourceSets.findByName('test')
852856
if (testSourceSet != null) {

buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy

+14
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
*/
1919
package org.elasticsearch.gradle.plugin
2020

21+
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
2122
import nebula.plugin.info.scm.ScmInfoPlugin
2223
import org.elasticsearch.gradle.BuildPlugin
2324
import org.elasticsearch.gradle.NoticeTask
2425
import org.elasticsearch.gradle.test.RestIntegTestTask
2526
import org.elasticsearch.gradle.test.RunTask
27+
import org.gradle.api.InvalidUserDataException
2628
import org.gradle.api.JavaVersion
2729
import org.gradle.api.Project
2830
import org.gradle.api.Task
@@ -46,6 +48,18 @@ public class PluginBuildPlugin extends BuildPlugin {
4648
@Override
4749
public void apply(Project project) {
4850
super.apply(project)
51+
project.plugins.withType(ShadowPlugin).whenPluginAdded {
52+
/*
53+
* We've not tested these plugins together and we're fairly sure
54+
* they aren't going to work properly as is *and* we're not really
55+
* sure *why* you'd want to shade stuff in plugins. So we throw an
56+
* exception here to make you come and read this comment. If you
57+
* have a need for shadow while building plugins then know that you
58+
* are probably going to have to fight with gradle for a while....
59+
*/
60+
throw new InvalidUserDataException('elasticsearch.esplugin is not '
61+
+ 'compatible with com.github.johnrengelman.shadow');
62+
}
4963
configureDependencies(project)
5064
// this afterEvaluate must happen before the afterEvaluate added by integTest creation,
5165
// so that the file name resolution for installing the plugin will be setup

0 commit comments

Comments
 (0)