Skip to content

Commit

Permalink
Build: Add run task to meta plugins (elastic#28283)
Browse files Browse the repository at this point in the history
This commit adds a run task to projects using the meta plugin plugin. It
also makes the project installable via ClusterConfiguration.plugin.
  • Loading branch information
rjernst authored Jan 18, 2018
1 parent 48c8098 commit 06f931f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package org.elasticsearch.gradle.plugin

import org.elasticsearch.gradle.test.RestIntegTestTask
import org.elasticsearch.gradle.test.RestTestPlugin
import org.elasticsearch.gradle.test.RunTask
import org.elasticsearch.gradle.test.StandaloneRestTestPlugin
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand All @@ -42,6 +43,10 @@ class MetaPluginBuildPlugin implements Plugin<Project> {
distribution = 'zip'
setupCommand('installMetaPlugin', 'bin/elasticsearch-plugin', 'install', 'file:' + project.bundlePlugin.archivePath)
}

RunTask run = project.tasks.create('run', RunTask)
run.dependsOn(project.bundlePlugin)
run.clusterConfig.plugin(project.path)
}

private static void createBundleTask(Project project) {
Expand All @@ -63,6 +68,10 @@ class MetaPluginBuildPlugin implements Plugin<Project> {
}
project.assemble.dependsOn(bundle)

// also make the zip available as a configuration (used when depending on this project)
project.configurations.create('zip')
project.artifacts.add('zip', bundle)

// a super hacky way to inject code to run at the end of each of the bundled plugin's configuration
// to add itself back to this meta plugin zip
project.afterEvaluate {
Expand Down

0 comments on commit 06f931f

Please sign in to comment.