From 3a43bb1ba9c04274406ecb0ef74e91f0f21fec4b Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Sun, 21 Jan 2018 15:37:31 -0800 Subject: [PATCH] Build: Add pom generation to meta plugins (#28321) This commit adds pom generation to meta plugins by using the same hacks that PluginBuildPlugin already uses to get around "pom" type poms (ie zip files). --- .../gradle/plugin/MetaPluginBuildPlugin.groovy | 6 +++++- .../elasticsearch/gradle/plugin/PluginBuildPlugin.groovy | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/MetaPluginBuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/MetaPluginBuildPlugin.groovy index fbef0d8e49721..3df9b604c1309 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/MetaPluginBuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/MetaPluginBuildPlugin.groovy @@ -19,7 +19,7 @@ package org.elasticsearch.gradle.plugin -import org.elasticsearch.gradle.test.RestIntegTestTask +import org.elasticsearch.gradle.BuildPlugin import org.elasticsearch.gradle.test.RestTestPlugin import org.elasticsearch.gradle.test.RunTask import org.elasticsearch.gradle.test.StandaloneRestTestPlugin @@ -42,6 +42,10 @@ class MetaPluginBuildPlugin implements Plugin { dependsOn(project.bundlePlugin) plugin(project.path) } + BuildPlugin.configurePomGeneration(project) + project.afterEvaluate { + PluginBuildPlugin.addZipPomGeneration(project) + } RunTask run = project.tasks.create('run', RunTask) run.dependsOn(project.bundlePlugin) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy index f342a68707ed6..950acad9a5eb4 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy @@ -18,6 +18,7 @@ */ package org.elasticsearch.gradle.plugin +import nebula.plugin.info.scm.ScmInfoPlugin import org.elasticsearch.gradle.BuildPlugin import org.elasticsearch.gradle.NoticeTask import org.elasticsearch.gradle.test.RestIntegTestTask @@ -220,7 +221,8 @@ public class PluginBuildPlugin extends BuildPlugin { } /** Adds a task to generate a pom file for the zip distribution. */ - protected void addZipPomGeneration(Project project) { + public static void addZipPomGeneration(Project project) { + project.plugins.apply(ScmInfoPlugin.class) project.plugins.apply(MavenPublishPlugin.class) project.publishing {