diff --git a/build.gradle b/build.gradle index b490f606653ed..d369f60427263 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ import de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin import org.apache.tools.ant.taskdefs.condition.Os import org.elasticsearch.gradle.internal.BuildPlugin import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.plugin.PluginBuildPlugin import org.gradle.plugins.ide.eclipse.model.AccessRule @@ -22,6 +22,9 @@ import org.gradle.util.GradleVersion import static org.elasticsearch.gradle.util.GradleUtils.maybeConfigure import org.gradle.plugins.ide.eclipse.model.ProjectDependency import org.elasticsearch.gradle.testclusters.TestClustersPlugin +import org.elasticsearch.gradle.internal.test.RestTestBasePlugin +import org.elasticsearch.gradle.internal.InternalPluginBuildPlugin +import org.elasticsearch.gradle.internal.InternalTestClustersPlugin plugins { id 'lifecycle-base' @@ -37,7 +40,7 @@ plugins { id 'elasticsearch.formatting' id 'elasticsearch.local-distribution' id 'elasticsearch.fips' - id 'elasticsearch.testclusters' + id 'elasticsearch.internal-testclusters' id 'elasticsearch.run' id "com.diffplug.spotless" version "5.12.5" apply false } @@ -110,6 +113,19 @@ subprojects { project.noticeFile = project.rootProject.file('NOTICE.txt') } + plugins.withType(InternalPluginBuildPlugin).whenPluginAdded { + project.dependencies { + compileOnly project(":server") + testImplementation project(":test:framework") + } + } + + // Ultimately the RestTestBase Plugin should apply the InternalTestClusters Plugin itself instead of TestClusters + // but this requires major rework on the func test infrastructure. + // TODO: This will be addressed once we have https://github.com/elastic/elasticsearch/issues/71593 resolved + project.plugins.withType(RestTestBasePlugin) { + project.plugins.apply(InternalTestClustersPlugin) + } } /** @@ -131,7 +147,6 @@ ext.testArtifact = { p, String name = "test" -> }; } - tasks.register("updateCIBwcVersions") { doLast { File yml = file(".ci/bwcVersions") diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index c6b3db176952f..534199bfe5747 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -42,6 +42,156 @@ gradlePlugin { // We already configure publication and we don't need or want the one that comes // with the java-gradle-plugin automatedPublishing = false + plugins { + build { + id = 'elasticsearch.build' + implementationClass = 'org.elasticsearch.gradle.internal.BuildPlugin' + } + distributionDownload { + id = 'elasticsearch.distribution-download' + implementationClass = 'org.elasticsearch.gradle.DistributionDownloadPlugin' + } + distroTest { + id = 'elasticsearch.distro-test' + implementationClass = 'org.elasticsearch.gradle.internal.test.DistroTestPlugin' + } + dockerSupport { + id = 'elasticsearch.docker-support' + implementationClass = 'org.elasticsearch.gradle.internal.docker.DockerSupportPlugin' + } + docsTest { + id = 'elasticsearch.docs-test' + implementationClass = 'org.elasticsearch.gradle.internal.doc.DocsTestPlugin' + } + esPlugin { + id = 'elasticsearch.esplugin' + implementationClass = 'org.elasticsearch.gradle.plugin.PluginBuildPlugin' + } + globalBuildInfo { + id = 'elasticsearch.global-build-info' + implementationClass = 'org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin' + } + internalAvailablePorts { + id = 'elasticsearch.internal-available-ports' + implementationClass = 'org.elasticsearch.gradle.internal.InternalAvailableTcpPortProviderPlugin' + } + internalClusterTest { + id = 'elasticsearch.internal-cluster-test' + implementationClass = 'org.elasticsearch.gradle.internal.test.InternalClusterTestPlugin' + } + internalDistributionArchiveCheck { + id = 'elasticsearch.internal-distribution-archive-check' + implementationClass = 'org.elasticsearch.gradle.internal.InternalDistributionArchiveCheckPlugin' + } + internalDistributionArchiveSetup { + id = 'elasticsearch.internal-distribution-archive-setup' + implementationClass = 'org.elasticsearch.gradle.internal.InternalDistributionArchiveSetupPlugin' + } + internalDistributionBwcSetup { + id = 'elasticsearch.internal-distribution-bwc-setup' + implementationClass = 'org.elasticsearch.gradle.internal.InternalDistributionBwcSetupPlugin' + } + internalDistributionDownload { + id = 'elasticsearch.internal-distribution-download' + implementationClass = 'org.elasticsearch.gradle.internal.InternalDistributionDownloadPlugin' + } + internalLicenseheaders { + id = 'elasticsearch.internal-licenseheaders' + implementationClass = 'org.elasticsearch.gradle.internal.precommit.LicenseHeadersPrecommitPlugin' + } + internalPlugin { + id = 'elasticsearch.internal-es-plugin' + implementationClass = 'org.elasticsearch.gradle.internal.InternalPluginBuildPlugin' + } + internalTestArtifact { + id = 'elasticsearch.internal-test-artifact' + implementationClass = 'org.elasticsearch.gradle.internal.InternalTestArtifactPlugin' + } + internalTestArtifactBase { + id = 'elasticsearch.internal-test-artifact-base' + implementationClass = 'org.elasticsearch.gradle.internal.InternalTestArtifactBasePlugin' + } + internalTestClusters { + id = 'elasticsearch.internal-testclusters' + implementationClass = 'org.elasticsearch.gradle.internal.InternalTestClustersPlugin' + } + internalTestRerun { + id = 'elasticsearch.internal-test-rerun' + implementationClass = 'org.elasticsearch.gradle.internal.test.rerun.TestRerunPlugin' + } + java { + id = 'elasticsearch.java' + implementationClass = 'org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin' + } + javaRestTest { + id = 'elasticsearch.java-rest-test' + implementationClass = 'org.elasticsearch.gradle.internal.test.rest.JavaRestTestPlugin' + } + jdkDownload { + id = 'elasticsearch.jdk-download' + implementationClass = 'org.elasticsearch.gradle.internal.JdkDownloadPlugin' + } + publish { + id = 'elasticsearch.publish' + implementationClass = 'org.elasticsearch.gradle.internal.PublishPlugin' + } + reaper { + id = 'elasticsearch.reaper' + implementationClass = 'org.elasticsearch.gradle.ReaperPlugin' + } + repositories { + id = 'elasticsearch.repositories' + implementationClass = 'org.elasticsearch.gradle.internal.RepositoriesSetupPlugin' + } + restResources { + id = 'elasticsearch.rest-resources' + implementationClass = 'org.elasticsearch.gradle.internal.test.rest.RestResourcesPlugin' + } + restTest { + id = 'elasticsearch.rest-test' + implementationClass = 'org.elasticsearch.gradle.internal.test.RestTestPlugin' + } + standaloneRestTest { + id = 'elasticsearch.standalone-rest-test' + implementationClass = 'org.elasticsearch.gradle.internal.test.StandaloneRestTestPlugin' + } + standaloneTest { + id = 'elasticsearch.standalone-test' + implementationClass = 'org.elasticsearch.gradle.internal.test.StandaloneTestPlugin' + } + testFixtures { + id = 'elasticsearch.test.fixtures' + implementationClass = 'org.elasticsearch.gradle.internal.testfixtures.TestFixturesPlugin' + } + testBase { + id = 'elasticsearch.test-base' + implementationClass = 'org.elasticsearch.gradle.internal.ElasticsearchTestBasePlugin' + } + testWithDependencies { + id = 'elasticsearch.test-with-dependencies' + implementationClass = 'org.elasticsearch.gradle.internal.test.TestWithDependenciesPlugin' + } + testWithSsl { + id = 'elasticsearch.test-with-ssl' + implementationClass = 'org.elasticsearch.gradle.internal.test.TestWithSslPlugin' + } + testclusters { + id = 'elasticsearch.testclusters' + implementationClass = 'org.elasticsearch.gradle.testclusters.TestClustersPlugin' + } + validateRestSpec { + id = 'elasticsearch.validate-rest-spec' + implementationClass = 'org.elasticsearch.gradle.internal.precommit.ValidateRestSpecPlugin' + } + yamlRestCompatTest { + id = 'elasticsearch.yaml-rest-compat-test' + implementationClass = 'org.elasticsearch.gradle.internal.rest.compat.YamlRestCompatTestPlugin' + } + yamlRestTest { + id = 'elasticsearch.yaml-rest-test' + implementationClass = 'org.elasticsearch.gradle.internal.test.rest.YamlRestTestPlugin' + } + } } def generateVersionProperties = tasks.register("generateVersionProperties", WriteProperties) { outputFile = "${buildDir}/version.properties" diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/DistributionDownloadPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/DistributionDownloadPluginFuncTest.groovy index c1b9e084c82f5..1e461665d7139 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/DistributionDownloadPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/DistributionDownloadPluginFuncTest.groovy @@ -9,7 +9,6 @@ package org.elasticsearch.gradle import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest -import org.elasticsearch.gradle.internal.VersionProperties import org.gradle.testkit.runner.TaskOutcome import spock.lang.Unroll @@ -18,7 +17,7 @@ import static org.elasticsearch.gradle.fixtures.DistributionDownloadFixture.with class DistributionDownloadPluginFuncTest extends AbstractGradleFuncTest { @Unroll - def "#distType version can be resolved"() { + def "extracted #distType version can be resolved"() { given: buildFile << applyPluginAndSetupDistro(version, platform) diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy index 9d388f2e146c1..27bbea735ddd0 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy @@ -136,8 +136,6 @@ class TestClustersPluginFuncTest extends AbstractGradleFuncTest { description = "test module description" } - licenseFile = file('license.txt') - noticeFile = file('notice.txt') version = "1.0" group = 'org.acme' """ diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/DistributionDownloadFixture.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/DistributionDownloadFixture.groovy index ef7553a813e51..172b94bb8b945 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/DistributionDownloadFixture.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/DistributionDownloadFixture.groovy @@ -10,7 +10,7 @@ package org.elasticsearch.gradle.fixtures import org.elasticsearch.gradle.Architecture import org.elasticsearch.gradle.ElasticsearchDistribution -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.gradle.testkit.runner.BuildResult import org.gradle.testkit.runner.GradleRunner diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPluginFuncTest.groovy index 65f5cf1361a4d..74eacb0b5a5ac 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPluginFuncTest.groovy @@ -8,7 +8,7 @@ package org.elasticsearch.gradle.internal - +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest import org.gradle.testkit.runner.TaskOutcome import spock.lang.Unroll diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionDownloadPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionDownloadPluginFuncTest.groovy index 36ae97d504122..24ebcd4d61c90 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionDownloadPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionDownloadPluginFuncTest.groovy @@ -9,28 +9,13 @@ package org.elasticsearch.gradle.internal import org.elasticsearch.gradle.Architecture +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest import org.gradle.testkit.runner.TaskOutcome class InternalDistributionDownloadPluginFuncTest extends AbstractGradleFuncTest { - def "plugin application fails on non internal build"() { - given: - buildFile.text = """ - plugins { - id 'elasticsearch.internal-distribution-download' - } - """ - - when: - def result = gradleRunner("tasks").buildAndFail() - - then: - assertOutputContains(result.output, "Plugin 'elasticsearch.internal-distribution-download' is not supported. " + - "Use 'elasticsearch.distribution-download' plugin instead") - } - def "resolves current version from local build"() { given: internalBuild() diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/PublishPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy similarity index 98% rename from buildSrc/src/integTest/groovy/org/elasticsearch/gradle/PublishPluginFuncTest.groovy rename to buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy index 07f37ecf8a568..6155e858780ae 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/PublishPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.gradle +package org.elasticsearch.gradle.internal import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest import org.gradle.testkit.runner.TaskOutcome @@ -178,7 +178,7 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest { file('notice.txt') << "Notice file" buildFile << """ plugins { - id 'elasticsearch.esplugin' + id 'elasticsearch.internal-es-plugin' id 'elasticsearch.publish' id 'com.github.johnrengelman.shadow' } @@ -236,7 +236,7 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest { file('notice.txt') << "Notice file" buildFile << """ plugins { - id 'elasticsearch.esplugin' + id 'elasticsearch.internal-es-plugin' id 'elasticsearch.publish' } diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/RestResourcesPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/RestResourcesPluginFuncTest.groovy similarity index 99% rename from buildSrc/src/integTest/groovy/org/elasticsearch/gradle/RestResourcesPluginFuncTest.groovy rename to buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/RestResourcesPluginFuncTest.groovy index ff2d798301898..b69cd7312efa7 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/RestResourcesPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/RestResourcesPluginFuncTest.groovy @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.gradle +package org.elasticsearch.gradle.internal.test.rest import org.elasticsearch.gradle.fixtures.AbstractRestResourcesFuncTest import org.gradle.testkit.runner.TaskOutcome diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/YamlRestTestPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestTestPluginFuncTest.groovy similarity index 98% rename from buildSrc/src/integTest/groovy/org/elasticsearch/gradle/YamlRestTestPluginFuncTest.groovy rename to buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestTestPluginFuncTest.groovy index f581f5f7b603d..9cfd51d074bee 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/YamlRestTestPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestTestPluginFuncTest.groovy @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.gradle +package org.elasticsearch.gradle.internal.test.rest import org.elasticsearch.gradle.fixtures.AbstractRestResourcesFuncTest import org.gradle.testkit.runner.TaskOutcome diff --git a/buildSrc/src/main/groovy/elasticsearch.run.gradle b/buildSrc/src/main/groovy/elasticsearch.run.gradle index ef654d91ac73b..92953ebbe01c5 100644 --- a/buildSrc/src/main/groovy/elasticsearch.run.gradle +++ b/buildSrc/src/main/groovy/elasticsearch.run.gradle @@ -10,7 +10,7 @@ import org.elasticsearch.gradle.testclusters.RunTask // gradle has an open issue of failing applying plugins in // precompiled script plugins (see https://github.com/gradle/gradle/issues/17004) -// apply plugin: 'elasticsearch.testclusters' +// apply plugin: 'elasticsearch.internal-testclusters' testClusters { runTask { diff --git a/buildSrc/src/main/groovy/elasticsearch.runtime-jdk-provision.gradle b/buildSrc/src/main/groovy/elasticsearch.runtime-jdk-provision.gradle index f9855aecbf30e..4aaa5e825587b 100644 --- a/buildSrc/src/main/groovy/elasticsearch.runtime-jdk-provision.gradle +++ b/buildSrc/src/main/groovy/elasticsearch.runtime-jdk-provision.gradle @@ -8,7 +8,7 @@ import org.elasticsearch.gradle.Architecture import org.elasticsearch.gradle.OS -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams // gradle has an open issue of failing applying plugins in diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/internal/AntFixtureStop.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/internal/AntFixtureStop.groovy index 9ea17c5ef14bb..71ef7f0c306ce 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/internal/AntFixtureStop.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/internal/AntFixtureStop.groovy @@ -10,6 +10,7 @@ package org.elasticsearch.gradle.internal import org.apache.tools.ant.taskdefs.condition.Os import org.elasticsearch.gradle.FixtureStop +import org.elasticsearch.gradle.LoggedExec import org.elasticsearch.gradle.internal.test.AntFixture import org.gradle.api.file.FileSystemOperations import org.gradle.api.tasks.Internal diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/internal/doc/DocsTestPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/internal/doc/DocsTestPlugin.groovy index 7a58785b4aa4d..2d68538c0ccb3 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/internal/doc/DocsTestPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/internal/doc/DocsTestPlugin.groovy @@ -9,7 +9,7 @@ package org.elasticsearch.gradle.internal.doc import org.elasticsearch.gradle.OS import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.file.Directory @@ -23,7 +23,7 @@ class DocsTestPlugin implements Plugin { @Override void apply(Project project) { - project.pluginManager.apply('elasticsearch.testclusters') + project.pluginManager.apply('elasticsearch.internal-testclusters') project.pluginManager.apply('elasticsearch.standalone-rest-test') project.pluginManager.apply('elasticsearch.rest-test') diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index 5ab395911e10c..7b00da3e24221 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -11,9 +11,9 @@ import org.apache.tools.ant.DefaultLogger import org.apache.tools.ant.taskdefs.condition.Os import org.elasticsearch.gradle.internal.BuildPlugin import org.elasticsearch.gradle.internal.BwcVersions -import org.elasticsearch.gradle.internal.LoggedExec +import org.elasticsearch.gradle.LoggedExec import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.test.Fixture import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.plugin.PluginBuildPlugin diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy index 40682f4cb0de0..82b2974ee53d8 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy @@ -12,7 +12,7 @@ import com.sun.jna.Native import com.sun.jna.WString import org.apache.tools.ant.taskdefs.condition.Os import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.gradle.api.Project import java.nio.file.Files diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/DistributionDependency.java b/buildSrc/src/main/java/org/elasticsearch/gradle/DistributionDependency.java similarity index 96% rename from buildSrc/src/main/java/org/elasticsearch/gradle/internal/DistributionDependency.java rename to buildSrc/src/main/java/org/elasticsearch/gradle/DistributionDependency.java index a08310994c87b..44071305628b8 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/DistributionDependency.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/DistributionDependency.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.gradle.internal; +package org.elasticsearch.gradle; public interface DistributionDependency { static DistributionDependency of(String dependencyNotation) { diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/DistributionDownloadPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/DistributionDownloadPlugin.java index 849baffb0261f..b9afb80bb5311 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/DistributionDownloadPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/DistributionDownloadPlugin.java @@ -8,14 +8,9 @@ package org.elasticsearch.gradle; -import org.elasticsearch.gradle.ElasticsearchDistribution.Platform; -import org.elasticsearch.gradle.ElasticsearchDistribution.Type; -import org.elasticsearch.gradle.internal.docker.DockerSupportPlugin; -import org.elasticsearch.gradle.internal.docker.DockerSupportService; -import org.elasticsearch.gradle.internal.DistributionDependency; +import org.elasticsearch.gradle.distribution.ElasticsearchDistributionTypes; import org.elasticsearch.gradle.transform.SymbolicLinkPreservingUntarTransform; import org.elasticsearch.gradle.transform.UnzipTransform; -import org.elasticsearch.gradle.util.GradleUtils; import org.gradle.api.NamedDomainObjectContainer; import org.gradle.api.Plugin; import org.gradle.api.Project; @@ -24,8 +19,11 @@ import org.gradle.api.artifacts.repositories.IvyArtifactRepository; import org.gradle.api.artifacts.type.ArtifactTypeDefinition; import org.gradle.api.internal.artifacts.ArtifactAttributes; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.Property; import org.gradle.api.provider.Provider; +import javax.inject.Inject; import java.util.Comparator; /** @@ -48,14 +46,19 @@ public class DistributionDownloadPlugin implements Plugin { private NamedDomainObjectContainer distributionsContainer; private NamedDomainObjectContainer distributionsResolutionStrategiesContainer; + private Property dockerAvailability; + + @Inject + public DistributionDownloadPlugin(ObjectFactory objectFactory) { + this.dockerAvailability = objectFactory.property(Boolean.class).value(false); + } + + public void setDockerAvailability(Provider dockerAvailability) { + this.dockerAvailability.set(dockerAvailability); + } + @Override public void apply(Project project) { - project.getRootProject().getPluginManager().apply(DockerSupportPlugin.class); - Provider dockerSupport = GradleUtils.getBuildService( - project.getGradle().getSharedServices(), - DockerSupportPlugin.DOCKER_SUPPORT_SERVICE_NAME - ); - project.getDependencies().registerTransform(UnzipTransform.class, transformSpec -> { transformSpec.getFrom().attribute(ArtifactAttributes.ARTIFACT_FORMAT, ArtifactTypeDefinition.ZIP_TYPE); transformSpec.getTo().attribute(ArtifactAttributes.ARTIFACT_FORMAT, ArtifactTypeDefinition.DIRECTORY_TYPE); @@ -68,11 +71,11 @@ public void apply(Project project) { }); setupResolutionsContainer(project); - setupDistributionContainer(project, dockerSupport); + setupDistributionContainer(project, dockerAvailability); setupDownloadServiceRepo(project); } - private void setupDistributionContainer(Project project, Provider dockerSupport) { + private void setupDistributionContainer(Project project, Property dockerAvailable) { distributionsContainer = project.container(ElasticsearchDistribution.class, name -> { Configuration fileConfiguration = project.getConfigurations().create("es_distro_file_" + name); Configuration extractedConfiguration = project.getConfigurations().create(DISTRO_EXTRACTED_CONFIG_PREFIX + name); @@ -80,7 +83,7 @@ private void setupDistributionContainer(Project project, Provider finalizeDistributionDependencies(project, dist) @@ -160,29 +163,12 @@ private static void setupDownloadServiceRepo(Project project) { * coordinates that resolve to the Elastic download service through an ivy repository. */ private String dependencyNotation(ElasticsearchDistribution distribution) { - if (distribution.getType() == Type.INTEG_TEST_ZIP) { + if (distribution.getType() == ElasticsearchDistributionTypes.INTEG_TEST_ZIP) { return "org.elasticsearch.distribution.integ-test-zip:elasticsearch:" + distribution.getVersion() + "@zip"; } - Version distroVersion = Version.fromString(distribution.getVersion()); - String extension = distribution.getType().toString(); - String classifier = ":" + Architecture.current().classifier; - if (distribution.getType() == Type.ARCHIVE) { - extension = distribution.getPlatform() == Platform.WINDOWS ? "zip" : "tar.gz"; - if (distroVersion.onOrAfter("7.0.0")) { - classifier = ":" + distribution.getPlatform() + "-" + Architecture.current().classifier; - } else { - classifier = ""; - } - } else if (distribution.getType() == Type.DEB) { - if (distroVersion.onOrAfter("7.0.0")) { - classifier = ":amd64"; - } else { - classifier = ""; - } - } else if (distribution.getType() == Type.RPM && distroVersion.before("7.0.0")) { - classifier = ""; - } + String extension = distribution.getType().getExtension(distribution.getPlatform()); + String classifier = distribution.getType().getClassifier(distribution.getPlatform(), distroVersion); String group = distribution.getVersion().endsWith("-SNAPSHOT") ? FAKE_SNAPSHOT_IVY_GROUP : FAKE_IVY_GROUP; return group + ":elasticsearch" + ":" + distribution.getVersion() + classifier + "@" + extension; } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/DistributionResolution.java b/buildSrc/src/main/java/org/elasticsearch/gradle/DistributionResolution.java index 917f4679d145e..3b82c9f6975a0 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/DistributionResolution.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/DistributionResolution.java @@ -8,7 +8,6 @@ package org.elasticsearch.gradle; -import org.elasticsearch.gradle.internal.DistributionDependency; import org.gradle.api.Project; public class DistributionResolution { diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchDistribution.java b/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchDistribution.java index d0e17a2d950da..5350b6698cb30 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchDistribution.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchDistribution.java @@ -8,14 +8,12 @@ package org.elasticsearch.gradle; -import org.elasticsearch.gradle.internal.VersionProperties; -import org.elasticsearch.gradle.internal.docker.DockerSupportService; +import org.elasticsearch.gradle.distribution.ElasticsearchDistributionTypes; import org.gradle.api.Action; import org.gradle.api.Buildable; import org.gradle.api.artifacts.Configuration; import org.gradle.api.model.ObjectFactory; import org.gradle.api.provider.Property; -import org.gradle.api.provider.Provider; import org.gradle.api.tasks.TaskDependency; import java.io.File; @@ -36,49 +34,6 @@ public String toString() { } } - public enum Type { - INTEG_TEST_ZIP, - ARCHIVE, - RPM, - DEB, - DOCKER, - // This is a different flavour of Docker image - DOCKER_UBI, - // Like UBI, but a little different. - DOCKER_IRON_BANK; - - @Override - public String toString() { - return super.toString().toLowerCase(Locale.ROOT); - } - - public boolean shouldExtract() { - switch (this) { - case DEB: - case DOCKER: - case DOCKER_UBI: - case DOCKER_IRON_BANK: - case RPM: - return false; - - default: - return true; - } - } - - public boolean isDocker() { - switch (this) { - case DOCKER: - case DOCKER_UBI: - case DOCKER_IRON_BANK: - return true; - - default: - return false; - } - } - } - // package private to tests can use public static final Platform CURRENT_PLATFORM = OS.conditional() .onLinux(() -> Platform.LINUX) @@ -87,13 +42,13 @@ public boolean isDocker() { .supply(); private final String name; - private final Provider dockerSupport; + private final Property dockerAvailability; // pkg private so plugin can configure final Configuration configuration; private final Property architecture; private final Property version; - private final Property type; + private final Property type; private final Property platform; private final Property bundledJdk; private final Property failIfUnavailable; @@ -104,18 +59,18 @@ public boolean isDocker() { ElasticsearchDistribution( String name, ObjectFactory objectFactory, - Provider dockerSupport, + Property dockerAvailability, Configuration fileConfiguration, Configuration extractedConfiguration, Action distributionFinalizer ) { this.name = name; - this.dockerSupport = dockerSupport; + this.dockerAvailability = dockerAvailability; this.configuration = fileConfiguration; this.architecture = objectFactory.property(Architecture.class); this.version = objectFactory.property(String.class).convention(VersionProperties.getElasticsearch()); - this.type = objectFactory.property(Type.class); - this.type.convention(Type.ARCHIVE); + this.type = objectFactory.property(ElasticsearchDistributionType.class); + this.type.convention(ElasticsearchDistributionTypes.ARCHIVE); this.platform = objectFactory.property(Platform.class); this.bundledJdk = objectFactory.property(Boolean.class); this.failIfUnavailable = objectFactory.property(Boolean.class).convention(true); @@ -144,14 +99,27 @@ public void setPlatform(Platform platform) { this.platform.set(platform); } - public Type getType() { + public ElasticsearchDistributionType getType() { return type.get(); } - public void setType(Type type) { + public void setType(ElasticsearchDistributionType type) { this.type.set(type); } + /** + * For simplicity only public distribution types are supported here + * */ + public void setType(String type) { + if (type.equals(ElasticsearchDistributionTypes.ARCHIVE.getName())) { + this.type.set(ElasticsearchDistributionTypes.ARCHIVE); + } else if (type.equals(ElasticsearchDistributionTypes.INTEG_TEST_ZIP.getName())) { + this.type.set(ElasticsearchDistributionTypes.INTEG_TEST_ZIP); + } else { + throw new IllegalArgumentException("Cannot set Elasticsearch Distribution type to " + type + ". Type unknown."); + } + } + public boolean getBundledJdk() { return bundledJdk.getOrElse(true); } @@ -205,19 +173,12 @@ public String getFilepath() { } public Configuration getExtracted() { - switch (getType()) { - case DEB: - case DOCKER: - case DOCKER_UBI: - case DOCKER_IRON_BANK: - case RPM: - throw new UnsupportedOperationException( - "distribution type [" + getType() + "] for " + "elasticsearch distribution [" + name + "] cannot be extracted" - ); - - default: - return extracted; + if (getType().shouldExtract() == false) { + throw new UnsupportedOperationException( + "distribution type [" + getType().getName() + "] for " + "elasticsearch distribution [" + name + "] cannot be extracted" + ); } + return extracted; } @Override @@ -231,7 +192,7 @@ public TaskDependency getBuildDependencies() { } private boolean skippingDockerDistributionBuild() { - return isDocker() && getFailIfUnavailable() == false && dockerSupport.get().getDockerAvailability().isAvailable == false; + return isDocker() && getFailIfUnavailable() == false && dockerAvailability.get() == false; } @Override @@ -242,7 +203,7 @@ public Iterator iterator() { // internal, make this distribution's configuration unmodifiable void finalizeValues() { - if (getType() == Type.INTEG_TEST_ZIP) { + if (getType() == ElasticsearchDistributionTypes.INTEG_TEST_ZIP) { if (platform.getOrNull() != null) { throw new IllegalArgumentException( "platform cannot be set on elasticsearch distribution [" + name + "] of type [integ_test_zip]" @@ -262,7 +223,7 @@ void finalizeValues() { ); } - if (getType() == Type.ARCHIVE) { + if (getType() == ElasticsearchDistributionTypes.ARCHIVE) { // defaults for archive, set here instead of via convention so integ-test-zip can verify they are not set if (platform.isPresent() == false) { platform.set(CURRENT_PLATFORM); diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchDistributionType.java b/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchDistributionType.java new file mode 100644 index 0000000000000..7661e346f809d --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchDistributionType.java @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle; + +public interface ElasticsearchDistributionType { + + String getName(); + + default boolean isDocker() { + return false; + }; + + default boolean shouldExtract() { + return false; + }; + + default String getExtension(ElasticsearchDistribution.Platform platform) { + return getName(); + } + + default String getClassifier(ElasticsearchDistribution.Platform platform, Version version) { + return ":" + Architecture.current().classifier; + } +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/LazyFileOutputStream.java b/buildSrc/src/main/java/org/elasticsearch/gradle/LazyFileOutputStream.java similarity index 97% rename from buildSrc/src/main/java/org/elasticsearch/gradle/internal/LazyFileOutputStream.java rename to buildSrc/src/main/java/org/elasticsearch/gradle/LazyFileOutputStream.java index a3c6f82aec170..dd7dd45649b0c 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/LazyFileOutputStream.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/LazyFileOutputStream.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.gradle.internal; +package org.elasticsearch.gradle; import java.io.File; import java.io.FileOutputStream; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/LoggedExec.java b/buildSrc/src/main/java/org/elasticsearch/gradle/LoggedExec.java similarity index 98% rename from buildSrc/src/main/java/org/elasticsearch/gradle/internal/LoggedExec.java rename to buildSrc/src/main/java/org/elasticsearch/gradle/LoggedExec.java index 7c9cfd632eac0..5ce64e9eb8552 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/LoggedExec.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/LoggedExec.java @@ -5,9 +5,8 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.gradle.internal; +package org.elasticsearch.gradle; -import org.elasticsearch.gradle.FileSystemOperationsAware; import org.gradle.api.Action; import org.gradle.api.GradleException; import org.gradle.api.Task; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperPlugin.java index 7fb5635ee1682..7a81284a26542 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperPlugin.java @@ -8,8 +8,6 @@ package org.elasticsearch.gradle; -import org.elasticsearch.gradle.internal.info.BuildParams; -import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.file.ProjectLayout; @@ -32,20 +30,24 @@ public ReaperPlugin(ProjectLayout projectLayout) { @Override public void apply(Project project) { + registerReaperService(project, projectLayout, false); + } + + public static void registerReaperService(Project project, ProjectLayout projectLayout, boolean internal) { if (project != project.getRootProject()) { throw new IllegalArgumentException("ReaperPlugin can only be applied to the root project of a build"); } - project.getPlugins().apply(GlobalBuildInfoPlugin.class); File inputDir = projectLayout.getProjectDirectory() .dir(".gradle") .dir("reaper") .dir("build-" + ProcessHandle.current().pid()) .getAsFile(); + project.getGradle().getSharedServices().registerIfAbsent(REAPER_SERVICE_NAME, ReaperService.class, spec -> { // Provide some parameters spec.getParameters().getInputDir().set(inputDir); spec.getParameters().getBuildDir().set(projectLayout.getBuildDirectory()); - spec.getParameters().setInternal(BuildParams.isInternal()); + spec.getParameters().setInternal(internal); }); } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperService.java b/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperService.java index d559266140e3f..78d7f23c7daad 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperService.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/ReaperService.java @@ -172,7 +172,7 @@ public void close() throws Exception { shutdown(); } - interface Params extends BuildServiceParameters { + public interface Params extends BuildServiceParameters { Boolean getInternal(); void setInternal(Boolean internal); diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/VersionProperties.java b/buildSrc/src/main/java/org/elasticsearch/gradle/VersionProperties.java similarity index 97% rename from buildSrc/src/main/java/org/elasticsearch/gradle/internal/VersionProperties.java rename to buildSrc/src/main/java/org/elasticsearch/gradle/VersionProperties.java index 6bfbd8bf27590..48b1c10af79ed 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/VersionProperties.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/VersionProperties.java @@ -5,9 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.gradle.internal; - -import org.elasticsearch.gradle.Version; +package org.elasticsearch.gradle; import java.io.IOException; import java.io.InputStream; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/distribution/ArchiveElasticsearchDistributionType.java b/buildSrc/src/main/java/org/elasticsearch/gradle/distribution/ArchiveElasticsearchDistributionType.java new file mode 100644 index 0000000000000..b19ea81d6b496 --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/distribution/ArchiveElasticsearchDistributionType.java @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.distribution; + +import org.elasticsearch.gradle.Architecture; +import org.elasticsearch.gradle.ElasticsearchDistribution; +import org.elasticsearch.gradle.ElasticsearchDistributionType; +import org.elasticsearch.gradle.Version; + +public class ArchiveElasticsearchDistributionType implements ElasticsearchDistributionType { + + ArchiveElasticsearchDistributionType() {} + + @Override + public String getName() { + return "archive"; + } + + @Override + public String getExtension(ElasticsearchDistribution.Platform platform) { + return platform == ElasticsearchDistribution.Platform.WINDOWS ? "zip" : "tar.gz"; + } + + @Override + public String getClassifier(ElasticsearchDistribution.Platform platform, Version version) { + return version.onOrAfter("7.0.0") ? ":" + platform + "-" + Architecture.current().classifier : ""; + } + + @Override + public boolean shouldExtract() { + return true; + } + +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/distribution/ElasticsearchDistributionTypes.java b/buildSrc/src/main/java/org/elasticsearch/gradle/distribution/ElasticsearchDistributionTypes.java new file mode 100644 index 0000000000000..0c19e000034a8 --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/distribution/ElasticsearchDistributionTypes.java @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.distribution; + +import org.elasticsearch.gradle.ElasticsearchDistributionType; + +public class ElasticsearchDistributionTypes { + public static ElasticsearchDistributionType ARCHIVE = new ArchiveElasticsearchDistributionType(); + public static ElasticsearchDistributionType INTEG_TEST_ZIP = new IntegTestZipElasticsearchDistributionType(); +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/distribution/IntegTestZipElasticsearchDistributionType.java b/buildSrc/src/main/java/org/elasticsearch/gradle/distribution/IntegTestZipElasticsearchDistributionType.java new file mode 100644 index 0000000000000..441b2c173ec48 --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/distribution/IntegTestZipElasticsearchDistributionType.java @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.distribution; + +import org.elasticsearch.gradle.ElasticsearchDistributionType; + +public class IntegTestZipElasticsearchDistributionType implements ElasticsearchDistributionType { + + IntegTestZipElasticsearchDistributionType() {} + + @Override + public String getName() { + return "integ-test-zip"; + } + + @Override + public boolean shouldExtract() { + return true; + } +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java index 7a2b54a476be4..ac07e48c7f9de 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java @@ -9,10 +9,8 @@ package org.elasticsearch.gradle.internal; import org.codehaus.groovy.runtime.DefaultGroovyMethods; -import org.elasticsearch.gradle.internal.info.BuildParams; import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin; import org.elasticsearch.gradle.internal.precommit.InternalPrecommitTasks; -import org.elasticsearch.gradle.precommit.PrecommitTasks; import org.gradle.api.GradleException; import org.gradle.api.InvalidUserDataException; import org.gradle.api.Plugin; @@ -30,7 +28,6 @@ public class BuildPlugin implements Plugin { public void apply(final Project project) { // make sure the global build info plugin is applied to the root project project.getRootProject().getPluginManager().apply(GlobalBuildInfoPlugin.class); - checkExternalInternalPluginUsages(project); if (project.getPluginManager().hasPlugin("elasticsearch.standalone-rest-test")) { throw new InvalidUserDataException( @@ -43,18 +40,7 @@ public void apply(final Project project) { project.getPluginManager().apply("elasticsearch.publish"); project.getPluginManager().apply(DependenciesInfoPlugin.class); - BuildParams.withInternalBuild(() -> InternalPrecommitTasks.create(project, true)).orElse(() -> PrecommitTasks.create(project)); - - } - - private static void checkExternalInternalPluginUsages(Project project) { - if (BuildParams.isInternal().equals(false)) { - project.getPlugins() - .withType( - InternalPlugin.class, - internalPlugin -> { throw new GradleException(internalPlugin.getExternalUseErrorMessage()); } - ); - } + InternalPrecommitTasks.create(project, true); } public static void configureLicenseAndNotice(final Project project) { diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BwcSetupExtension.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BwcSetupExtension.java index 89677ddee1647..38c1b64c99976 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BwcSetupExtension.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BwcSetupExtension.java @@ -10,6 +10,7 @@ import org.apache.commons.io.FileUtils; import org.apache.tools.ant.taskdefs.condition.Os; +import org.elasticsearch.gradle.LoggedExec; import org.gradle.api.Action; import org.gradle.api.GradleException; import org.gradle.api.Project; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java index fed975db800d3..b42144868641e 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java @@ -9,6 +9,7 @@ import org.elasticsearch.gradle.Architecture; import org.elasticsearch.gradle.Version; +import org.elasticsearch.gradle.VersionProperties; import java.util.ArrayList; import java.util.Collection; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaPlugin.java index 9e33d7d78649d..1de94522cb31c 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaPlugin.java @@ -10,6 +10,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar; import nebula.plugin.info.InfoBrokerPlugin; +import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.internal.info.BuildParams; import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin; import org.elasticsearch.gradle.precommit.PrecommitTaskPlugin; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalBwcGitPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalBwcGitPlugin.java index 0fce348d357ca..d5e410129453c 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalBwcGitPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalBwcGitPlugin.java @@ -9,6 +9,7 @@ package org.elasticsearch.gradle.internal; import org.apache.commons.io.FileUtils; +import org.elasticsearch.gradle.LoggedExec; import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin; import org.gradle.api.Action; import org.gradle.api.GradleException; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPlugin.java index 271429a66e6b0..358fc62cfdd39 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPlugin.java @@ -8,6 +8,7 @@ package org.elasticsearch.gradle.internal; +import org.elasticsearch.gradle.VersionProperties; import org.gradle.api.Action; import org.gradle.api.GradleException; import org.gradle.api.Project; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java index 079161aeca52d..efc7fb8056dd5 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java @@ -9,16 +9,24 @@ package org.elasticsearch.gradle.internal; import org.elasticsearch.gradle.Architecture; +import org.elasticsearch.gradle.DistributionDependency; import org.elasticsearch.gradle.DistributionDownloadPlugin; import org.elasticsearch.gradle.DistributionResolution; import org.elasticsearch.gradle.ElasticsearchDistribution; import org.elasticsearch.gradle.Version; +import org.elasticsearch.gradle.VersionProperties; +import org.elasticsearch.gradle.distribution.ElasticsearchDistributionTypes; +import org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes; +import org.elasticsearch.gradle.internal.docker.DockerSupportPlugin; +import org.elasticsearch.gradle.internal.docker.DockerSupportService; import org.elasticsearch.gradle.internal.info.BuildParams; import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin; +import org.elasticsearch.gradle.util.GradleUtils; import org.gradle.api.GradleException; import org.gradle.api.NamedDomainObjectContainer; import org.gradle.api.Project; import org.gradle.api.artifacts.Dependency; +import org.gradle.api.provider.Provider; import java.util.function.Function; @@ -37,11 +45,15 @@ public class InternalDistributionDownloadPlugin implements InternalPlugin { public void apply(Project project) { // this is needed for isInternal project.getRootProject().getPluginManager().apply(GlobalBuildInfoPlugin.class); - // might be used without the general build plugin so we keep this check for now. - if (BuildParams.isInternal() == false) { - throw new GradleException(getExternalUseErrorMessage()); - } - project.getPluginManager().apply(DistributionDownloadPlugin.class); + project.getRootProject().getPluginManager().apply(DockerSupportPlugin.class); + DistributionDownloadPlugin distributionDownloadPlugin = project.getPlugins().apply(DistributionDownloadPlugin.class); + Provider dockerSupport = GradleUtils.getBuildService( + project.getGradle().getSharedServices(), + DockerSupportPlugin.DOCKER_SUPPORT_SERVICE_NAME + ); + distributionDownloadPlugin.setDockerAvailability( + dockerSupport.map(dockerSupportService -> dockerSupportService.getDockerAvailability().isAvailable) + ); this.bwcVersions = BuildParams.getBwcVersions(); registerInternalDistributionResolutions(DistributionDownloadPlugin.getRegistrationsContainer(project)); } @@ -55,7 +67,6 @@ public void apply(Project project) { * BWC versions are resolved as project to projects under `:distribution:bwc`. */ private void registerInternalDistributionResolutions(NamedDomainObjectContainer resolutions) { - resolutions.register("localBuild", distributionResolution -> distributionResolution.setResolver((project, distribution) -> { if (VersionProperties.getElasticsearch().equals(distribution.getVersion())) { // non-external project, so depend on local build @@ -97,29 +108,20 @@ private static String getProjectConfig(ElasticsearchDistribution distribution, B : "expanded-" + distributionProjectName; } else { return distributionProjectName; - } } private static String distributionProjectPath(ElasticsearchDistribution distribution) { String projectPath = ":distribution"; - switch (distribution.getType()) { - case INTEG_TEST_ZIP: - projectPath += ":archives:integ-test-zip"; - break; - - case DOCKER: - case DOCKER_UBI: - case DOCKER_IRON_BANK: - projectPath += ":docker:"; - projectPath += distributionProjectName(distribution); - break; - - default: - projectPath += distribution.getType() == ElasticsearchDistribution.Type.ARCHIVE ? ":archives:" : ":packages:"; - projectPath += distributionProjectName(distribution); - break; + if (distribution.getType() == ElasticsearchDistributionTypes.INTEG_TEST_ZIP) { + projectPath += ":archives:integ-test-zip"; + } else if (distribution.getType().isDocker()) { + projectPath += ":docker:"; + projectPath += distributionProjectName(distribution); + } else { + projectPath += distribution.getType() == ElasticsearchDistributionTypes.ARCHIVE ? ":archives:" : ":packages:"; + projectPath += distributionProjectName(distribution); } return projectPath; } @@ -149,28 +151,25 @@ private static String distributionProjectName(ElasticsearchDistribution distribu projectName += "no-jdk-"; } - switch (distribution.getType()) { - case ARCHIVE: - if (Version.fromString(distribution.getVersion()).onOrAfter("7.0.0")) { - return projectName + platform.toString() + archString + (platform == ElasticsearchDistribution.Platform.WINDOWS - ? "-zip" - : "-tar"); - } else { - return "zip"; - } - - case DOCKER: - return projectName + "docker" + archString + "-export"; - - case DOCKER_UBI: - return projectName + "ubi-docker" + archString + "-export"; - - case DOCKER_IRON_BANK: - return projectName + "ironbank-docker" + archString + "-export"; - - default: - return projectName + distribution.getType(); + if (distribution.getType() == ElasticsearchDistributionTypes.ARCHIVE) { + if (Version.fromString(distribution.getVersion()).onOrAfter("7.0.0")) { + return projectName + platform.toString() + archString + (platform == ElasticsearchDistribution.Platform.WINDOWS + ? "-zip" + : "-tar"); + } else { + return "zip"; + } + } + if (distribution.getType() == InternalElasticsearchDistributionTypes.DOCKER) { + return projectName + "docker" + archString + "-export"; + } + if (distribution.getType() == InternalElasticsearchDistributionTypes.DOCKER_UBI) { + return projectName + "ubi-docker" + archString + "-export"; + } + if (distribution.getType() == InternalElasticsearchDistributionTypes.DOCKER_IRONBANK) { + return projectName + "ironbank-docker" + archString + "-export"; } + return projectName + distribution.getType().getName(); } private static class ProjectBasedDistributionDependency implements DistributionDependency { diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalPluginBuildPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalPluginBuildPlugin.java new file mode 100644 index 0000000000000..e6285626999e3 --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalPluginBuildPlugin.java @@ -0,0 +1,105 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal; + +import groovy.lang.Closure; +import org.elasticsearch.gradle.internal.precommit.TestingConventionsTasks; +import org.elasticsearch.gradle.internal.test.RestTestBasePlugin; +import org.elasticsearch.gradle.internal.util.Util; +import org.elasticsearch.gradle.plugin.PluginBuildPlugin; +import org.elasticsearch.gradle.plugin.PluginPropertiesExtension; +import org.elasticsearch.gradle.util.GradleUtils; +import org.gradle.api.Project; +import org.gradle.api.tasks.bundling.Zip; + +import java.util.Optional; + +public class InternalPluginBuildPlugin implements InternalPlugin { + @Override + public void apply(Project project) { + project.getPluginManager().apply(BuildPlugin.class); + project.getPluginManager().apply(PluginBuildPlugin.class); + // Clear default dependencies added by public PluginBuildPlugin as we add our + // own project dependencies for internal builds + // TODO remove once we removed default dependencies from PluginBuildPlugin + project.getConfigurations().getByName("compileOnly").getDependencies().clear(); + project.getConfigurations().getByName("testImplementation").getDependencies().clear(); + + project.getPluginManager().apply(RestTestBasePlugin.class); + var extension = project.getExtensions().getByType(PluginPropertiesExtension.class); + + // We've ported this from multiple build scripts where we see this pattern into + // an extension method as a first step of consolidation. + // We might want to port this into a general pattern later on. + project.getExtensions() + .getExtraProperties() + .set("addQaCheckDependencies", new Closure(InternalPluginBuildPlugin.this, InternalPluginBuildPlugin.this) { + public void doCall(Object it) { + project.afterEvaluate(project1 -> { + // let check depend on check tasks of qa sub-projects + final var checkTaskProvider = project1.getTasks().named("check"); + Optional qaSubproject = project1.getSubprojects() + .stream() + .filter(p -> p.getPath().equals(project1.getPath() + ":qa")) + .findFirst(); + qaSubproject.ifPresent( + qa -> qa.getSubprojects() + .forEach(p -> checkTaskProvider.configure(task -> task.dependsOn(p.getPath() + ":check"))) + ); + }); + } + + public void doCall() { + doCall(null); + } + }); + + project.getTasks().withType(TestingConventionsTasks.class).named("testingConventions").configure(t -> { + t.getNaming().clear(); + t.getNaming() + .create("Tests", testingConventionRule -> testingConventionRule.baseClass("org.apache.lucene.util.LuceneTestCase")); + t.getNaming().create("IT", testingConventionRule -> { + testingConventionRule.baseClass("org.elasticsearch.test.ESIntegTestCase"); + testingConventionRule.baseClass("org.elasticsearch.test.rest.ESRestTestCase"); + testingConventionRule.baseClass("org.elasticsearch.test.ESSingleNodeTestCase"); + }); + }); + + project.afterEvaluate(p -> { + boolean isModule = GradleUtils.isModuleProject(p.getPath()); + boolean isXPackModule = isModule && p.getPath().startsWith(":x-pack"); + if (isModule == false || isXPackModule) { + addNoticeGeneration(p, extension); + } + }); + } + + /** + * Configure the pom for the main jar of this plugin + */ + protected static void addNoticeGeneration(final Project project, PluginPropertiesExtension extension) { + final var licenseFile = extension.getLicenseFile(); + var tasks = project.getTasks(); + if (licenseFile != null) { + tasks.withType(Zip.class).named("bundlePlugin").configure(zip -> zip.from(licenseFile.getParentFile(), copySpec -> { + copySpec.include(licenseFile.getName()); + copySpec.rename(s -> "LICENSE.txt"); + })); + } + + final var noticeFile = extension.getNoticeFile(); + if (noticeFile != null) { + final var generateNotice = tasks.register("generateNotice", NoticeTask.class, noticeTask -> { + noticeTask.setInputFile(noticeFile); + noticeTask.source(Util.getJavaMainSourceSet(project).get().getAllJava()); + }); + tasks.withType(Zip.class).named("bundlePlugin").configure(task -> task.from(generateNotice)); + } + } +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalReaperPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalReaperPlugin.java new file mode 100644 index 0000000000000..9ed0afff9807b --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalReaperPlugin.java @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.file.ProjectLayout; + +import javax.inject.Inject; + +import static org.elasticsearch.gradle.ReaperPlugin.registerReaperService; + +public class InternalReaperPlugin implements Plugin { + private final ProjectLayout projectLayout; + + @Inject + public InternalReaperPlugin(ProjectLayout projectLayout) { + this.projectLayout = projectLayout; + } + + @Override + public void apply(Project project) { + registerReaperService(project, projectLayout, true); + } +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalTestClustersPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalTestClustersPlugin.java new file mode 100644 index 0000000000000..1d0eff0b3aa70 --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/InternalTestClustersPlugin.java @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal; + +import org.elasticsearch.gradle.internal.info.BuildParams; +import org.elasticsearch.gradle.testclusters.TestClustersPlugin; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.provider.ProviderFactory; + +import javax.inject.Inject; + +public class InternalTestClustersPlugin implements Plugin { + + private ProviderFactory providerFactory; + + @Inject + public InternalTestClustersPlugin(ProviderFactory providerFactory) { + this.providerFactory = providerFactory; + } + + @Override + public void apply(Project project) { + project.getPlugins().apply(InternalDistributionDownloadPlugin.class); + project.getRootProject().getPluginManager().apply(InternalReaperPlugin.class); + TestClustersPlugin testClustersPlugin = project.getPlugins().apply(TestClustersPlugin.class); + testClustersPlugin.setRuntimeJava(providerFactory.provider(() -> BuildParams.getRuntimeJavaHome())); + } + +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/NoticeTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/NoticeTask.java similarity index 99% rename from buildSrc/src/main/java/org/elasticsearch/gradle/NoticeTask.java rename to buildSrc/src/main/java/org/elasticsearch/gradle/internal/NoticeTask.java index 9308321335e5c..b51f0603833a8 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/NoticeTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/NoticeTask.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.gradle; +package org.elasticsearch.gradle.internal; import org.codehaus.groovy.runtime.StringGroovyMethods; import org.gradle.api.DefaultTask; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/RepositoriesSetupPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/RepositoriesSetupPlugin.java index 856b300754c9a..21332013a6ce8 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/RepositoriesSetupPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/RepositoriesSetupPlugin.java @@ -8,6 +8,7 @@ package org.elasticsearch.gradle.internal; +import org.elasticsearch.gradle.VersionProperties; import org.gradle.api.GradleException; import org.gradle.api.Plugin; import org.gradle.api.Project; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DebElasticsearchDistributionType.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DebElasticsearchDistributionType.java new file mode 100644 index 0000000000000..9b8d1952093d0 --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DebElasticsearchDistributionType.java @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.distribution; + +import org.elasticsearch.gradle.ElasticsearchDistribution; +import org.elasticsearch.gradle.ElasticsearchDistributionType; +import org.elasticsearch.gradle.Version; + +public class DebElasticsearchDistributionType implements ElasticsearchDistributionType { + + DebElasticsearchDistributionType() {} + + @Override + public String getName() { + return "deb"; + } + + @Override + public String getClassifier(ElasticsearchDistribution.Platform platform, Version version) { + return version.onOrAfter("7.0.0") ? ":amd64" : ""; + } + +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerElasticsearchDistributionType.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerElasticsearchDistributionType.java new file mode 100644 index 0000000000000..439ec23481f75 --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerElasticsearchDistributionType.java @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.distribution; + +import org.elasticsearch.gradle.ElasticsearchDistributionType; + +public class DockerElasticsearchDistributionType implements ElasticsearchDistributionType { + + DockerElasticsearchDistributionType() {} + + @Override + public String getName() { + return "docker"; + } + + @Override + public boolean isDocker() { + return true; + } +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerIronBankElasticsearchDistributionType.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerIronBankElasticsearchDistributionType.java new file mode 100644 index 0000000000000..e261cf3b5925a --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerIronBankElasticsearchDistributionType.java @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.distribution; + +import org.elasticsearch.gradle.ElasticsearchDistributionType; + +public class DockerIronBankElasticsearchDistributionType implements ElasticsearchDistributionType { + + DockerIronBankElasticsearchDistributionType() {} + + @Override + public String getName() { + return "dockerIronBank"; + } + + @Override + public boolean isDocker() { + return true; + } +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerUbiElasticsearchDistributionType.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerUbiElasticsearchDistributionType.java new file mode 100644 index 0000000000000..65f4e3e9e4858 --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerUbiElasticsearchDistributionType.java @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.distribution; + +import org.elasticsearch.gradle.ElasticsearchDistributionType; + +public class DockerUbiElasticsearchDistributionType implements ElasticsearchDistributionType { + + DockerUbiElasticsearchDistributionType() {} + + @Override + public String getName() { + return "dockerUbi"; + } + + @Override + public boolean isDocker() { + return true; + } +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/InternalElasticsearchDistributionTypes.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/InternalElasticsearchDistributionTypes.java new file mode 100644 index 0000000000000..5977091d1ab28 --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/InternalElasticsearchDistributionTypes.java @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.distribution; + +import org.elasticsearch.gradle.ElasticsearchDistributionType; + +import java.util.List; + +public class InternalElasticsearchDistributionTypes { + public static ElasticsearchDistributionType DEB = new DebElasticsearchDistributionType(); + public static ElasticsearchDistributionType RPM = new RpmElasticsearchDistributionType(); + public static ElasticsearchDistributionType DOCKER = new DockerElasticsearchDistributionType(); + public static ElasticsearchDistributionType DOCKER_UBI = new DockerUbiElasticsearchDistributionType(); + public static ElasticsearchDistributionType DOCKER_IRONBANK = new DockerIronBankElasticsearchDistributionType(); + + public static List ALL_INTERNAL = List.of(DEB, RPM, DOCKER, DOCKER_UBI, DOCKER_IRONBANK); +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/RpmElasticsearchDistributionType.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/RpmElasticsearchDistributionType.java new file mode 100644 index 0000000000000..a23cac67a7031 --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/distribution/RpmElasticsearchDistributionType.java @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.distribution; + +import org.elasticsearch.gradle.ElasticsearchDistributionType; + +public class RpmElasticsearchDistributionType implements ElasticsearchDistributionType { + + RpmElasticsearchDistributionType() {} + + @Override + public String getName() { + return "rpm"; + } + + @Override + public boolean shouldExtract() { + return false; + } + + @Override + public boolean isDocker() { + return false; + } +} diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/docker/DockerBuildTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/docker/DockerBuildTask.java index 2147d35498ce4..e06253a3d9591 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/docker/DockerBuildTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/docker/DockerBuildTask.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.gradle.internal.docker; -import org.elasticsearch.gradle.internal.LoggedExec; +import org.elasticsearch.gradle.LoggedExec; import org.gradle.api.DefaultTask; import org.gradle.api.GradleException; import org.gradle.api.file.DirectoryProperty; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/CheckstylePrecommitPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/CheckstylePrecommitPlugin.java index b888863e33fa5..b03a0d2c50532 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/CheckstylePrecommitPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/CheckstylePrecommitPlugin.java @@ -8,7 +8,7 @@ package org.elasticsearch.gradle.internal.precommit; -import org.elasticsearch.gradle.internal.VersionProperties; +import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.internal.InternalPlugin; import org.elasticsearch.gradle.precommit.PrecommitPlugin; import org.elasticsearch.gradle.internal.util.Util; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/InternalPrecommitTasks.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/InternalPrecommitTasks.java index 917723267e5e0..d74c03fc161c1 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/InternalPrecommitTasks.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/InternalPrecommitTasks.java @@ -8,6 +8,7 @@ package org.elasticsearch.gradle.internal.precommit; +import org.elasticsearch.gradle.internal.info.BuildParams; import org.elasticsearch.gradle.precommit.PrecommitTasks; import org.gradle.api.Project; @@ -21,7 +22,12 @@ public class InternalPrecommitTasks { */ public static void create(Project project, boolean includeDependencyLicenses) { PrecommitTasks.create(project); - + if (BuildParams.isInternal() && project.getPath().equals(":libs:elasticsearch-core") == false) { + // ideally we would configure this as a default dependency. But Default dependencies do not work correctly + // with gradle project dependencies as they're resolved to late in the build and don't setup according task + // dependencies properly + project.getDependencies().add("jarHell", project.project(":libs:elasticsearch-core")); + } project.getPluginManager().apply(ThirdPartyAuditPrecommitPlugin.class); project.getPluginManager().apply(CheckstylePrecommitPlugin.class); project.getPluginManager().apply(ForbiddenApisPrecommitPlugin.class); diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/LoggerUsagePrecommitPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/LoggerUsagePrecommitPlugin.java index e359c5f57b77c..1f1e458f97cd2 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/LoggerUsagePrecommitPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/LoggerUsagePrecommitPlugin.java @@ -19,7 +19,11 @@ public class LoggerUsagePrecommitPlugin extends PrecommitPlugin implements Inter @Override public TaskProvider createTask(Project project) { Configuration loggerUsageConfig = project.getConfigurations().create("loggerUsagePlugin"); - project.getDependencies().add("loggerUsagePlugin", project.project(":test:logger-usage")); + // this makes it easier to test by not requiring this project to be always available in our + // test sample projects + if (project.findProject(":test:logger-usage") != null) { + project.getDependencies().add("loggerUsagePlugin", project.project(":test:logger-usage")); + } TaskProvider loggerUsage = project.getTasks().register("loggerUsageCheck", LoggerUsageTask.class); loggerUsage.configure(t -> t.setClasspath(loggerUsageConfig)); return loggerUsage; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/LoggerUsageTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/LoggerUsageTask.java index 1e44df539e2ba..89020f87e2970 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/LoggerUsageTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/precommit/LoggerUsageTask.java @@ -8,7 +8,7 @@ package org.elasticsearch.gradle.internal.precommit; -import org.elasticsearch.gradle.internal.LoggedExec; +import org.elasticsearch.gradle.LoggedExec; import org.elasticsearch.gradle.precommit.PrecommitTask; import org.gradle.api.file.FileCollection; import org.gradle.api.plugins.JavaPluginConvention; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/DistroTestPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/DistroTestPlugin.java index 76d3788a7b6d7..f19c02f81c037 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/DistroTestPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/DistroTestPlugin.java @@ -12,11 +12,11 @@ import org.elasticsearch.gradle.DistributionDownloadPlugin; import org.elasticsearch.gradle.ElasticsearchDistribution; import org.elasticsearch.gradle.ElasticsearchDistribution.Platform; -import org.elasticsearch.gradle.ElasticsearchDistribution.Type; +import org.elasticsearch.gradle.ElasticsearchDistributionType; import org.elasticsearch.gradle.internal.Jdk; import org.elasticsearch.gradle.internal.JdkDownloadPlugin; import org.elasticsearch.gradle.Version; -import org.elasticsearch.gradle.internal.VersionProperties; +import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.internal.docker.DockerSupportPlugin; import org.elasticsearch.gradle.internal.docker.DockerSupportService; import org.elasticsearch.gradle.internal.info.BuildParams; @@ -49,6 +49,13 @@ import java.util.function.Supplier; import java.util.stream.Stream; +import static org.elasticsearch.gradle.distribution.ElasticsearchDistributionTypes.ARCHIVE; +import static org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes.ALL_INTERNAL; +import static org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes.DEB; +import static org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes.DOCKER; +import static org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes.DOCKER_IRONBANK; +import static org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes.DOCKER_UBI; +import static org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes.RPM; import static org.elasticsearch.gradle.internal.vagrant.VagrantMachine.convertLinuxPath; import static org.elasticsearch.gradle.internal.vagrant.VagrantMachine.convertWindowsPath; @@ -88,7 +95,7 @@ public void apply(Project project) { NamedDomainObjectContainer allDistributions = DistributionDownloadPlugin.getContainer(project); List testDistributions = configureDistributions(project); - Map> lifecycleTasks = lifecycleTasks(project, "destructiveDistroTest"); + Map> lifecycleTasks = lifecycleTasks(project, "destructiveDistroTest"); Map> versionTasks = versionTasks(project, "destructiveDistroUpgradeTest"); TaskProvider destructiveDistroTest = project.getTasks().register("destructiveDistroTest"); @@ -96,7 +103,7 @@ public void apply(Project project) { Configuration quotaAwareFsPlugin = configureQuotaAwareFsPlugin(project); List> windowsTestTasks = new ArrayList<>(); - Map>> linuxTestTasks = new HashMap<>(); + Map>> linuxTestTasks = new HashMap<>(); Map>> upgradeTestTasks = new HashMap<>(); Map> depsTasks = new HashMap<>(); @@ -122,7 +129,7 @@ public void apply(Project project) { destructiveDistroTest.configure(t -> t.dependsOn(destructiveTask)); lifecycleTasks.get(distribution.getType()).configure(t -> t.dependsOn(destructiveTask)); - if ((distribution.getType() == Type.DEB || distribution.getType() == Type.RPM) && distribution.getBundledJdk()) { + if ((distribution.getType() == DEB || distribution.getType() == RPM) && distribution.getBundledJdk()) { for (Version version : BuildParams.getBwcVersions().getIndexCompatible()) { final ElasticsearchDistribution bwcDistro; if (version.equals(Version.fromString(distribution.getVersion()))) { @@ -171,7 +178,7 @@ public void apply(Project project) { project.getConfigurations().getByName("testRuntimeClasspath") ); - Map> vmLifecyleTasks = lifecycleTasks(vmProject, "distroTest"); + Map> vmLifecyleTasks = lifecycleTasks(vmProject, "distroTest"); Map> vmVersionTasks = versionTasks(vmProject, "distroUpgradeTest"); TaskProvider distroTest = vmProject.getTasks().register("distroTest"); @@ -181,12 +188,12 @@ public void apply(Project project) { vmProject, windowsTestTasks, depsTasks, - wrapperTask -> { vmLifecyleTasks.get(Type.ARCHIVE).configure(t -> t.dependsOn(wrapperTask)); }, + wrapperTask -> { vmLifecyleTasks.get(ARCHIVE).configure(t -> t.dependsOn(wrapperTask)); }, vmDependencies ); } else { for (var entry : linuxTestTasks.entrySet()) { - Type type = entry.getKey(); + ElasticsearchDistributionType type = entry.getKey(); TaskProvider vmLifecycleTask = vmLifecyleTasks.get(type); configureVMWrapperTasks(vmProject, entry.getValue(), depsTasks, wrapperTask -> { vmLifecycleTask.configure(t -> t.dependsOn(wrapperTask)); @@ -222,14 +229,14 @@ public void apply(Project project) { }); } - private static Map> lifecycleTasks(Project project, String taskPrefix) { - Map> lifecyleTasks = new HashMap<>(); - lifecyleTasks.put(Type.DOCKER, project.getTasks().register(taskPrefix + ".docker")); - lifecyleTasks.put(Type.DOCKER_UBI, project.getTasks().register(taskPrefix + ".docker-ubi")); - lifecyleTasks.put(Type.DOCKER_IRON_BANK, project.getTasks().register(taskPrefix + ".docker-ironbank")); - lifecyleTasks.put(Type.ARCHIVE, project.getTasks().register(taskPrefix + ".archives")); - lifecyleTasks.put(Type.DEB, project.getTasks().register(taskPrefix + ".packages")); - lifecyleTasks.put(Type.RPM, lifecyleTasks.get(Type.DEB)); + private static Map> lifecycleTasks(Project project, String taskPrefix) { + Map> lifecyleTasks = new HashMap<>(); + lifecyleTasks.put(DOCKER, project.getTasks().register(taskPrefix + ".docker")); + lifecyleTasks.put(DOCKER_UBI, project.getTasks().register(taskPrefix + ".docker-ubi")); + lifecyleTasks.put(DOCKER_IRONBANK, project.getTasks().register(taskPrefix + ".docker-ironbank")); + lifecyleTasks.put(ARCHIVE, project.getTasks().register(taskPrefix + ".archives")); + lifecyleTasks.put(DEB, project.getTasks().register(taskPrefix + ".packages")); + lifecyleTasks.put(RPM, lifecyleTasks.get(DEB)); return lifecyleTasks; } @@ -363,7 +370,7 @@ private List configureDistributions(Project project) List currentDistros = new ArrayList<>(); for (Architecture architecture : Architecture.values()) { - Arrays.stream(Type.values()).filter(t -> t != Type.INTEG_TEST_ZIP && t != Type.ARCHIVE).forEach(type -> { + ALL_INTERNAL.stream().forEach(type -> { for (boolean bundledJdk : Arrays.asList(true, false)) { if (bundledJdk == false) { // We'll never publish an ARM (aarch64) build without a bundled JDK. @@ -392,7 +399,7 @@ private List configureDistributions(Project project) } currentDistros.add( - createDistro(distributions, architecture, Type.ARCHIVE, platform, bundledJdk, VersionProperties.getElasticsearch()) + createDistro(distributions, architecture, ARCHIVE, platform, bundledJdk, VersionProperties.getElasticsearch()) ); } } @@ -404,7 +411,7 @@ private List configureDistributions(Project project) private static ElasticsearchDistribution createDistro( NamedDomainObjectContainer distributions, Architecture architecture, - Type type, + ElasticsearchDistributionType type, Platform platform, boolean bundledJdk, String version @@ -414,7 +421,7 @@ private static ElasticsearchDistribution createDistro( ElasticsearchDistribution distro = distributions.create(name, d -> { d.setArchitecture(architecture); d.setType(type); - if (type == Type.ARCHIVE) { + if (type == ARCHIVE) { d.setPlatform(platform); } if (isDocker == false) { @@ -437,21 +444,21 @@ private static boolean isWindows(Project project) { return project.getName().contains("windows"); } - private static String distroId(Type type, Platform platform, boolean bundledJdk, Architecture architecture) { + private static String distroId(ElasticsearchDistributionType type, Platform platform, boolean bundledJdk, Architecture architecture) { return "default-" - + (type == Type.ARCHIVE ? platform + "-" : "") - + type + + (type == ARCHIVE ? platform + "-" : "") + + type.getName() + (bundledJdk ? "" : "-no-jdk") + (architecture == Architecture.X64 ? "" : "-" + architecture.toString().toLowerCase()); } private static String destructiveDistroTestTaskName(ElasticsearchDistribution distro) { - Type type = distro.getType(); + ElasticsearchDistributionType type = distro.getType(); return "destructiveDistroTest." + distroId(type, distro.getPlatform(), distro.getBundledJdk(), distro.getArchitecture()); } private static String destructiveDistroUpgradeTestTaskName(ElasticsearchDistribution distro, String bwcVersion) { - Type type = distro.getType(); + ElasticsearchDistributionType type = distro.getType(); return "destructiveDistroUpgradeTest.v" + bwcVersion + "." diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/RestTestPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/RestTestPlugin.java index e29f370aff846..b396879371d2e 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/RestTestPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/RestTestPlugin.java @@ -9,12 +9,10 @@ package org.elasticsearch.gradle.internal.test; import org.elasticsearch.gradle.internal.BuildPlugin; -import org.elasticsearch.gradle.testclusters.TestClustersPlugin; -import org.gradle.api.Action; +import org.elasticsearch.gradle.internal.InternalTestClustersPlugin; import org.gradle.api.InvalidUserDataException; import org.gradle.api.Plugin; import org.gradle.api.Project; -import org.gradle.api.Task; import org.gradle.api.plugins.JavaBasePlugin; import java.util.Arrays; @@ -37,17 +35,12 @@ public void apply(final Project project) { ); } project.getPlugins().apply(RestTestBasePlugin.class); - project.getPluginManager().apply(TestClustersPlugin.class); + project.getPluginManager().apply(InternalTestClustersPlugin.class); final var integTest = project.getTasks().register("integTest", RestIntegTestTask.class, task -> { task.setDescription("Runs rest tests against an elasticsearch cluster."); task.setGroup(JavaBasePlugin.VERIFICATION_GROUP); task.mustRunAfter(project.getTasks().named("precommit")); }); - project.getTasks().named("check").configure(new Action() { - @Override - public void execute(Task task) { - task.dependsOn(integTest); - } - }); + project.getTasks().named("check").configure(task -> task.dependsOn(integTest)); } } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/CopyRestApiTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/CopyRestApiTask.java index 919ee05030436..80096039258d1 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/CopyRestApiTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/CopyRestApiTask.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.gradle.internal.test.rest; -import org.elasticsearch.gradle.internal.VersionProperties; +import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.internal.info.BuildParams; import org.gradle.api.DefaultTask; import org.gradle.api.file.ArchiveOperations; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/CopyRestTestsTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/CopyRestTestsTask.java index 7c222baa79fd9..a45ef6e0168a9 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/CopyRestTestsTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/CopyRestTestsTask.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.gradle.internal.test.rest; -import org.elasticsearch.gradle.internal.VersionProperties; +import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.internal.info.BuildParams; import org.gradle.api.DefaultTask; import org.gradle.api.file.ArchiveOperations; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/JavaRestTestPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/JavaRestTestPlugin.java index 4f4ae201cb162..1886bb0e6f168 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/JavaRestTestPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/JavaRestTestPlugin.java @@ -9,9 +9,9 @@ package org.elasticsearch.gradle.internal.test.rest; import org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin; +import org.elasticsearch.gradle.internal.InternalTestClustersPlugin; import org.elasticsearch.gradle.internal.test.RestIntegTestTask; import org.elasticsearch.gradle.internal.test.RestTestBasePlugin; -import org.elasticsearch.gradle.testclusters.TestClustersPlugin; import org.elasticsearch.gradle.util.GradleUtils; import org.gradle.api.Plugin; import org.gradle.api.Project; @@ -33,10 +33,9 @@ public class JavaRestTestPlugin implements Plugin { @Override public void apply(Project project) { - project.getPluginManager().apply(ElasticsearchJavaPlugin.class); project.getPluginManager().apply(RestTestBasePlugin.class); - project.getPluginManager().apply(TestClustersPlugin.class); + project.getPluginManager().apply(InternalTestClustersPlugin.class); // create source set SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestResourcesPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestResourcesPlugin.java index 7666776eebca4..caf18d6a80c70 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestResourcesPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestResourcesPlugin.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.gradle.internal.test.rest; -import org.elasticsearch.gradle.internal.VersionProperties; +import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.internal.info.BuildParams; import org.gradle.api.Plugin; import org.gradle.api.Project; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestUtil.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestUtil.java index 9ef88e47afe27..7ed0376f88784 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestUtil.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestUtil.java @@ -8,7 +8,7 @@ package org.elasticsearch.gradle.internal.test.rest; -import org.elasticsearch.gradle.internal.VersionProperties; +import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.internal.info.BuildParams; import org.elasticsearch.gradle.internal.test.RestIntegTestTask; import org.elasticsearch.gradle.testclusters.ElasticsearchCluster; @@ -42,7 +42,7 @@ static ElasticsearchCluster createTestCluster(Project project, SourceSet sourceS /** * Creates a task with the source set name of type {@link RestIntegTestTask} */ - static Provider registerTask(Project project, SourceSet sourceSet) { + public static Provider registerTask(Project project, SourceSet sourceSet) { // lazily create the test task Provider testProvider = project.getTasks().register(sourceSet.getName(), RestIntegTestTask.class, testTask -> { testTask.setGroup(JavaBasePlugin.VERIFICATION_GROUP); @@ -51,7 +51,7 @@ static Provider registerTask(Project project, SourceSet sourc testTask.setTestClassesDirs(sourceSet.getOutput().getClassesDirs()); testTask.setClasspath(sourceSet.getRuntimeClasspath()); // if this a module or plugin, it may have an associated zip file with it's contents, add that to the test cluster - project.getPluginManager().withPlugin("elasticsearch.esplugin", plugin -> { + project.getPluginManager().withPlugin("elasticsearch.internal-es-plugin", plugin -> { TaskProvider bundle = project.getTasks().withType(Zip.class).named("bundlePlugin"); testTask.dependsOn(bundle); if (GradleUtils.isModuleProject(project.getPath())) { @@ -68,7 +68,7 @@ static Provider registerTask(Project project, SourceSet sourc /** * Setup the dependencies needed for the REST tests. */ - static void setupDependencies(Project project, SourceSet sourceSet) { + public static void setupDependencies(Project project, SourceSet sourceSet) { BuildParams.withInternalBuild( () -> { project.getDependencies().add(sourceSet.getImplementationConfigurationName(), project.project(":test:framework")); } ).orElse(() -> { diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/vagrant/VagrantBasePlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/vagrant/VagrantBasePlugin.java index c168e015acd91..f61272374a85d 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/vagrant/VagrantBasePlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/vagrant/VagrantBasePlugin.java @@ -9,6 +9,7 @@ package org.elasticsearch.gradle.internal.vagrant; import org.elasticsearch.gradle.ReaperPlugin; +import org.elasticsearch.gradle.internal.InternalReaperPlugin; import org.elasticsearch.gradle.util.GradleUtils; import org.gradle.api.Plugin; import org.gradle.api.Project; @@ -32,7 +33,7 @@ public class VagrantBasePlugin implements Plugin { public void apply(Project project) { project.getRootProject().getPluginManager().apply(VagrantSetupCheckerPlugin.class); project.getRootProject().getPluginManager().apply(VagrantManagerPlugin.class); - project.getRootProject().getPluginManager().apply(ReaperPlugin.class); + project.getRootProject().getPluginManager().apply(InternalReaperPlugin.class); var reaperServiceProvider = GradleUtils.getBuildService(project.getGradle().getSharedServices(), ReaperPlugin.REAPER_SERVICE_NAME); var extension = project.getExtensions().create("vagrant", VagrantExtension.class, project); diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/vagrant/VagrantMachine.java b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/vagrant/VagrantMachine.java index a3a11c438d2b5..757db5719f238 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/internal/vagrant/VagrantMachine.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/internal/vagrant/VagrantMachine.java @@ -9,7 +9,7 @@ package org.elasticsearch.gradle.internal.vagrant; import org.apache.commons.io.output.TeeOutputStream; -import org.elasticsearch.gradle.internal.LoggedExec; +import org.elasticsearch.gradle.LoggedExec; import org.elasticsearch.gradle.internal.LoggingOutputStream; import org.elasticsearch.gradle.ReaperService; import org.elasticsearch.gradle.internal.util.Util; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/plugin/PluginBuildPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/plugin/PluginBuildPlugin.java index 91a49eb1bbafe..2efef63197c3e 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/plugin/PluginBuildPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/plugin/PluginBuildPlugin.java @@ -12,19 +12,14 @@ import groovy.lang.Closure; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; -import org.elasticsearch.gradle.internal.BuildPlugin; -import org.elasticsearch.gradle.NoticeTask; import org.elasticsearch.gradle.Version; -import org.elasticsearch.gradle.internal.VersionProperties; +import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.dependencies.CompileOnlyResolvePlugin; -import org.elasticsearch.gradle.internal.info.BuildParams; -import org.elasticsearch.gradle.internal.precommit.TestingConventionsTasks; -import org.elasticsearch.gradle.internal.test.RestTestBasePlugin; +import org.elasticsearch.gradle.precommit.PrecommitTasks; import org.elasticsearch.gradle.testclusters.ElasticsearchCluster; import org.elasticsearch.gradle.testclusters.RunTask; import org.elasticsearch.gradle.testclusters.TestClustersPlugin; import org.elasticsearch.gradle.util.GradleUtils; -import org.elasticsearch.gradle.internal.util.Util; import org.gradle.api.Action; import org.gradle.api.GradleException; import org.gradle.api.InvalidUserDataException; @@ -36,6 +31,7 @@ import org.gradle.api.file.RegularFile; import org.gradle.api.plugins.BasePlugin; import org.gradle.api.plugins.BasePluginConvention; +import org.gradle.api.plugins.JavaPlugin; import org.gradle.api.plugins.JavaPluginExtension; import org.gradle.api.provider.Provider; import org.gradle.api.publish.PublishingExtension; @@ -54,7 +50,6 @@ import java.nio.charset.StandardCharsets; import java.util.LinkedHashMap; import java.util.Map; -import java.util.Optional; import java.util.stream.Collectors; /** @@ -63,15 +58,15 @@ public class PluginBuildPlugin implements Plugin { @Override public void apply(final Project project) { - project.getPluginManager().apply(BuildPlugin.class); - project.getPluginManager().apply(RestTestBasePlugin.class); + PrecommitTasks.create(project); + project.getPluginManager().apply(JavaPlugin.class); + project.getPluginManager().apply(TestClustersPlugin.class); project.getPluginManager().apply(CompileOnlyResolvePlugin.class); var extension = project.getExtensions().create(PLUGIN_EXTENSION_NAME, PluginPropertiesExtension.class, project); configureDependencies(project); final var bundleTask = createBundleTasks(project, extension); - project.afterEvaluate(project1 -> { project1.getExtensions().getByType(PluginPropertiesExtension.class).getExtendedPlugins().forEach(pluginName -> { // Auto add dependent modules to the test cluster @@ -115,54 +110,7 @@ public void apply(final Project project) { copy.expand(map); copy.getInputs().properties(map); }); - BuildParams.withInternalBuild(() -> { - boolean isModule = GradleUtils.isModuleProject(project1.getPath()); - boolean isXPackModule = isModule && project1.getPath().startsWith(":x-pack"); - if (isModule == false || isXPackModule) { - addNoticeGeneration(project1, extension1); - } - }); - }); - - BuildParams.withInternalBuild(() -> { - // We've ported this from multiple build scripts where we see this pattern into - // an extension method as a first step of consolidation. - // We might want to port this into a general pattern later on. - project.getExtensions() - .getExtraProperties() - .set("addQaCheckDependencies", new Closure(PluginBuildPlugin.this, PluginBuildPlugin.this) { - public void doCall(Object it) { - project.afterEvaluate(project1 -> { - // let check depend on check tasks of qa sub-projects - final var checkTaskProvider = project1.getTasks().named("check"); - Optional qaSubproject = project1.getSubprojects() - .stream() - .filter(p -> p.getPath().equals(project1.getPath() + ":qa")) - .findFirst(); - qaSubproject.ifPresent( - qa -> qa.getSubprojects() - .forEach(p -> checkTaskProvider.configure(task -> task.dependsOn(p.getPath() + ":check"))) - ); - }); - } - - public void doCall() { - doCall(null); - } - }); - - project.getTasks().withType(TestingConventionsTasks.class).named("testingConventions").configure(t -> { - t.getNaming().clear(); - t.getNaming() - .create("Tests", testingConventionRule -> testingConventionRule.baseClass("org.apache.lucene.util.LuceneTestCase")); - t.getNaming().create("IT", testingConventionRule -> { - testingConventionRule.baseClass("org.elasticsearch.test.ESIntegTestCase"); - testingConventionRule.baseClass("org.elasticsearch.test.rest.ESRestTestCase"); - testingConventionRule.baseClass("org.elasticsearch.test.ESSingleNodeTestCase"); - }); - }); }); - project.getConfigurations().getByName("default").extendsFrom(project.getConfigurations().getByName("runtimeClasspath")); // allow running ES with this plugin in the foreground of a build @@ -209,13 +157,8 @@ private static void configurePublishing(Project project, PluginPropertiesExtensi private static void configureDependencies(final Project project) { var dependencies = project.getDependencies(); - if (BuildParams.isInternal()) { - dependencies.add("compileOnly", dependencies.project(Map.of("path", ":server"))); - dependencies.add("testImplementation", dependencies.project(Map.of("path", ":test:framework"))); - } else { - dependencies.add("compileOnly", "org.elasticsearch:elasticsearch:" + VersionProperties.getElasticsearch()); - dependencies.add("testImplementation", "org.elasticsearch.test:framework:" + VersionProperties.getElasticsearch()); - } + dependencies.add("compileOnly", "org.elasticsearch:elasticsearch:" + VersionProperties.getElasticsearch()); + dependencies.add("testImplementation", "org.elasticsearch.test:framework:" + VersionProperties.getElasticsearch()); // we "upgrade" these optional deps to provided for plugins, since they will run // with a full elasticsearch server that includes optional deps @@ -312,28 +255,5 @@ public Object doCall() { return bundle; } - /** - * Configure the pom for the main jar of this plugin - */ - protected static void addNoticeGeneration(final Project project, PluginPropertiesExtension extension) { - final var licenseFile = extension.getLicenseFile(); - var tasks = project.getTasks(); - if (licenseFile != null) { - tasks.withType(Zip.class).named("bundlePlugin").configure(zip -> zip.from(licenseFile.getParentFile(), copySpec -> { - copySpec.include(licenseFile.getName()); - copySpec.rename(s -> "LICENSE.txt"); - })); - } - - final var noticeFile = extension.getNoticeFile(); - if (noticeFile != null) { - final var generateNotice = tasks.register("generateNotice", NoticeTask.class, noticeTask -> { - noticeTask.setInputFile(noticeFile); - noticeTask.source(Util.getJavaMainSourceSet(project).get().getAllJava()); - }); - tasks.withType(Zip.class).named("bundlePlugin").configure(task -> task.from(generateNotice)); - } - } - public static final String PLUGIN_EXTENSION_NAME = "esplugin"; } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/JarHellPrecommitPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/JarHellPrecommitPlugin.java index f7993771d811e..1236c8b1c5f1d 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/JarHellPrecommitPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/JarHellPrecommitPlugin.java @@ -8,7 +8,6 @@ package org.elasticsearch.gradle.precommit; -import org.elasticsearch.gradle.internal.info.BuildParams; import org.elasticsearch.gradle.internal.util.Util; import org.gradle.api.Project; import org.gradle.api.Task; @@ -20,12 +19,6 @@ public class JarHellPrecommitPlugin extends PrecommitPlugin { @Override public TaskProvider createTask(Project project) { Configuration jarHellConfig = project.getConfigurations().create("jarHell"); - if (BuildParams.isInternal() && project.getPath().equals(":libs:elasticsearch-core") == false) { - // ideally we would configure this as a default dependency. But Default dependencies do not work correctly - // with gradle project dependencies as they're resolved to late in the build and don't setup according task - // dependencies properly - project.getDependencies().add("jarHell", project.project(":libs:elasticsearch-core")); - } TaskProvider jarHell = project.getTasks().register("jarHell", JarHellTask.class); jarHell.configure(t -> { SourceSet testSourceSet = Util.getJavaTestSourceSet(project).get(); diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/JarHellTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/JarHellTask.java index 8c2140c2362aa..c68bda1822f43 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/JarHellTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/JarHellTask.java @@ -8,7 +8,7 @@ package org.elasticsearch.gradle.precommit; -import org.elasticsearch.gradle.internal.LoggedExec; +import org.elasticsearch.gradle.LoggedExec; import org.gradle.api.file.FileCollection; import org.gradle.api.tasks.CacheableTask; import org.gradle.api.tasks.Classpath; diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java index 7746d2ec9fa22..8cc1adb5d4b13 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java @@ -59,6 +59,7 @@ public class ElasticsearchCluster implements TestClusterConfiguration, Named { private final FileSystemOperations fileSystemOperations; private final ArchiveOperations archiveOperations; private final ExecOperations execOperations; + private final Provider runtimeJava; private int nodeIndex = 0; public ElasticsearchCluster( @@ -69,7 +70,8 @@ public ElasticsearchCluster( FileSystemOperations fileSystemOperations, ArchiveOperations archiveOperations, ExecOperations execOperations, - Jdk bwcJdk + Jdk bwcJdk, + Provider runtimeJava ) { this.path = project.getPath(); this.clusterName = clusterName; @@ -79,6 +81,7 @@ public ElasticsearchCluster( this.archiveOperations = archiveOperations; this.execOperations = execOperations; this.workingDirBase = workingDirBase; + this.runtimeJava = runtimeJava; this.nodes = project.container(ElasticsearchNode.class); this.bwcJdk = bwcJdk; @@ -93,7 +96,8 @@ public ElasticsearchCluster( fileSystemOperations, archiveOperations, execOperations, - bwcJdk + bwcJdk, + runtimeJava ) ); @@ -125,7 +129,8 @@ public void setNumberOfNodes(int numberOfNodes) { fileSystemOperations, archiveOperations, execOperations, - bwcJdk + bwcJdk, + runtimeJava ) ); } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index 996752313d106..f8d12b6eaee46 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -15,13 +15,13 @@ import org.elasticsearch.gradle.internal.Jdk; import org.elasticsearch.gradle.LazyPropertyList; import org.elasticsearch.gradle.LazyPropertyMap; -import org.elasticsearch.gradle.internal.LoggedExec; +import org.elasticsearch.gradle.distribution.ElasticsearchDistributionTypes; +import org.elasticsearch.gradle.LoggedExec; import org.elasticsearch.gradle.OS; import org.elasticsearch.gradle.PropertyNormalization; import org.elasticsearch.gradle.ReaperService; import org.elasticsearch.gradle.Version; -import org.elasticsearch.gradle.internal.VersionProperties; -import org.elasticsearch.gradle.internal.info.BuildParams; +import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.transform.UnzipTransform; import org.elasticsearch.gradle.util.Pair; import org.gradle.api.Action; @@ -154,6 +154,7 @@ public class ElasticsearchNode implements TestClusterConfiguration { private final Path esLogFile; private final Path esStdinFile; private final Path tmpDir; + private final Provider runtimeJava; private int currentDistro = 0; private TestDistribution testDistribution; @@ -179,7 +180,8 @@ public class ElasticsearchNode implements TestClusterConfiguration { FileSystemOperations fileSystemOperations, ArchiveOperations archiveOperations, ExecOperations execOperations, - Jdk bwcJdk + Jdk bwcJdk, + Provider runtimeJava ) { this.clusterName = clusterName; this.path = path; @@ -190,6 +192,7 @@ public class ElasticsearchNode implements TestClusterConfiguration { this.archiveOperations = archiveOperations; this.execOperations = execOperations; this.bwcJdk = bwcJdk; + this.runtimeJava = runtimeJava; workingDir = workingDirBase.toPath().resolve(safeName(name)).toAbsolutePath(); confPathRepo = workingDir.resolve("repo"); configFile = workingDir.resolve("config/elasticsearch.yml"); @@ -273,12 +276,12 @@ public void setTestDistribution(TestDistribution testDistribution) { private void setDistributionType(ElasticsearchDistribution distribution, TestDistribution testDistribution) { if (testDistribution == TestDistribution.INTEG_TEST) { - distribution.setType(ElasticsearchDistribution.Type.INTEG_TEST_ZIP); + distribution.setType(ElasticsearchDistributionTypes.INTEG_TEST_ZIP); // we change the underlying distribution when changing the test distribution of the cluster. distribution.setPlatform(null); distribution.setBundledJdk(null); } else { - distribution.setType(ElasticsearchDistribution.Type.ARCHIVE); + distribution.setType(ElasticsearchDistributionTypes.ARCHIVE); } } @@ -840,7 +843,7 @@ private Map getESEnvironment() { private java.util.Optional getRequiredJavaHome() { // If we are testing the current version of Elasticsearch, use the configured runtime Java if (getTestDistribution() == TestDistribution.INTEG_TEST || getVersion().equals(VersionProperties.getElasticsearchVersion())) { - return java.util.Optional.of(BuildParams.getRuntimeJavaHome()).map(File::getAbsolutePath); + return java.util.Optional.of(runtimeJava.map(File::getAbsolutePath).get()); } else if (getVersion().before("7.0.0")) { return java.util.Optional.of(bwcJdk.getJavaHomePath().toString()); } else { // otherwise use the bundled JDK diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersPlugin.java index a43206fef567b..84c1320c4bd85 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersPlugin.java @@ -14,9 +14,6 @@ import org.elasticsearch.gradle.OS; import org.elasticsearch.gradle.ReaperPlugin; import org.elasticsearch.gradle.ReaperService; -import org.elasticsearch.gradle.internal.info.BuildParams; -import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin; -import org.elasticsearch.gradle.internal.InternalDistributionDownloadPlugin; import org.elasticsearch.gradle.util.GradleUtils; import org.gradle.api.NamedDomainObjectContainer; import org.gradle.api.Plugin; @@ -30,7 +27,9 @@ import org.gradle.api.logging.Logger; import org.gradle.api.logging.Logging; import org.gradle.api.provider.Provider; +import org.gradle.api.provider.ProviderFactory; import org.gradle.api.tasks.TaskState; +import org.gradle.internal.jvm.Jvm; import org.gradle.process.ExecOperations; import javax.inject.Inject; @@ -48,6 +47,8 @@ public class TestClustersPlugin implements Plugin { private static final String LEGACY_JAVA_VENDOR = "adoptopenjdk"; private static final String LEGACY_JAVA_VERSION = "8u242+b08"; private static final Logger logger = Logging.getLogger(TestClustersPlugin.class); + private final ProviderFactory providerFactory; + private Provider runtimeJavaProvider; @Inject protected FileSystemOperations getFileSystemOperations() { @@ -64,12 +65,19 @@ protected ExecOperations getExecOperations() { throw new UnsupportedOperationException(); } + @Inject + public TestClustersPlugin(ProviderFactory providerFactory) { + this.providerFactory = providerFactory; + } + + public void setRuntimeJava(Provider runtimeJava) { + this.runtimeJavaProvider = runtimeJava; + } + @Override public void apply(Project project) { project.getPluginManager().apply(JdkDownloadPlugin.class); - project.getRootProject().getPluginManager().apply(GlobalBuildInfoPlugin.class); - BuildParams.withInternalBuild(() -> project.getPlugins().apply(InternalDistributionDownloadPlugin.class)) - .orElse(() -> project.getPlugins().apply(DistributionDownloadPlugin.class)); + project.getPlugins().apply(DistributionDownloadPlugin.class); project.getRootProject().getPluginManager().apply(ReaperPlugin.class); // register legacy jdk distribution for testing pre-7.0 BWC clusters Jdk bwcJdk = JdkDownloadPlugin.getContainer(project).create("bwc_jdk", jdk -> { @@ -83,6 +91,9 @@ public void apply(Project project) { project.getGradle().getSharedServices(), ReaperPlugin.REAPER_SERVICE_NAME ); + runtimeJavaProvider = providerFactory.provider( + () -> System.getenv("RUNTIME_JAVA_HOME") == null ? Jvm.current().getJavaHome() : new File(System.getenv("RUNTIME_JAVA_HOME")) + ); // enable the DSL to describe clusters NamedDomainObjectContainer container = createTestClustersContainerExtension( project, @@ -115,9 +126,8 @@ private NamedDomainObjectContainer createTestClustersConta Jdk bwcJdk ) { // Create an extensions that allows describing clusters - NamedDomainObjectContainer container = project.container( - ElasticsearchCluster.class, - name -> new ElasticsearchCluster( + NamedDomainObjectContainer container = project.container(ElasticsearchCluster.class, name -> { + return new ElasticsearchCluster( name, project, reaper, @@ -125,9 +135,10 @@ private NamedDomainObjectContainer createTestClustersConta getFileSystemOperations(), getArchiveOperations(), getExecOperations(), - bwcJdk - ) - ); + bwcJdk, + runtimeJavaProvider + ); + }); project.getExtensions().add(EXTENSION_NAME, container); return container; } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestDistribution.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestDistribution.java index ea038d4bb5218..6a1b35150892b 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestDistribution.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestDistribution.java @@ -13,5 +13,4 @@ public enum TestDistribution { INTEG_TEST, DEFAULT, - OSS } diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.build.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.build.properties deleted file mode 100644 index bb970e470089f..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.build.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.internal.BuildPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.distribution-download.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.distribution-download.properties deleted file mode 100644 index 3c0e3d94fab1e..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.distribution-download.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.DistributionDownloadPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.distro-test.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.distro-test.properties deleted file mode 100644 index c23f3910b0f05..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.distro-test.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.test.DistroTestPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.docker-support.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.docker-support.properties deleted file mode 100644 index 7efffa644f7dd..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.docker-support.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.internal.docker.DockerSupportPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.docs-test.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.docs-test.properties deleted file mode 100644 index 6fc1a857b38be..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.docs-test.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.doc.DocsTestPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.esplugin.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.esplugin.properties deleted file mode 100644 index 3116e0415f5c6..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.esplugin.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.plugin.PluginBuildPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.global-build-info.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.global-build-info.properties deleted file mode 100644 index 66d2aa2ee26c9..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.global-build-info.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-available-ports.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-available-ports.properties deleted file mode 100644 index a9027eb71fbf7..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-available-ports.properties +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -# needed for testkit testing -implementation-class=org.elasticsearch.gradle.internal.InternalAvailableTcpPortProviderPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-cluster-test.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-cluster-test.properties deleted file mode 100644 index 46f55261e6e49..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-cluster-test.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.test.InternalClusterTestPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-archive-check.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-archive-check.properties deleted file mode 100644 index afcd080035273..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-archive-check.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.InternalDistributionArchiveCheckPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-archive-setup.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-archive-setup.properties deleted file mode 100644 index 094a272bc7319..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-archive-setup.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.InternalDistributionArchiveSetupPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-bwc-setup.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-bwc-setup.properties deleted file mode 100644 index 15ca9af40dc34..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-bwc-setup.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.InternalDistributionBwcSetupPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-download.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-download.properties deleted file mode 100644 index f214a0a66e939..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-distribution-download.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.InternalDistributionDownloadPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-licenseheaders.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-licenseheaders.properties deleted file mode 100644 index a807dcb565c3f..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-licenseheaders.properties +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -# needed for testkit testing -implementation-class=org.elasticsearch.gradle.internal.precommit.LicenseHeadersPrecommitPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-test-artifact-base.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-test-artifact-base.properties deleted file mode 100644 index f041e84ea83da..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-test-artifact-base.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.InternalTestArtifactBasePlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-test-artifact.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-test-artifact.properties deleted file mode 100644 index 23c8ee07e5b50..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-test-artifact.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.InternalTestArtifactPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-test-rerun.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-test-rerun.properties deleted file mode 100644 index e5c9b596a5670..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.internal-test-rerun.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.internal.test.rerun.TestRerunPlugin \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.java-rest-test.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.java-rest-test.properties deleted file mode 100644 index 397c7f743bb1b..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.java-rest-test.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.test.rest.JavaRestTestPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.java.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.java.properties deleted file mode 100644 index af0ae8708fc3d..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.java.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.jdk-download.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.jdk-download.properties deleted file mode 100644 index 654d71189fbf4..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.jdk-download.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.internal.JdkDownloadPlugin \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.publish.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.publish.properties deleted file mode 100644 index c0af28d7c0934..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.publish.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.internal.PublishPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.reaper.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.reaper.properties deleted file mode 100644 index 46d0f45ac5eaf..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.reaper.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.ReaperPlugin \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.repositories.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.repositories.properties deleted file mode 100644 index dd4cec92c1633..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.repositories.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.RepositoriesSetupPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.rest-resources.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.rest-resources.properties deleted file mode 100644 index 76660b861459a..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.rest-resources.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.test.rest.RestResourcesPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.rest-test.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.rest-test.properties deleted file mode 100644 index a7922900cfc04..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.rest-test.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.internal.test.RestTestPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.standalone-rest-test.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.standalone-rest-test.properties deleted file mode 100644 index a47d7eba8c351..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.standalone-rest-test.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.test.StandaloneRestTestPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.standalone-test.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.standalone-test.properties deleted file mode 100644 index 6e413ae95152d..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.standalone-test.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.test.StandaloneTestPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test-base.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test-base.properties deleted file mode 100644 index 44d840f5b3cd5..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test-base.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.ElasticsearchTestBasePlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test-with-dependencies.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test-with-dependencies.properties deleted file mode 100644 index 75256f3fae0f2..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test-with-dependencies.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.test.TestWithDependenciesPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test-with-ssl.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test-with-ssl.properties deleted file mode 100644 index 337e5aeb618ca..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test-with-ssl.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.test.TestWithSslPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test.fixtures.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test.fixtures.properties deleted file mode 100644 index e58710308ba53..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.test.fixtures.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.internal.testfixtures.TestFixturesPlugin \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.testclusters.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.testclusters.properties deleted file mode 100644 index 8d81f05fc69f5..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.testclusters.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.testclusters.TestClustersPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.validate-rest-spec.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.validate-rest-spec.properties deleted file mode 100644 index d11c864c3228e..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.validate-rest-spec.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.elasticsearch.gradle.internal.precommit.ValidateRestSpecPlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.yaml-rest-test.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.yaml-rest-test.properties deleted file mode 100644 index f908c66cfd721..0000000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.yaml-rest-test.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -implementation-class=org.elasticsearch.gradle.internal.test.rest.YamlRestTestPlugin diff --git a/buildSrc/src/test/java/org/elasticsearch/gradle/AbstractDistributionDownloadPluginTests.java b/buildSrc/src/test/java/org/elasticsearch/gradle/AbstractDistributionDownloadPluginTests.java new file mode 100644 index 0000000000000..75b4c8d09821a --- /dev/null +++ b/buildSrc/src/test/java/org/elasticsearch/gradle/AbstractDistributionDownloadPluginTests.java @@ -0,0 +1,112 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle; + +import org.elasticsearch.gradle.internal.BwcVersions; +import org.elasticsearch.gradle.internal.info.BuildParams; +import org.elasticsearch.gradle.internal.test.GradleUnitTestCase; +import org.gradle.api.NamedDomainObjectContainer; +import org.gradle.api.Project; +import org.gradle.testfixtures.ProjectBuilder; + +import java.io.File; +import java.util.Arrays; +import java.util.TreeSet; + +public class AbstractDistributionDownloadPluginTests extends GradleUnitTestCase { + protected static Project rootProject; + protected static Project archivesProject; + protected static Project packagesProject; + protected static Project bwcProject; + + protected static final Version BWC_MAJOR_VERSION = Version.fromString("2.0.0"); + protected static final Version BWC_MINOR_VERSION = Version.fromString("1.1.0"); + protected static final Version BWC_STAGED_VERSION = Version.fromString("1.0.0"); + protected static final Version BWC_BUGFIX_VERSION = Version.fromString("1.0.1"); + protected static final Version BWC_MAINTENANCE_VERSION = Version.fromString("0.90.1"); + + protected static final BwcVersions BWC_MINOR = new BwcVersions( + new TreeSet<>(Arrays.asList(BWC_BUGFIX_VERSION, BWC_MINOR_VERSION, BWC_MAJOR_VERSION)), + BWC_MAJOR_VERSION + ); + protected static final BwcVersions BWC_STAGED = new BwcVersions( + new TreeSet<>(Arrays.asList(BWC_STAGED_VERSION, BWC_MINOR_VERSION, BWC_MAJOR_VERSION)), + BWC_MAJOR_VERSION + ); + protected static final BwcVersions BWC_BUGFIX = new BwcVersions( + new TreeSet<>(Arrays.asList(BWC_BUGFIX_VERSION, BWC_MINOR_VERSION, BWC_MAJOR_VERSION)), + BWC_MAJOR_VERSION + ); + protected static final BwcVersions BWC_MAINTENANCE = new BwcVersions( + new TreeSet<>(Arrays.asList(BWC_MAINTENANCE_VERSION, BWC_STAGED_VERSION, BWC_MINOR_VERSION)), + BWC_MINOR_VERSION + ); + + protected static String projectName(String base, boolean bundledJdk) { + String prefix = bundledJdk == false ? "no-jdk-" : ""; + return prefix + base; + } + + protected void checkBwc( + String projectName, + String config, + Version version, + ElasticsearchDistributionType type, + ElasticsearchDistribution.Platform platform, + BwcVersions bwcVersions, + boolean isInternal + ) { + Project project = createProject(bwcVersions, isInternal); + Project archiveProject = ProjectBuilder.builder().withParent(bwcProject).withName(projectName).build(); + archiveProject.getConfigurations().create(config); + archiveProject.getArtifacts().add(config, new File("doesnotmatter")); + createDistro(project, "distro", version.toString(), type, platform, true); + } + + protected ElasticsearchDistribution createDistro( + Project project, + String name, + String version, + ElasticsearchDistributionType type, + ElasticsearchDistribution.Platform platform, + Boolean bundledJdk + ) { + NamedDomainObjectContainer distros = DistributionDownloadPlugin.getContainer(project); + return distros.create(name, distro -> { + if (version != null) { + distro.setVersion(version); + } + if (type != null) { + distro.setType(type); + } + if (platform != null) { + distro.setPlatform(platform); + } + if (bundledJdk != null) { + distro.setBundledJdk(bundledJdk); + } + }).maybeFreeze(); + } + + protected Project createProject(BwcVersions bwcVersions, boolean isInternal) { + rootProject = ProjectBuilder.builder().build(); + BuildParams.init(params -> params.setIsInternal(isInternal)); + Project distributionProject = ProjectBuilder.builder().withParent(rootProject).withName("distribution").build(); + archivesProject = ProjectBuilder.builder().withParent(distributionProject).withName("archives").build(); + packagesProject = ProjectBuilder.builder().withParent(distributionProject).withName("packages").build(); + bwcProject = ProjectBuilder.builder().withParent(distributionProject).withName("bwc").build(); + Project project = ProjectBuilder.builder().withParent(rootProject).build(); + if (bwcVersions != null) { + project.getExtensions().getExtraProperties().set("bwcVersions", bwcVersions); + } + project.getPlugins().apply("elasticsearch.distribution-download"); + return project; + } + +} diff --git a/buildSrc/src/test/java/org/elasticsearch/gradle/DistributionDownloadPluginTests.java b/buildSrc/src/test/java/org/elasticsearch/gradle/DistributionDownloadPluginTests.java index 2a6a1fcb3f01e..769e3dd0561f3 100644 --- a/buildSrc/src/test/java/org/elasticsearch/gradle/DistributionDownloadPluginTests.java +++ b/buildSrc/src/test/java/org/elasticsearch/gradle/DistributionDownloadPluginTests.java @@ -9,51 +9,25 @@ package org.elasticsearch.gradle; import org.elasticsearch.gradle.ElasticsearchDistribution.Platform; -import org.elasticsearch.gradle.ElasticsearchDistribution.Type; -import org.elasticsearch.gradle.internal.VersionProperties; -import org.elasticsearch.gradle.internal.info.BuildParams; -import org.elasticsearch.gradle.internal.BwcVersions; -import org.elasticsearch.gradle.internal.test.GradleUnitTestCase; -import org.gradle.api.NamedDomainObjectContainer; +import org.elasticsearch.gradle.distribution.ElasticsearchDistributionTypes; import org.gradle.api.Project; import org.gradle.testfixtures.ProjectBuilder; import java.io.File; -import java.util.Arrays; -import java.util.TreeSet; import static org.hamcrest.core.StringContains.containsString; -public class DistributionDownloadPluginTests extends GradleUnitTestCase { - private static Project rootProject; - private static Project archivesProject; - private static Project packagesProject; - private static Project bwcProject; - - private static final Version BWC_MAJOR_VERSION = Version.fromString("2.0.0"); - private static final Version BWC_MINOR_VERSION = Version.fromString("1.1.0"); - private static final Version BWC_STAGED_VERSION = Version.fromString("1.0.0"); - private static final Version BWC_BUGFIX_VERSION = Version.fromString("1.0.1"); - private static final Version BWC_MAINTENANCE_VERSION = Version.fromString("0.90.1"); - private static final BwcVersions BWC_MINOR = new BwcVersions( - new TreeSet<>(Arrays.asList(BWC_BUGFIX_VERSION, BWC_MINOR_VERSION, BWC_MAJOR_VERSION)), - BWC_MAJOR_VERSION - ); - private static final BwcVersions BWC_STAGED = new BwcVersions( - new TreeSet<>(Arrays.asList(BWC_STAGED_VERSION, BWC_MINOR_VERSION, BWC_MAJOR_VERSION)), - BWC_MAJOR_VERSION - ); - private static final BwcVersions BWC_BUGFIX = new BwcVersions( - new TreeSet<>(Arrays.asList(BWC_BUGFIX_VERSION, BWC_MINOR_VERSION, BWC_MAJOR_VERSION)), - BWC_MAJOR_VERSION - ); - private static final BwcVersions BWC_MAINTENANCE = new BwcVersions( - new TreeSet<>(Arrays.asList(BWC_MAINTENANCE_VERSION, BWC_STAGED_VERSION, BWC_MINOR_VERSION)), - BWC_MINOR_VERSION - ); +public class DistributionDownloadPluginTests extends AbstractDistributionDownloadPluginTests { public void testVersionDefault() { - ElasticsearchDistribution distro = checkDistro(createProject(null, false), "testdistro", null, Type.ARCHIVE, Platform.LINUX, true); + ElasticsearchDistribution distro = checkDistro( + createProject(null, false), + "testdistro", + null, + ElasticsearchDistributionTypes.ARCHIVE, + Platform.LINUX, + true + ); assertEquals(distro.getVersion(), VersionProperties.getElasticsearch()); } @@ -62,7 +36,7 @@ public void testBadVersionFormat() { createProject(null, false), "testdistro", "badversion", - Type.ARCHIVE, + ElasticsearchDistributionTypes.ARCHIVE, Platform.LINUX, true, "Invalid version format: 'badversion'" @@ -71,11 +45,18 @@ public void testBadVersionFormat() { public void testTypeDefault() { ElasticsearchDistribution distro = checkDistro(createProject(null, false), "testdistro", "5.0.0", null, Platform.LINUX, true); - assertEquals(distro.getType(), Type.ARCHIVE); + assertEquals(distro.getType(), ElasticsearchDistributionTypes.ARCHIVE); } public void testPlatformDefault() { - ElasticsearchDistribution distro = checkDistro(createProject(null, false), "testdistro", "5.0.0", Type.ARCHIVE, null, true); + ElasticsearchDistribution distro = checkDistro( + createProject(null, false), + "testdistro", + "5.0.0", + ElasticsearchDistributionTypes.ARCHIVE, + null, + true + ); assertEquals(distro.getPlatform(), ElasticsearchDistribution.CURRENT_PLATFORM); } @@ -84,7 +65,7 @@ public void testPlatformForIntegTest() { createProject(null, false), "testdistro", "5.0.0", - Type.INTEG_TEST_ZIP, + ElasticsearchDistributionTypes.INTEG_TEST_ZIP, Platform.LINUX, null, "platform cannot be set on elasticsearch distribution [testdistro]" @@ -96,7 +77,7 @@ public void testBundledJdkDefault() { createProject(null, false), "testdistro", "5.0.0", - Type.ARCHIVE, + ElasticsearchDistributionTypes.ARCHIVE, Platform.LINUX, true ); @@ -108,7 +89,7 @@ public void testBundledJdkForIntegTest() { createProject(null, false), "testdistro", "5.0.0", - Type.INTEG_TEST_ZIP, + ElasticsearchDistributionTypes.INTEG_TEST_ZIP, null, true, "bundledJdk cannot be set on elasticsearch distribution [testdistro]" @@ -120,7 +101,7 @@ public void testLocalCurrentVersionIntegTestZip() { Project archiveProject = ProjectBuilder.builder().withParent(archivesProject).withName("integ-test-zip").build(); archiveProject.getConfigurations().create("default"); archiveProject.getArtifacts().add("default", new File("doesnotmatter")); - createDistro(project, "distro", VersionProperties.getElasticsearch(), Type.INTEG_TEST_ZIP, null, null); + createDistro(project, "distro", VersionProperties.getElasticsearch(), ElasticsearchDistributionTypes.INTEG_TEST_ZIP, null, null); } public void testLocalCurrentVersionArchives() { @@ -133,20 +114,14 @@ public void testLocalCurrentVersionArchives() { Project archiveProject = ProjectBuilder.builder().withParent(archivesProject).withName(projectName).build(); archiveProject.getConfigurations().create("default"); archiveProject.getArtifacts().add("default", new File("doesnotmatter")); - createDistro(project, "distro", VersionProperties.getElasticsearch(), Type.ARCHIVE, platform, bundledJdk); - } - } - } - - public void testLocalCurrentVersionPackages() { - for (Type packageType : new Type[] { Type.RPM, Type.DEB }) { - for (boolean bundledJdk : new boolean[] { true, false }) { - Project project = createProject(BWC_MINOR, true); - String projectName = projectName(packageType.toString(), bundledJdk); - Project packageProject = ProjectBuilder.builder().withParent(packagesProject).withName(projectName).build(); - packageProject.getConfigurations().create("default"); - packageProject.getArtifacts().add("default", new File("doesnotmatter")); - createDistro(project, "distro", VersionProperties.getElasticsearch(), packageType, null, bundledJdk); + createDistro( + project, + "distro", + VersionProperties.getElasticsearch(), + ElasticsearchDistributionTypes.ARCHIVE, + platform, + bundledJdk + ); } } } @@ -156,22 +131,11 @@ public void testLocalBwcArchives() { // note: no non bundled jdk for bwc String configName = projectName(platform.toString(), true); configName += (platform == Platform.WINDOWS ? "-zip" : "-tar"); - - checkBwc("minor", configName, BWC_MINOR_VERSION, Type.ARCHIVE, platform, BWC_MINOR, true); - checkBwc("staged", configName, BWC_STAGED_VERSION, Type.ARCHIVE, platform, BWC_STAGED, true); - checkBwc("bugfix", configName, BWC_BUGFIX_VERSION, Type.ARCHIVE, platform, BWC_BUGFIX, true); - checkBwc("maintenance", configName, BWC_MAINTENANCE_VERSION, Type.ARCHIVE, platform, BWC_MAINTENANCE, true); - } - } - - public void testLocalBwcPackages() { - for (Type packageType : new Type[] { Type.RPM, Type.DEB }) { - // note: no non bundled jdk for bwc - String configName = projectName(packageType.toString(), true); - checkBwc("minor", configName, BWC_MINOR_VERSION, packageType, null, BWC_MINOR, true); - checkBwc("staged", configName, BWC_STAGED_VERSION, packageType, null, BWC_STAGED, true); - checkBwc("bugfix", configName, BWC_BUGFIX_VERSION, packageType, null, BWC_BUGFIX, true); - checkBwc("maintenance", configName, BWC_MAINTENANCE_VERSION, packageType, null, BWC_MAINTENANCE, true); + ElasticsearchDistributionType archiveType = ElasticsearchDistributionTypes.ARCHIVE; + checkBwc("minor", configName, BWC_MINOR_VERSION, archiveType, platform, BWC_MINOR, true); + checkBwc("staged", configName, BWC_STAGED_VERSION, archiveType, platform, BWC_STAGED, true); + checkBwc("bugfix", configName, BWC_BUGFIX_VERSION, archiveType, platform, BWC_BUGFIX, true); + checkBwc("maintenance", configName, BWC_MAINTENANCE_VERSION, archiveType, platform, BWC_MAINTENANCE, true); } } @@ -179,7 +143,7 @@ private void assertDistroError( Project project, String name, String version, - Type type, + ElasticsearchDistributionType type, Platform platform, Boolean bundledJdk, String message @@ -191,37 +155,12 @@ private void assertDistroError( assertThat(e.getMessage(), containsString(message)); } - private ElasticsearchDistribution createDistro( - Project project, - String name, - String version, - Type type, - Platform platform, - Boolean bundledJdk - ) { - NamedDomainObjectContainer distros = DistributionDownloadPlugin.getContainer(project); - return distros.create(name, distro -> { - if (version != null) { - distro.setVersion(version); - } - if (type != null) { - distro.setType(type); - } - if (platform != null) { - distro.setPlatform(platform); - } - if (bundledJdk != null) { - distro.setBundledJdk(bundledJdk); - } - }).maybeFreeze(); - } - // create a distro and finalize its configuration private ElasticsearchDistribution checkDistro( Project project, String name, String version, - Type type, + ElasticsearchDistributionType type, Platform platform, Boolean bundledJdk ) { @@ -230,39 +169,4 @@ private ElasticsearchDistribution checkDistro( return distribution; } - private void checkBwc( - String projectName, - String config, - Version version, - Type type, - Platform platform, - BwcVersions bwcVersions, - boolean isInternal - ) { - Project project = createProject(bwcVersions, isInternal); - Project archiveProject = ProjectBuilder.builder().withParent(bwcProject).withName(projectName).build(); - archiveProject.getConfigurations().create(config); - archiveProject.getArtifacts().add(config, new File("doesnotmatter")); - createDistro(project, "distro", version.toString(), type, platform, true); - } - - private Project createProject(BwcVersions bwcVersions, boolean isInternal) { - rootProject = ProjectBuilder.builder().build(); - BuildParams.init(params -> params.setIsInternal(isInternal)); - Project distributionProject = ProjectBuilder.builder().withParent(rootProject).withName("distribution").build(); - archivesProject = ProjectBuilder.builder().withParent(distributionProject).withName("archives").build(); - packagesProject = ProjectBuilder.builder().withParent(distributionProject).withName("packages").build(); - bwcProject = ProjectBuilder.builder().withParent(distributionProject).withName("bwc").build(); - Project project = ProjectBuilder.builder().withParent(rootProject).build(); - if (bwcVersions != null) { - project.getExtensions().getExtraProperties().set("bwcVersions", bwcVersions); - } - project.getPlugins().apply("elasticsearch.distribution-download"); - return project; - } - - private static String projectName(String base, boolean bundledJdk) { - String prefix = bundledJdk == false ? "no-jdk-" : ""; - return prefix + base; - } } diff --git a/buildSrc/src/test/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPluginTests.java b/buildSrc/src/test/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPluginTests.java new file mode 100644 index 0000000000000..c192809de71f0 --- /dev/null +++ b/buildSrc/src/test/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPluginTests.java @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal; + +import org.elasticsearch.gradle.AbstractDistributionDownloadPluginTests; +import org.elasticsearch.gradle.ElasticsearchDistributionType; +import org.elasticsearch.gradle.VersionProperties; +import org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes; +import org.gradle.api.Project; +import org.gradle.testfixtures.ProjectBuilder; + +import java.io.File; + +public class InternalDistributionDownloadPluginTests extends AbstractDistributionDownloadPluginTests { + + public void testLocalCurrentVersionPackages() { + ElasticsearchDistributionType[] types = { InternalElasticsearchDistributionTypes.RPM, InternalElasticsearchDistributionTypes.DEB }; + for (ElasticsearchDistributionType packageType : types) { + for (boolean bundledJdk : new boolean[] { true, false }) { + Project project = createProject(BWC_MINOR, true); + String projectName = projectName(packageType.toString(), bundledJdk); + Project packageProject = ProjectBuilder.builder().withParent(packagesProject).withName(projectName).build(); + packageProject.getConfigurations().create("default"); + packageProject.getArtifacts().add("default", new File("doesnotmatter")); + createDistro(project, "distro", VersionProperties.getElasticsearch(), packageType, null, bundledJdk); + } + } + } + + public void testLocalBwcPackages() { + ElasticsearchDistributionType[] types = { InternalElasticsearchDistributionTypes.RPM, InternalElasticsearchDistributionTypes.DEB }; + for (ElasticsearchDistributionType packageType : types) { + // note: no non bundled jdk for bwc + String configName = projectName(packageType.toString(), true); + checkBwc("minor", configName, BWC_MINOR_VERSION, packageType, null, BWC_MINOR, true); + checkBwc("staged", configName, BWC_STAGED_VERSION, packageType, null, BWC_STAGED, true); + checkBwc("bugfix", configName, BWC_BUGFIX_VERSION, packageType, null, BWC_BUGFIX, true); + checkBwc("maintenance", configName, BWC_MAINTENANCE_VERSION, packageType, null, BWC_MAINTENANCE, true); + } + } +} diff --git a/client/client-benchmark-noop-api-plugin/build.gradle b/client/client-benchmark-noop-api-plugin/build.gradle index d6277d16556f0..198775e61b8a2 100644 --- a/client/client-benchmark-noop-api-plugin/build.gradle +++ b/client/client-benchmark-noop-api-plugin/build.gradle @@ -8,7 +8,7 @@ group = 'org.elasticsearch.plugin' -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'client-benchmark-noop-api' diff --git a/client/rest-high-level/build.gradle b/client/rest-high-level/build.gradle index f228134cc7446..ac80d51345e98 100644 --- a/client/rest-high-level/build.gradle +++ b/client/rest-high-level/build.gradle @@ -8,7 +8,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.build' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.publish' diff --git a/distribution/build.gradle b/distribution/build.gradle index beaeb41cf863d..9a7d23d9d3c5a 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -11,8 +11,8 @@ import org.apache.tools.ant.filters.FixCrLfFilter import org.elasticsearch.gradle.internal.ConcatFilesTask import org.elasticsearch.gradle.internal.DependenciesInfoTask import org.elasticsearch.gradle.internal.MavenFilteringHack -import org.elasticsearch.gradle.NoticeTask -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.internal.NoticeTask +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import java.nio.file.Files @@ -150,7 +150,7 @@ void copyModule(TaskProvider copyTask, Project module) { exclude 'config/log4j2.properties' eachFile { details -> - String name = module.plugins.hasPlugin('elasticsearch.esplugin') ? module.esplugin.name : module.es_meta_plugin.name + String name = module.plugins.hasPlugin('elasticsearch.internal-es-plugin') ? module.esplugin.name : module.es_meta_plugin.name // Copy all non config/bin files // Note these might be unde a subdirectory in the case of a meta plugin if ((details.relativePath.pathString ==~ /([^\/]+\/)?(config|bin)\/.*/) == false) { diff --git a/distribution/docker/build.gradle b/distribution/docker/build.gradle index 2fa68cf50c231..a5f797836aad3 100644 --- a/distribution/docker/build.gradle +++ b/distribution/docker/build.gradle @@ -1,12 +1,13 @@ import org.elasticsearch.gradle.Architecture import org.elasticsearch.gradle.internal.DockerBase -import org.elasticsearch.gradle.internal.LoggedExec -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.LoggedExec +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.docker.DockerBuildTask import org.elasticsearch.gradle.internal.docker.ShellRetry import org.elasticsearch.gradle.internal.docker.TransformLog4jConfigFilter import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.testfixtures.TestFixturesPlugin +import static org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes.DOCKER import java.nio.file.Path @@ -152,7 +153,7 @@ elasticsearch_distributions { Architecture.values().each { eachArchitecture -> "docker_${ eachArchitecture == Architecture.AARCH64 ? '_aarch64' : '' }" { architecture = eachArchitecture - type = 'docker' + type = DOCKER version = VersionProperties.getElasticsearch() failIfUnavailable = false // This ensures we don't attempt to build images if docker is unavailable } diff --git a/distribution/packages/build.gradle b/distribution/packages/build.gradle index 44a6908211132..ee7acdc043740 100644 --- a/distribution/packages/build.gradle +++ b/distribution/packages/build.gradle @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import org.elasticsearch.gradle.internal.LoggedExec +import org.elasticsearch.gradle.LoggedExec import org.elasticsearch.gradle.internal.MavenFilteringHack import org.elasticsearch.gradle.OS import org.elasticsearch.gradle.internal.info.BuildParams diff --git a/modules/build.gradle b/modules/build.gradle index ff4bd1dfd01e3..57f7495d87132 100644 --- a/modules/build.gradle +++ b/modules/build.gradle @@ -8,8 +8,8 @@ configure(subprojects.findAll { it.parent.path == project.path }) { group = 'org.elasticsearch.plugin' // for modules which publish client jars - apply plugin: 'elasticsearch.testclusters' - apply plugin: 'elasticsearch.esplugin' + apply plugin: 'elasticsearch.internal-testclusters' + apply plugin: 'elasticsearch.internal-es-plugin' esplugin { // for local ES plugins, the name of the plugin is the same as the directory diff --git a/plugins/build.gradle b/plugins/build.gradle index 9ad5313eb5047..a9bb4ac93fafe 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -7,13 +7,13 @@ */ subprojects { - apply plugin: 'elasticsearch.testclusters' + apply plugin: 'elasticsearch.internal-testclusters' } // only configure immediate children of plugins dir configure(subprojects.findAll { it.parent.path == project.path }) { group = 'org.elasticsearch.plugin' - apply plugin: 'elasticsearch.esplugin' + apply plugin: 'elasticsearch.internal-es-plugin' esplugin { // for local ES plugins, the name of the plugin is the same as the directory diff --git a/plugins/discovery-azure-classic/build.gradle b/plugins/discovery-azure-classic/build.gradle index 72446514a587b..80afe45ea7f36 100644 --- a/plugins/discovery-azure-classic/build.gradle +++ b/plugins/discovery-azure-classic/build.gradle @@ -1,4 +1,4 @@ -import org.elasticsearch.gradle.internal.LoggedExec +import org.elasticsearch.gradle.LoggedExec import org.elasticsearch.gradle.internal.info.BuildParams /* diff --git a/plugins/examples/custom-settings/build.gradle b/plugins/examples/custom-settings/build.gradle index 53b2fea25b929..db6c0d3eba296 100644 --- a/plugins/examples/custom-settings/build.gradle +++ b/plugins/examples/custom-settings/build.gradle @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.yaml-rest-test' esplugin { diff --git a/plugins/examples/custom-significance-heuristic/build.gradle b/plugins/examples/custom-significance-heuristic/build.gradle index 29d718af1299a..3f892f506784d 100644 --- a/plugins/examples/custom-significance-heuristic/build.gradle +++ b/plugins/examples/custom-significance-heuristic/build.gradle @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.yaml-rest-test' esplugin { diff --git a/plugins/examples/custom-suggester/build.gradle b/plugins/examples/custom-suggester/build.gradle index 40d79644a5463..58061ce01af8f 100644 --- a/plugins/examples/custom-suggester/build.gradle +++ b/plugins/examples/custom-suggester/build.gradle @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.yaml-rest-test' esplugin { diff --git a/plugins/examples/painless-whitelist/build.gradle b/plugins/examples/painless-whitelist/build.gradle index 4728919d271be..a625a45715d4b 100644 --- a/plugins/examples/painless-whitelist/build.gradle +++ b/plugins/examples/painless-whitelist/build.gradle @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.yaml-rest-test' esplugin { diff --git a/plugins/examples/rescore/build.gradle b/plugins/examples/rescore/build.gradle index d83bdbc79c0bd..6c676a86fc5f0 100644 --- a/plugins/examples/rescore/build.gradle +++ b/plugins/examples/rescore/build.gradle @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.yaml-rest-test' esplugin { diff --git a/plugins/examples/rest-handler/build.gradle b/plugins/examples/rest-handler/build.gradle index cf5ff5fc437e9..dd15e77e07cc1 100644 --- a/plugins/examples/rest-handler/build.gradle +++ b/plugins/examples/rest-handler/build.gradle @@ -7,7 +7,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.yaml-rest-test' apply plugin: 'elasticsearch.java-rest-test' diff --git a/plugins/examples/script-expert-scoring/build.gradle b/plugins/examples/script-expert-scoring/build.gradle index d2377e894edbe..c9d79f7aa7674 100644 --- a/plugins/examples/script-expert-scoring/build.gradle +++ b/plugins/examples/script-expert-scoring/build.gradle @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.yaml-rest-test' esplugin { diff --git a/plugins/examples/security-authorization-engine/build.gradle b/plugins/examples/security-authorization-engine/build.gradle index b3c708077505d..f5875bd8bb7a0 100644 --- a/plugins/examples/security-authorization-engine/build.gradle +++ b/plugins/examples/security-authorization-engine/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.java-rest-test' esplugin { diff --git a/qa/ccs-rolling-upgrade-remote-cluster/build.gradle b/qa/ccs-rolling-upgrade-remote-cluster/build.gradle index b9b1e360bd8f6..501ce6190b8a4 100644 --- a/qa/ccs-rolling-upgrade-remote-cluster/build.gradle +++ b/qa/ccs-rolling-upgrade-remote-cluster/build.gradle @@ -10,7 +10,7 @@ import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/qa/ccs-unavailable-clusters/build.gradle b/qa/ccs-unavailable-clusters/build.gradle index 6f6f08f4eb55f..0d3e1662707dd 100644 --- a/qa/ccs-unavailable-clusters/build.gradle +++ b/qa/ccs-unavailable-clusters/build.gradle @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test-with-dependencies' diff --git a/qa/die-with-dignity/build.gradle b/qa/die-with-dignity/build.gradle index 4ef36b0383dd8..7c82b38be0a6d 100644 --- a/qa/die-with-dignity/build.gradle +++ b/qa/die-with-dignity/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.util.GradleUtils apply plugin: 'elasticsearch.java-rest-test' -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { description 'Die with dignity plugin' diff --git a/qa/evil-tests/build.gradle b/qa/evil-tests/build.gradle index f9ab9a6751e77..559aad2d0e2ed 100644 --- a/qa/evil-tests/build.gradle +++ b/qa/evil-tests/build.gradle @@ -12,7 +12,7 @@ * threads, etc. */ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { diff --git a/qa/full-cluster-restart/build.gradle b/qa/full-cluster-restart/build.gradle index 85702d35edba2..ff2070d356e1a 100644 --- a/qa/full-cluster-restart/build.gradle +++ b/qa/full-cluster-restart/build.gradle @@ -11,7 +11,7 @@ import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.internal-test-artifact' apply plugin: 'elasticsearch.bwc-test' diff --git a/qa/logging-config/build.gradle b/qa/logging-config/build.gradle index b6446e65c0723..6b8d7cb83ffd7 100644 --- a/qa/logging-config/build.gradle +++ b/qa/logging-config/build.gradle @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.standalone-test' diff --git a/qa/mixed-cluster/build.gradle b/qa/mixed-cluster/build.gradle index 13d26d40af669..7a1191603fc24 100644 --- a/qa/mixed-cluster/build.gradle +++ b/qa/mixed-cluster/build.gradle @@ -7,11 +7,11 @@ */ import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/qa/multi-cluster-search/build.gradle b/qa/multi-cluster-search/build.gradle index fbbd4b9a029ca..009e83daffeab 100644 --- a/qa/multi-cluster-search/build.gradle +++ b/qa/multi-cluster-search/build.gradle @@ -8,7 +8,7 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/qa/remote-clusters/build.gradle b/qa/remote-clusters/build.gradle index b81f4a50450a8..f831108971318 100644 --- a/qa/remote-clusters/build.gradle +++ b/qa/remote-clusters/build.gradle @@ -7,8 +7,9 @@ */ import org.elasticsearch.gradle.Architecture -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.testfixtures.TestFixturesPlugin +import static org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes.DOCKER; apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.test.fixtures' @@ -36,7 +37,7 @@ tasks.register("copyNodeKeyMaterial", Sync) { elasticsearch_distributions { docker { - type = 'docker' + type = DOCKER architecture = Architecture.current() version = VersionProperties.getElasticsearch() failIfUnavailable = false // This ensures we skip this testing if Docker is unavailable diff --git a/qa/repository-multi-version/build.gradle b/qa/repository-multi-version/build.gradle index 1a4a1bde58e8b..6d0c8bc548903 100644 --- a/qa/repository-multi-version/build.gradle +++ b/qa/repository-multi-version/build.gradle @@ -10,7 +10,7 @@ import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.internal-test-artifact' diff --git a/qa/rolling-upgrade/build.gradle b/qa/rolling-upgrade/build.gradle index d9af5babf05e6..03819184e3a86 100644 --- a/qa/rolling-upgrade/build.gradle +++ b/qa/rolling-upgrade/build.gradle @@ -10,7 +10,7 @@ import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/qa/smoke-test-http/build.gradle b/qa/smoke-test-http/build.gradle index 30f0d29c22ae0..55aa1e0cc8ff2 100644 --- a/qa/smoke-test-http/build.gradle +++ b/qa/smoke-test-http/build.gradle @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test-with-dependencies' diff --git a/qa/smoke-test-ingest-disabled/build.gradle b/qa/smoke-test-ingest-disabled/build.gradle index a0e7bf2bc4f58..36a21ac8ddadf 100644 --- a/qa/smoke-test-ingest-disabled/build.gradle +++ b/qa/smoke-test-ingest-disabled/build.gradle @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/qa/smoke-test-ingest-with-all-dependencies/build.gradle b/qa/smoke-test-ingest-with-all-dependencies/build.gradle index b7a8df8cc2e15..df213274e34e9 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/build.gradle +++ b/qa/smoke-test-ingest-with-all-dependencies/build.gradle @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/qa/smoke-test-multinode/build.gradle b/qa/smoke-test-multinode/build.gradle index 5dc166c66bf8a..1830ef309b4fb 100644 --- a/qa/smoke-test-multinode/build.gradle +++ b/qa/smoke-test-multinode/build.gradle @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/qa/smoke-test-plugins/build.gradle b/qa/smoke-test-plugins/build.gradle index d4b4a9cd24870..8b886db84d13d 100644 --- a/qa/smoke-test-plugins/build.gradle +++ b/qa/smoke-test-plugins/build.gradle @@ -9,7 +9,7 @@ import org.elasticsearch.gradle.internal.MavenFilteringHack import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/qa/unconfigured-node-name/build.gradle b/qa/unconfigured-node-name/build.gradle index a204bb91e8f04..12b4f9ffee7f3 100644 --- a/qa/unconfigured-node-name/build.gradle +++ b/qa/unconfigured-node-name/build.gradle @@ -8,7 +8,7 @@ import org.elasticsearch.gradle.OS * Side Public License, v 1. */ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' diff --git a/qa/verify-version-constants/build.gradle b/qa/verify-version-constants/build.gradle index e2d82d26c8f03..540fd8ee592f3 100644 --- a/qa/verify-version-constants/build.gradle +++ b/qa/verify-version-constants/build.gradle @@ -7,11 +7,11 @@ */ import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.bwc-test' diff --git a/qa/wildfly/build.gradle b/qa/wildfly/build.gradle index 0b5a15ae99d33..a09057abc99bd 100644 --- a/qa/wildfly/build.gradle +++ b/qa/wildfly/build.gradle @@ -7,7 +7,8 @@ */ import org.elasticsearch.gradle.Architecture -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties +import static org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes.DOCKER; apply plugin: 'war' apply plugin: 'elasticsearch.java' @@ -47,7 +48,7 @@ if (Architecture.current() == Architecture.X64) { elasticsearch_distributions { docker { - type = 'docker' + type = DOCKER architecture = Architecture.current() version = VersionProperties.getElasticsearch() failIfUnavailable = false // This ensures we skip this testing if Docker is unavailable diff --git a/test/external-modules/build.gradle b/test/external-modules/build.gradle index 68274506581f5..396ecf5eb618e 100644 --- a/test/external-modules/build.gradle +++ b/test/external-modules/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams; subprojects { - apply plugin: 'elasticsearch.esplugin' + apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.yaml-rest-test' esplugin { diff --git a/x-pack/plugin/analytics/build.gradle b/x-pack/plugin/analytics/build.gradle index 34afb8672a122..d8dfabd66260e 100644 --- a/x-pack/plugin/analytics/build.gradle +++ b/x-pack/plugin/analytics/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'x-pack-analytics' description 'Elasticsearch Expanded Pack Plugin - Analytics' diff --git a/x-pack/plugin/async-search/build.gradle b/x-pack/plugin/async-search/build.gradle index 4cf356b36a483..161710b49e3d9 100644 --- a/x-pack/plugin/async-search/build.gradle +++ b/x-pack/plugin/async-search/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'x-pack-async-search' diff --git a/x-pack/plugin/async-search/qa/rest/build.gradle b/x-pack/plugin/async-search/qa/rest/build.gradle index 3914e8f0dd382..d38279b840c2e 100644 --- a/x-pack/plugin/async-search/qa/rest/build.gradle +++ b/x-pack/plugin/async-search/qa/rest/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.yaml-rest-test' esplugin { diff --git a/x-pack/plugin/async/build.gradle b/x-pack/plugin/async/build.gradle index 9c860dcd73e97..e3ca21c257a4f 100644 --- a/x-pack/plugin/async/build.gradle +++ b/x-pack/plugin/async/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'x-pack-async' diff --git a/x-pack/plugin/autoscaling/build.gradle b/x-pack/plugin/autoscaling/build.gradle index 53c36cbaedb90..4e1aa8e1d6774 100644 --- a/x-pack/plugin/autoscaling/build.gradle +++ b/x-pack/plugin/autoscaling/build.gradle @@ -1,5 +1,5 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 0d570481dfeb7..767f82800748a 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.plugin.PluginBuildPlugin import org.gradle.internal.jvm.Jvm import org.elasticsearch.gradle.internal.info.BuildParams -import org.elasticsearch.gradle.internal.LoggedExec +import org.elasticsearch.gradle.LoggedExec import org.elasticsearch.gradle.util.GradleUtils diff --git a/x-pack/plugin/ccr/build.gradle b/x-pack/plugin/ccr/build.gradle index 1e53166ed8c7a..b6e9319776489 100644 --- a/x-pack/plugin/ccr/build.gradle +++ b/x-pack/plugin/ccr/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'x-pack-ccr' diff --git a/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle b/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle index 3072e29069f31..9adab2440ee0e 100644 --- a/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle +++ b/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { diff --git a/x-pack/plugin/ccr/qa/multi-cluster/build.gradle b/x-pack/plugin/ccr/qa/multi-cluster/build.gradle index 9fabf5cc94883..e2e57e23d0788 100644 --- a/x-pack/plugin/ccr/qa/multi-cluster/build.gradle +++ b/x-pack/plugin/ccr/qa/multi-cluster/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { diff --git a/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle b/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle index eee3c91d1922b..27b183cfb4744 100644 --- a/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle +++ b/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { diff --git a/x-pack/plugin/ccr/qa/restart/build.gradle b/x-pack/plugin/ccr/qa/restart/build.gradle index 3fa08b8d40bc2..26854cdeb294a 100644 --- a/x-pack/plugin/ccr/qa/restart/build.gradle +++ b/x-pack/plugin/ccr/qa/restart/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { diff --git a/x-pack/plugin/ccr/qa/security/build.gradle b/x-pack/plugin/ccr/qa/security/build.gradle index 3d7da86529394..db3dac6b3e54f 100644 --- a/x-pack/plugin/ccr/qa/security/build.gradle +++ b/x-pack/plugin/ccr/qa/security/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { diff --git a/x-pack/plugin/core/build.gradle b/x-pack/plugin/core/build.gradle index 8cbe2d1fa0895..4bb6e27c495d1 100644 --- a/x-pack/plugin/core/build.gradle +++ b/x-pack/plugin/core/build.gradle @@ -4,7 +4,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams import java.nio.file.Files import java.nio.file.Paths -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.publish' apply plugin: 'elasticsearch.internal-cluster-test' apply plugin: 'elasticsearch.yaml-rest-test' diff --git a/x-pack/plugin/data-streams/build.gradle b/x-pack/plugin/data-streams/build.gradle index 30f8ffc03c5a5..06dc0b9cdcae5 100644 --- a/x-pack/plugin/data-streams/build.gradle +++ b/x-pack/plugin/data-streams/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'x-pack-data-streams' diff --git a/x-pack/plugin/deprecation/build.gradle b/x-pack/plugin/deprecation/build.gradle index 5852610a534c5..3e0c6a0943aca 100644 --- a/x-pack/plugin/deprecation/build.gradle +++ b/x-pack/plugin/deprecation/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'x-pack-deprecation' diff --git a/x-pack/plugin/deprecation/qa/rest/build.gradle b/x-pack/plugin/deprecation/qa/rest/build.gradle index b2145ef775e53..9ffaa4ca2675e 100644 --- a/x-pack/plugin/deprecation/qa/rest/build.gradle +++ b/x-pack/plugin/deprecation/qa/rest/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.util.GradleUtils import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.java-rest-test' esplugin { diff --git a/x-pack/plugin/enrich/build.gradle b/x-pack/plugin/enrich/build.gradle index 9ae887b3d86db..26f3ab4bd5913 100644 --- a/x-pack/plugin/enrich/build.gradle +++ b/x-pack/plugin/enrich/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'x-pack-enrich' diff --git a/x-pack/plugin/eql/build.gradle b/x-pack/plugin/eql/build.gradle index 85bde933306f1..e7d31ad7c7029 100644 --- a/x-pack/plugin/eql/build.gradle +++ b/x-pack/plugin/eql/build.gradle @@ -1,5 +1,5 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'x-pack-eql' diff --git a/x-pack/plugin/eql/qa/correctness/build.gradle b/x-pack/plugin/eql/qa/correctness/build.gradle index d0f175155d6db..9782cbca220d1 100644 --- a/x-pack/plugin/eql/qa/correctness/build.gradle +++ b/x-pack/plugin/eql/qa/correctness/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'elasticsearch.java-rest-test' apply plugin: 'elasticsearch.build' -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' tasks.named("test").configure { enabled = false } import org.elasticsearch.gradle.testclusters.RunTask diff --git a/x-pack/plugin/eql/qa/mixed-node/build.gradle b/x-pack/plugin/eql/qa/mixed-node/build.gradle index 41aa209a56c20..bb1c3516d248c 100644 --- a/x-pack/plugin/eql/qa/mixed-node/build.gradle +++ b/x-pack/plugin/eql/qa/mixed-node/build.gradle @@ -1,10 +1,10 @@ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-test' import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask diff --git a/x-pack/plugin/fleet/build.gradle b/x-pack/plugin/fleet/build.gradle index 8c3f3e7d1b692..fecc258a16e80 100644 --- a/x-pack/plugin/fleet/build.gradle +++ b/x-pack/plugin/fleet/build.gradle @@ -5,7 +5,7 @@ * 2.0. */ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' apply plugin: 'elasticsearch.java-rest-test' diff --git a/x-pack/plugin/frozen-indices/build.gradle b/x-pack/plugin/frozen-indices/build.gradle index 418e10b6d476e..169b02584f5fe 100644 --- a/x-pack/plugin/frozen-indices/build.gradle +++ b/x-pack/plugin/frozen-indices/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'frozen-indices' diff --git a/x-pack/plugin/graph/build.gradle b/x-pack/plugin/graph/build.gradle index 22f321e98feb5..839bb68c6a4bd 100644 --- a/x-pack/plugin/graph/build.gradle +++ b/x-pack/plugin/graph/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'x-pack-graph' diff --git a/x-pack/plugin/identity-provider/build.gradle b/x-pack/plugin/identity-provider/build.gradle index 299f27ab36c96..c7f21f8c3a922 100644 --- a/x-pack/plugin/identity-provider/build.gradle +++ b/x-pack/plugin/identity-provider/build.gradle @@ -1,5 +1,5 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.publish' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { diff --git a/x-pack/plugin/ilm/build.gradle b/x-pack/plugin/ilm/build.gradle index 8c536f8b1d33c..b880850657924 100644 --- a/x-pack/plugin/ilm/build.gradle +++ b/x-pack/plugin/ilm/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { diff --git a/x-pack/plugin/ilm/qa/multi-cluster/build.gradle b/x-pack/plugin/ilm/qa/multi-cluster/build.gradle index 663e0d8918332..5a4e88b129da9 100644 --- a/x-pack/plugin/ilm/qa/multi-cluster/build.gradle +++ b/x-pack/plugin/ilm/qa/multi-cluster/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { diff --git a/x-pack/plugin/logstash/build.gradle b/x-pack/plugin/logstash/build.gradle index 9a3649b2e3b0d..6d1ab3f57d2f9 100644 --- a/x-pack/plugin/logstash/build.gradle +++ b/x-pack/plugin/logstash/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.java-rest-test' esplugin { diff --git a/x-pack/plugin/mapper-aggregate-metric/build.gradle b/x-pack/plugin/mapper-aggregate-metric/build.gradle index 386c601ba155b..6dfe2d5049ced 100644 --- a/x-pack/plugin/mapper-aggregate-metric/build.gradle +++ b/x-pack/plugin/mapper-aggregate-metric/build.gradle @@ -7,7 +7,7 @@ evaluationDependsOn(xpackModule('core')) -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'x-pack-aggregate-metric' diff --git a/x-pack/plugin/mapper-constant-keyword/build.gradle b/x-pack/plugin/mapper-constant-keyword/build.gradle index 7c5c858f84140..3b80893515753 100644 --- a/x-pack/plugin/mapper-constant-keyword/build.gradle +++ b/x-pack/plugin/mapper-constant-keyword/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { diff --git a/x-pack/plugin/mapper-unsigned-long/build.gradle b/x-pack/plugin/mapper-unsigned-long/build.gradle index c6f3b3d3aa22a..609cab576f807 100644 --- a/x-pack/plugin/mapper-unsigned-long/build.gradle +++ b/x-pack/plugin/mapper-unsigned-long/build.gradle @@ -7,7 +7,7 @@ evaluationDependsOn(xpackModule('core')) -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'unsigned-long' diff --git a/x-pack/plugin/mapper-version/build.gradle b/x-pack/plugin/mapper-version/build.gradle index adaa4c7621a89..557d43c0d9f18 100644 --- a/x-pack/plugin/mapper-version/build.gradle +++ b/x-pack/plugin/mapper-version/build.gradle @@ -1,6 +1,6 @@ evaluationDependsOn(xpackModule('core')) -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { diff --git a/x-pack/plugin/ml/build.gradle b/x-pack/plugin/ml/build.gradle index 573f2958987ff..1a503f3b45627 100644 --- a/x-pack/plugin/ml/build.gradle +++ b/x-pack/plugin/ml/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' apply plugin: 'elasticsearch.internal-test-artifact' diff --git a/x-pack/plugin/monitoring/build.gradle b/x-pack/plugin/monitoring/build.gradle index a1902083b85e1..c311911de1878 100644 --- a/x-pack/plugin/monitoring/build.gradle +++ b/x-pack/plugin/monitoring/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' apply plugin: 'elasticsearch.internal-test-artifact' diff --git a/x-pack/plugin/ql/build.gradle b/x-pack/plugin/ql/build.gradle index 820b13e1c7747..352ad41a667a4 100644 --- a/x-pack/plugin/ql/build.gradle +++ b/x-pack/plugin/ql/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-test-artifact' esplugin { diff --git a/x-pack/plugin/repositories-metering-api/build.gradle b/x-pack/plugin/repositories-metering-api/build.gradle index 620b3e79a2b9e..68431fd7096c3 100644 --- a/x-pack/plugin/repositories-metering-api/build.gradle +++ b/x-pack/plugin/repositories-metering-api/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-test-artifact' esplugin { diff --git a/x-pack/plugin/repository-encrypted/build.gradle b/x-pack/plugin/repository-encrypted/build.gradle index 2db82b4cf0838..71c8acf335e31 100644 --- a/x-pack/plugin/repository-encrypted/build.gradle +++ b/x-pack/plugin/repository-encrypted/build.gradle @@ -1,6 +1,6 @@ evaluationDependsOn(xpackModule('core')) -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'repository-encrypted' diff --git a/x-pack/plugin/rollup/build.gradle b/x-pack/plugin/rollup/build.gradle index 6cd7648277586..f825239e4c6e8 100644 --- a/x-pack/plugin/rollup/build.gradle +++ b/x-pack/plugin/rollup/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'x-pack-rollup' description 'Elasticsearch Expanded Pack Plugin - Rollup' diff --git a/x-pack/plugin/search-business-rules/build.gradle b/x-pack/plugin/search-business-rules/build.gradle index ac3545c8ce759..f3a062c6eef26 100644 --- a/x-pack/plugin/search-business-rules/build.gradle +++ b/x-pack/plugin/search-business-rules/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { diff --git a/x-pack/plugin/searchable-snapshots/build.gradle b/x-pack/plugin/searchable-snapshots/build.gradle index 9f3773d293a1f..4504535e4a121 100644 --- a/x-pack/plugin/searchable-snapshots/build.gradle +++ b/x-pack/plugin/searchable-snapshots/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.internal-cluster-test' -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-test-artifact' esplugin { diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index 4ef8bd0271791..cfc644fb5ee59 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.publish' apply plugin: 'elasticsearch.internal-cluster-test' apply plugin: 'elasticsearch.internal-test-artifact' @@ -455,7 +455,7 @@ tasks.named("thirdPartyAudit").configure { 'com.google.crypto.tink.subtle.X25519', 'com.nimbusds.common.contenttype.ContentType' ) - + if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) { ignoreMissingClasses( 'javax.xml.bind.JAXBContext', diff --git a/x-pack/plugin/security/qa/operator-privileges-tests/build.gradle b/x-pack/plugin/security/qa/operator-privileges-tests/build.gradle index c0aef8121b9da..5fa59af0afaf2 100644 --- a/x-pack/plugin/security/qa/operator-privileges-tests/build.gradle +++ b/x-pack/plugin/security/qa/operator-privileges-tests/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.java-rest-test' esplugin { diff --git a/x-pack/plugin/shutdown/build.gradle b/x-pack/plugin/shutdown/build.gradle index dc8f29c7c17bd..9c4fdfeb1b0b4 100644 --- a/x-pack/plugin/shutdown/build.gradle +++ b/x-pack/plugin/shutdown/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { diff --git a/x-pack/plugin/snapshot-repo-test-kit/build.gradle b/x-pack/plugin/snapshot-repo-test-kit/build.gradle index 142c2d198d769..a19a05024e611 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/build.gradle +++ b/x-pack/plugin/snapshot-repo-test-kit/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.internal-cluster-test' -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-test-artifact' esplugin { diff --git a/x-pack/plugin/snapshot-repo-test-kit/qa/rest/build.gradle b/x-pack/plugin/snapshot-repo-test-kit/qa/rest/build.gradle index 9572362314f77..8d5b307e42014 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/qa/rest/build.gradle +++ b/x-pack/plugin/snapshot-repo-test-kit/qa/rest/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/plugin/spatial/build.gradle b/x-pack/plugin/spatial/build.gradle index 5eb9b0b403105..0c452a8b77e02 100644 --- a/x-pack/plugin/spatial/build.gradle +++ b/x-pack/plugin/spatial/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' apply plugin: 'elasticsearch.yaml-rest-test' diff --git a/x-pack/plugin/sql/build.gradle b/x-pack/plugin/sql/build.gradle index 2792f2c0bae85..6b447e8a1bdf7 100644 --- a/x-pack/plugin/sql/build.gradle +++ b/x-pack/plugin/sql/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' import org.elasticsearch.gradle.internal.info.BuildParams diff --git a/x-pack/plugin/sql/qa/jdbc/build.gradle b/x-pack/plugin/sql/qa/jdbc/build.gradle index 0a9b6393fdb8a..72d8dbc9d4fd7 100644 --- a/x-pack/plugin/sql/qa/jdbc/build.gradle +++ b/x-pack/plugin/sql/qa/jdbc/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.BwcVersions.UnreleasedVersionInfo import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask @@ -56,7 +56,7 @@ subprojects { if (project.name != 'security') { // The security project just configures its subprojects - apply plugin: 'elasticsearch.testclusters' + apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.rest-test' testClusters.all { diff --git a/x-pack/plugin/sql/qa/mixed-node/build.gradle b/x-pack/plugin/sql/qa/mixed-node/build.gradle index ca1f6707803e0..0c0869cd4d57d 100644 --- a/x-pack/plugin/sql/qa/mixed-node/build.gradle +++ b/x-pack/plugin/sql/qa/mixed-node/build.gradle @@ -1,10 +1,10 @@ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-test' import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask diff --git a/x-pack/plugin/sql/qa/server/build.gradle b/x-pack/plugin/sql/qa/server/build.gradle index fd4118ba8d83e..f628284d5947f 100644 --- a/x-pack/plugin/sql/qa/server/build.gradle +++ b/x-pack/plugin/sql/qa/server/build.gradle @@ -103,7 +103,7 @@ subprojects { if (project.name != 'security') { // The security project just configures its subprojects - apply plugin: 'elasticsearch.testclusters' + apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.rest-test' testClusters.matching { it.name == "integTest" }.configureEach { diff --git a/x-pack/plugin/stack/build.gradle b/x-pack/plugin/stack/build.gradle index dabfb887a60ad..f40b2987afb2a 100644 --- a/x-pack/plugin/stack/build.gradle +++ b/x-pack/plugin/stack/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'x-pack-stack' diff --git a/x-pack/plugin/text-structure/build.gradle b/x-pack/plugin/text-structure/build.gradle index 085547989ee92..4c9d3552f7e33 100644 --- a/x-pack/plugin/text-structure/build.gradle +++ b/x-pack/plugin/text-structure/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'x-pack-text-structure' description 'Elasticsearch Expanded Pack Plugin - Text Structure' diff --git a/x-pack/plugin/transform/build.gradle b/x-pack/plugin/transform/build.gradle index d5a2484e66c38..28b4e9e342bc5 100644 --- a/x-pack/plugin/transform/build.gradle +++ b/x-pack/plugin/transform/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'transform' diff --git a/x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle b/x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle index 89515069d0547..b3c3d17aba65c 100644 --- a/x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle +++ b/x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/plugin/vectors/build.gradle b/x-pack/plugin/vectors/build.gradle index 87f48661d2cf6..8495c5caede9b 100644 --- a/x-pack/plugin/vectors/build.gradle +++ b/x-pack/plugin/vectors/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'vectors' diff --git a/x-pack/plugin/voting-only-node/build.gradle b/x-pack/plugin/voting-only-node/build.gradle index 3bff80d995d59..e3895c35455fe 100644 --- a/x-pack/plugin/voting-only-node/build.gradle +++ b/x-pack/plugin/voting-only-node/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'x-pack-voting-only-node' diff --git a/x-pack/plugin/watcher/build.gradle b/x-pack/plugin/watcher/build.gradle index 9cce77fbbf438..b3a6662d65049 100644 --- a/x-pack/plugin/watcher/build.gradle +++ b/x-pack/plugin/watcher/build.gradle @@ -1,7 +1,8 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' + esplugin { name 'x-pack-watcher' description 'Elasticsearch Expanded Pack Plugin - Watcher' diff --git a/x-pack/plugin/wildcard/build.gradle b/x-pack/plugin/wildcard/build.gradle index 79528c64b394d..2c7c1d877d20d 100644 --- a/x-pack/plugin/wildcard/build.gradle +++ b/x-pack/plugin/wildcard/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'wildcard' diff --git a/x-pack/qa/core-rest-tests-with-security/build.gradle b/x-pack/qa/core-rest-tests-with-security/build.gradle index d00e662a91a72..80414934c7b4e 100644 --- a/x-pack/qa/core-rest-tests-with-security/build.gradle +++ b/x-pack/qa/core-rest-tests-with-security/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/qa/full-cluster-restart/build.gradle b/x-pack/qa/full-cluster-restart/build.gradle index 759025ad82cd7..b1f171932fdf1 100644 --- a/x-pack/qa/full-cluster-restart/build.gradle +++ b/x-pack/qa/full-cluster-restart/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.bwc-test' diff --git a/x-pack/qa/kerberos-tests/build.gradle b/x-pack/qa/kerberos-tests/build.gradle index 2c0edc01418a5..23040f5725edc 100644 --- a/x-pack/qa/kerberos-tests/build.gradle +++ b/x-pack/qa/kerberos-tests/build.gradle @@ -1,7 +1,7 @@ import java.nio.file.Path import java.nio.file.Paths -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test.fixtures' diff --git a/x-pack/qa/mixed-tier-cluster/build.gradle b/x-pack/qa/mixed-tier-cluster/build.gradle index 6b3c0ddf732e3..d8c4568b6b2fe 100644 --- a/x-pack/qa/mixed-tier-cluster/build.gradle +++ b/x-pack/qa/mixed-tier-cluster/build.gradle @@ -1,10 +1,10 @@ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-test' import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask diff --git a/x-pack/qa/multi-cluster-search-security/build.gradle b/x-pack/qa/multi-cluster-search-security/build.gradle index 498daacfaa21c..7dd1b3816632a 100644 --- a/x-pack/qa/multi-cluster-search-security/build.gradle +++ b/x-pack/qa/multi-cluster-search-security/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/qa/multi-node/build.gradle b/x-pack/qa/multi-node/build.gradle index 35e90a23e8179..17f70842d0e8f 100644 --- a/x-pack/qa/multi-node/build.gradle +++ b/x-pack/qa/multi-node/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' diff --git a/x-pack/qa/oidc-op-tests/build.gradle b/x-pack/qa/oidc-op-tests/build.gradle index 72d94c439603e..37e877e20977b 100644 --- a/x-pack/qa/oidc-op-tests/build.gradle +++ b/x-pack/qa/oidc-op-tests/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.Architecture Project idpFixtureProject = xpackProject("test:idp-fixture") -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test.fixtures' diff --git a/x-pack/qa/password-protected-keystore/build.gradle b/x-pack/qa/password-protected-keystore/build.gradle index 6204d5aaf6207..883c6d3b47e15 100644 --- a/x-pack/qa/password-protected-keystore/build.gradle +++ b/x-pack/qa/password-protected-keystore/build.gradle @@ -3,7 +3,7 @@ * is using a password protected keystore in its nodes. */ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { diff --git a/x-pack/qa/reindex-tests-with-security/build.gradle b/x-pack/qa/reindex-tests-with-security/build.gradle index 977f95e64220b..e30368f4e0090 100644 --- a/x-pack/qa/reindex-tests-with-security/build.gradle +++ b/x-pack/qa/reindex-tests-with-security/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/qa/rolling-upgrade-basic/build.gradle b/x-pack/qa/rolling-upgrade-basic/build.gradle index ba227538d5455..6ca6ffd0febbd 100644 --- a/x-pack/qa/rolling-upgrade-basic/build.gradle +++ b/x-pack/qa/rolling-upgrade-basic/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.bwc-test' diff --git a/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle b/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle index a90421991fadd..def51537e1f59 100644 --- a/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle +++ b/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.bwc-test' diff --git a/x-pack/qa/rolling-upgrade/build.gradle b/x-pack/qa/rolling-upgrade/build.gradle index 577e40198305b..f8eda900e073c 100644 --- a/x-pack/qa/rolling-upgrade/build.gradle +++ b/x-pack/qa/rolling-upgrade/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/qa/saml-idp-tests/build.gradle b/x-pack/qa/saml-idp-tests/build.gradle index 92593e17ff946..03cbeae17717a 100644 --- a/x-pack/qa/saml-idp-tests/build.gradle +++ b/x-pack/qa/saml-idp-tests/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.Architecture Project idpFixtureProject = xpackProject("test:idp-fixture") -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test.fixtures' diff --git a/x-pack/qa/security-example-spi-extension/build.gradle b/x-pack/qa/security-example-spi-extension/build.gradle index c6a4cbd882f7f..1a29b9c5ee55e 100644 --- a/x-pack/qa/security-example-spi-extension/build.gradle +++ b/x-pack/qa/security-example-spi-extension/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.util.GradleUtils apply plugin: 'elasticsearch.java-rest-test' -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { name 'spi-extension' diff --git a/x-pack/qa/security-setup-password-tests/build.gradle b/x-pack/qa/security-setup-password-tests/build.gradle index ce527c2a98785..08013261ba448 100644 --- a/x-pack/qa/security-setup-password-tests/build.gradle +++ b/x-pack/qa/security-setup-password-tests/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' diff --git a/x-pack/qa/smoke-test-plugins-ssl/build.gradle b/x-pack/qa/smoke-test-plugins-ssl/build.gradle index 635e003a4899e..4460e4913ff67 100644 --- a/x-pack/qa/smoke-test-plugins-ssl/build.gradle +++ b/x-pack/qa/smoke-test-plugins-ssl/build.gradle @@ -4,7 +4,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.MavenFilteringHack import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/qa/smoke-test-plugins/build.gradle b/x-pack/qa/smoke-test-plugins/build.gradle index 93c8b22373cca..5739aeb785118 100644 --- a/x-pack/qa/smoke-test-plugins/build.gradle +++ b/x-pack/qa/smoke-test-plugins/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.internal.MavenFilteringHack import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/qa/smoke-test-security-with-mustache/build.gradle b/x-pack/qa/smoke-test-security-with-mustache/build.gradle index ca76caf5c7556..2e9276d27272f 100644 --- a/x-pack/qa/smoke-test-security-with-mustache/build.gradle +++ b/x-pack/qa/smoke-test-security-with-mustache/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/qa/third-party/jira/build.gradle b/x-pack/qa/third-party/jira/build.gradle index 7c39714b00ef7..8a39f061f2de4 100644 --- a/x-pack/qa/third-party/jira/build.gradle +++ b/x-pack/qa/third-party/jira/build.gradle @@ -5,7 +5,7 @@ import java.nio.charset.StandardCharsets import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/qa/third-party/pagerduty/build.gradle b/x-pack/qa/third-party/pagerduty/build.gradle index 967a6dca6e805..12d0f06edf775 100644 --- a/x-pack/qa/third-party/pagerduty/build.gradle +++ b/x-pack/qa/third-party/pagerduty/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/qa/third-party/slack/build.gradle b/x-pack/qa/third-party/slack/build.gradle index addc489255418..46092bb660e03 100644 --- a/x-pack/qa/third-party/slack/build.gradle +++ b/x-pack/qa/third-party/slack/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' diff --git a/x-pack/quota-aware-fs/build.gradle b/x-pack/quota-aware-fs/build.gradle index f858c2b9bbec9..90dceb82b07c3 100644 --- a/x-pack/quota-aware-fs/build.gradle +++ b/x-pack/quota-aware-fs/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-es-plugin' esplugin { description 'A bootstrap plugin that adds support for interfacing with filesystem that enforce user quotas.' diff --git a/x-pack/test/idp-fixture/build.gradle b/x-pack/test/idp-fixture/build.gradle index cd435c1c55ca5..c41ff7729ed73 100644 --- a/x-pack/test/idp-fixture/build.gradle +++ b/x-pack/test/idp-fixture/build.gradle @@ -1,5 +1,6 @@ -import org.elasticsearch.gradle.internal.VersionProperties +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.Architecture +import static org.elasticsearch.gradle.internal.distribution.InternalElasticsearchDistributionTypes.DOCKER; apply plugin: 'elasticsearch.test.fixtures' apply plugin: 'elasticsearch.internal-distribution-download' @@ -16,7 +17,7 @@ tasks.register("copyKeystore", Sync) { elasticsearch_distributions { docker { - type = 'docker' + type = DOCKER architecture = Architecture.current() version = VersionProperties.getElasticsearch() failIfUnavailable = false // This ensures we skip this testing if Docker is unavailable