Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make xpack modules instead of a meta plugin #30589

Merged
merged 6 commits into from
May 16, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions distribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,14 @@ project.rootProject.subprojects.findAll { it.parent.path == ':modules' }.each {

// use licenses from each of the bundled xpack plugins
Project xpack = project(':x-pack:plugin')
xpack.subprojects.findAll { it.name != 'bwc' }.each { Project xpackSubproject ->
File licenses = new File(xpackSubproject.projectDir, 'licenses')
xpack.subprojects.findAll { it.parent == xpack }.each { Project xpackModule ->
File licenses = new File(xpackModule.projectDir, 'licenses')
if (licenses.exists()) {
buildDefaultNotice.licensesDir licenses
}
copyModule(processDefaultOutputs, xpackModule)
copyLog4jProperties(buildDefaultLog4jConfig, xpackModule)
}
// but copy just the top level meta plugin to the default modules
copyModule(processDefaultOutputs, xpack)
copyLog4jProperties(buildDefaultLog4jConfig, xpack)

//

// make sure we have a clean task since we aren't a java project, but we have tasks that
// put stuff in the build dir
Expand Down
10 changes: 2 additions & 8 deletions x-pack/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ import java.nio.file.Path
import java.nio.file.StandardCopyOption
import org.elasticsearch.gradle.test.RunTask;

apply plugin: 'elasticsearch.es-meta-plugin'
apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'

archivesBaseName = 'x-pack'

es_meta_plugin {
name = 'x-pack'
description = 'Elasticsearch Expanded Pack Plugin'
plugins = ['core', 'deprecation', 'graph', 'logstash',
'ml', 'monitoring', 'security', 'upgrade', 'watcher', 'sql', 'rollup']
}

dependencies {
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/core/src/main/bin/x-pack-env
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# you may not use this file except in compliance with the Elastic License.

# include x-pack-core jars in classpath
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/modules/x-pack/x-pack-core/*"
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/modules/x-pack-core/*"
2 changes: 1 addition & 1 deletion x-pack/plugin/core/src/main/bin/x-pack-env.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ rem Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
rem or more contributor license agreements. Licensed under the Elastic License;
rem you may not use this file except in compliance with the Elastic License.

set ES_CLASSPATH=!ES_CLASSPATH!;!ES_HOME!/modules/x-pack/x-pack-core/*
set ES_CLASSPATH=!ES_CLASSPATH!;!ES_HOME!/modules/x-pack-core/*
2 changes: 1 addition & 1 deletion x-pack/plugin/security/src/main/bin/x-pack-security-env
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
source "`dirname "$0"`"/x-pack-env

# include x-pack-security jars in classpath
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/modules/x-pack/x-pack-security/*"
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/modules/x-pack-security/*"
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ rem you may not use this file except in compliance with the Elastic License.

call "%~dp0x-pack-env.bat" || exit /b 1

set ES_CLASSPATH=!ES_CLASSPATH!;!ES_HOME!/modules/x-pack/x-pack-security/*
set ES_CLASSPATH=!ES_CLASSPATH!;!ES_HOME!/modules/x-pack-security/*
2 changes: 1 addition & 1 deletion x-pack/plugin/watcher/src/main/bin/x-pack-watcher-env
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
source "`dirname "$0"`"/x-pack-env

# include x-pack-security jars in classpath
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/modules/x-pack/x-pack-watcher/*"
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/modules/x-pack-watcher/*"
2 changes: 1 addition & 1 deletion x-pack/plugin/watcher/src/main/bin/x-pack-watcher-env.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ rem you may not use this file except in compliance with the Elastic License.

call "%~dp0x-pack-env.bat" || exit /b 1

set ES_CLASSPATH=!ES_CLASSPATH!;!ES_HOME!/modules/x-pack/x-pack-watcher/*
set ES_CLASSPATH=!ES_CLASSPATH!;!ES_HOME!/modules/x-pack-watcher/*
10 changes: 3 additions & 7 deletions x-pack/qa/smoke-test-plugins-ssl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ task exportNodeCertificate(type: LoggedExec) {

// Import the node certificate in the client's keystore
task importNodeCertificateInClientKeyStore(type: LoggedExec) {
dependsOn exportNodeCertificate
dependsOn createClientKeyStore, exportNodeCertificate
executable = new File(project.runtimeJavaHome, 'bin/keytool')
args '-import',
'-alias', 'test-node',
Expand Down Expand Up @@ -137,7 +137,7 @@ task exportClientCertificate(type: LoggedExec) {

// Import the client certificate in the node's keystore
task importClientCertificateInNodeKeyStore(type: LoggedExec) {
dependsOn exportClientCertificate
dependsOn exportClientCertificate, createNodeKeyStore
executable = new File(project.runtimeJavaHome, 'bin/keytool')
args '-import',
'-alias', 'test-client',
Expand All @@ -153,14 +153,10 @@ forbiddenPatterns {

// Add keystores to test classpath: it expects it there
sourceSets.test.resources.srcDir(keystoreDir)
processTestResources.dependsOn(
createNodeKeyStore, createClientKeyStore,
importNodeCertificateInClientKeyStore, importClientCertificateInNodeKeyStore
)
processTestResources.dependsOn(importNodeCertificateInClientKeyStore, importClientCertificateInNodeKeyStore)

integTestCluster.dependsOn(importClientCertificateInNodeKeyStore, importNodeCertificateInClientKeyStore)


ext.pluginsCount = 0
project(':plugins').getChildProjects().each { pluginName, pluginProject ->
// need to get a non-decorated project object, so must re-lookup the project by path
Expand Down
11 changes: 5 additions & 6 deletions x-pack/qa/sql/security/ssl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ task createClientKeyStore(type: LoggedExec) {
// Export the node's certificate
File nodeCertificate = new File(keystoreDir, 'test-node.cert')
task exportNodeCertificate(type: LoggedExec) {
dependsOn createNodeKeyStore
doFirst {
if (nodeCertificate.parentFile.exists() == false) {
nodeCertificate.parentFile.mkdirs()
Expand All @@ -92,7 +93,7 @@ task exportNodeCertificate(type: LoggedExec) {

// Import the node certificate in the client's keystore
task importNodeCertificateInClientKeyStore(type: LoggedExec) {
dependsOn exportNodeCertificate
dependsOn createClientKeyStore, exportNodeCertificate
executable = new File(project.runtimeJavaHome, 'bin/keytool')
args '-import',
'-alias', 'test-node',
Expand All @@ -105,6 +106,7 @@ task importNodeCertificateInClientKeyStore(type: LoggedExec) {
// Export the client's certificate
File clientCertificate = new File(keystoreDir, 'test-client.cert')
task exportClientCertificate(type: LoggedExec) {
dependsOn createClientKeyStore
doFirst {
if (clientCertificate.parentFile.exists() == false) {
clientCertificate.parentFile.mkdirs()
Expand All @@ -123,7 +125,7 @@ task exportClientCertificate(type: LoggedExec) {

// Import the client certificate in the node's keystore
task importClientCertificateInNodeKeyStore(type: LoggedExec) {
dependsOn exportClientCertificate
dependsOn createNodeKeyStore, exportClientCertificate
executable = new File(project.runtimeJavaHome, 'bin/keytool')
args '-import',
'-alias', 'test-client',
Expand All @@ -139,10 +141,7 @@ forbiddenPatterns {

// Add keystores to test classpath: it expects it there
sourceSets.test.resources.srcDir(keystoreDir)
processTestResources.dependsOn(
createNodeKeyStore, createClientKeyStore,
importNodeCertificateInClientKeyStore, importClientCertificateInNodeKeyStore
)
processTestResources.dependsOn(importNodeCertificateInClientKeyStore, importClientCertificateInNodeKeyStore)

integTestCluster.dependsOn(importClientCertificateInNodeKeyStore)

Expand Down
35 changes: 0 additions & 35 deletions x-pack/qa/vagrant/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,6 @@ esvagrant {
}

dependencies {
// Packaging tests use the x-pack meta plugin
packaging project(path: xpackProject('plugin').path, configuration: 'zip')

// Inherit Bats test utils from :qa:vagrant project
packaging project(path: ':qa:vagrant', configuration: 'packaging')
}

Map<String, List<String>> metaPlugins = [:]
for (Project metaPlugin : project.rootProject.subprojects) {
if (metaPlugin.plugins.hasPlugin(MetaPluginBuildPlugin)) {
MetaPluginPropertiesExtension extension = metaPlugin.extensions.findByName('es_meta_plugin')
if (extension != null) {
List<String> plugins = []
metaPlugin.subprojects.each {
if (extension.plugins.contains(it.name)) {
Project plugin = (Project) it
if (plugin.plugins.hasPlugin(PluginBuildPlugin)) {
PluginPropertiesExtension esplugin = plugin.extensions.findByName('esplugin')
if (esplugin != null) {
plugins.add(esplugin.name)
}
}
}
}
metaPlugins.put(extension.name, plugins.toSorted())
}
}
}

setupPackagingTest {
doLast {
metaPlugins.each{ name, plugins ->
File expectedMetaPlugins = file("build/plugins/${name}.expected")
expectedMetaPlugins.parentFile.mkdirs()
expectedMetaPlugins.setText(plugins.join('\n'), 'UTF-8')
}
}
}