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).
This commit is contained in:
Ryan Ernst 2018-01-21 15:37:31 -08:00 committed by Jason Tedor
parent ef76d99d86
commit 3a43bb1ba9
2 changed files with 8 additions and 2 deletions

View File

@ -19,7 +19,7 @@
package org.elasticsearch.gradle.plugin 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.RestTestPlugin
import org.elasticsearch.gradle.test.RunTask import org.elasticsearch.gradle.test.RunTask
import org.elasticsearch.gradle.test.StandaloneRestTestPlugin import org.elasticsearch.gradle.test.StandaloneRestTestPlugin
@ -42,6 +42,10 @@ class MetaPluginBuildPlugin implements Plugin<Project> {
dependsOn(project.bundlePlugin) dependsOn(project.bundlePlugin)
plugin(project.path) plugin(project.path)
} }
BuildPlugin.configurePomGeneration(project)
project.afterEvaluate {
PluginBuildPlugin.addZipPomGeneration(project)
}
RunTask run = project.tasks.create('run', RunTask) RunTask run = project.tasks.create('run', RunTask)
run.dependsOn(project.bundlePlugin) run.dependsOn(project.bundlePlugin)

View File

@ -18,6 +18,7 @@
*/ */
package org.elasticsearch.gradle.plugin package org.elasticsearch.gradle.plugin
import nebula.plugin.info.scm.ScmInfoPlugin
import org.elasticsearch.gradle.BuildPlugin import org.elasticsearch.gradle.BuildPlugin
import org.elasticsearch.gradle.NoticeTask import org.elasticsearch.gradle.NoticeTask
import org.elasticsearch.gradle.test.RestIntegTestTask 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. */ /** 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.plugins.apply(MavenPublishPlugin.class)
project.publishing { project.publishing {