Skip to content

Commit 0bdc4ae

Browse files
committed
Build: Fix meta modules to not install as plugin in tests (#29150)
This commit fixes the meta plugin build to conditionally install the plugin as a module or plugin, depending on whether it is a module or plugin.
1 parent cdc4398 commit 0bdc4ae

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,28 @@ class MetaPluginBuildPlugin implements Plugin<Project> {
3737
project.plugins.apply(RestTestPlugin)
3838

3939
createBundleTask(project)
40+
boolean isModule = project.path.startsWith(':modules:')
4041

4142
project.integTestCluster {
4243
dependsOn(project.bundlePlugin)
43-
plugin(project.path)
4444
}
4545
BuildPlugin.configurePomGeneration(project)
4646
project.afterEvaluate {
4747
PluginBuildPlugin.addZipPomGeneration(project)
48+
if (isModule) {
49+
if (project.integTestCluster.distribution == 'integ-test-zip') {
50+
project.integTestCluster.module(project)
51+
}
52+
} else {
53+
project.integTestCluster.plugin(project.path)
54+
}
4855
}
4956

5057
RunTask run = project.tasks.create('run', RunTask)
5158
run.dependsOn(project.bundlePlugin)
52-
run.clusterConfig.plugin(project.path)
59+
if (isModule == false) {
60+
run.clusterConfig.plugin(project.path)
61+
}
5362
}
5463

5564
private static void createBundleTask(Project project) {

0 commit comments

Comments
 (0)