mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Remove internal build logic from public build tool plugins (#72470)
Extract usage of internal API from TestClustersPlugin and PluginBuildPlugin and related plugins and build logic This includes a refactoring of ElasticsearchDistribution to handle types better in a way we can differentiate between supported Elasticsearch Distribution types supported in TestCkustersPlugin and types only supported in internal plugins. It also introduces a set of internal versions of public plugins. As part of this we also generate the plugin descriptors now. As a follow up on this we can actually move these public used classes into an extra project (declared as included build) We keep LoggedExec and VersionProperties effectively public And workaround for RestTestBase
This commit is contained in:
parent
73e0662f09
commit
e609e07cfe
222 changed files with 1183 additions and 853 deletions
21
build.gradle
21
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.0" apply false
|
||||
}
|
||||
|
@ -108,6 +111,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)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -129,7 +145,6 @@ ext.testArtifact = { p, String name = "test" ->
|
|||
};
|
||||
}
|
||||
|
||||
|
||||
tasks.register("updateCIBwcVersions") {
|
||||
doLast {
|
||||
File yml = file(".ci/bwcVersions")
|
||||
|
|
|
@ -36,6 +36,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"
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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'
|
||||
"""
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
@ -57,7 +57,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'
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
|
|||
file('notice.txt') << "Notice file"
|
||||
buildFile << """
|
||||
plugins {
|
||||
id 'elasticsearch.esplugin'
|
||||
id 'elasticsearch.internal-es-plugin'
|
||||
id 'elasticsearch.publish'
|
||||
}
|
||||
|
|
@ -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
|
|
@ -6,14 +6,15 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.gradle
|
||||
package org.elasticsearch.gradle.internal.test.rest
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import com.fasterxml.jackson.databind.SequenceWriter
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode
|
||||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
|
||||
import org.elasticsearch.gradle.Version
|
||||
import org.elasticsearch.gradle.fixtures.AbstractRestResourcesFuncTest
|
||||
import org.elasticsearch.gradle.internal.VersionProperties
|
||||
import org.elasticsearch.gradle.VersionProperties
|
||||
import org.gradle.testkit.runner.TaskOutcome
|
||||
|
||||
class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest {
|
||||
|
@ -29,7 +30,6 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest {
|
|||
|
||||
def "yamlRestCompatTest does nothing when there are no tests"() {
|
||||
given:
|
||||
|
||||
addSubProject(":distribution:bwc:minor") << """
|
||||
configurations { checkout }
|
||||
artifacts {
|
|
@ -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
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<Project> {
|
|||
|
||||
@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')
|
||||
|
||||
|
|
|
@ -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) {
|
|
@ -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.dsl.DependencyHandler;
|
|||
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<Project> {
|
|||
private NamedDomainObjectContainer<ElasticsearchDistribution> distributionsContainer;
|
||||
private NamedDomainObjectContainer<DistributionResolution> distributionsResolutionStrategiesContainer;
|
||||
|
||||
private Property<Boolean> dockerAvailability;
|
||||
|
||||
@Inject
|
||||
public DistributionDownloadPlugin(ObjectFactory objectFactory) {
|
||||
this.dockerAvailability = objectFactory.property(Boolean.class).value(false);
|
||||
}
|
||||
|
||||
public void setDockerAvailability(Provider<Boolean> dockerAvailability) {
|
||||
this.dockerAvailability.set(dockerAvailability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
project.getRootProject().getPluginManager().apply(DockerSupportPlugin.class);
|
||||
Provider<DockerSupportService> 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 class DistributionDownloadPlugin implements Plugin<Project> {
|
|||
});
|
||||
|
||||
setupResolutionsContainer(project);
|
||||
setupDistributionContainer(project, dockerSupport);
|
||||
setupDistributionContainer(project, dockerAvailability);
|
||||
setupDownloadServiceRepo(project);
|
||||
}
|
||||
|
||||
private void setupDistributionContainer(Project project, Provider<DockerSupportService> dockerSupport) {
|
||||
private void setupDistributionContainer(Project project, Property<Boolean> 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 @@ public class DistributionDownloadPlugin implements Plugin<Project> {
|
|||
return new ElasticsearchDistribution(
|
||||
name,
|
||||
project.getObjects(),
|
||||
dockerSupport,
|
||||
dockerAvailability,
|
||||
fileConfiguration,
|
||||
extractedConfiguration,
|
||||
(dist) -> finalizeDistributionDependencies(project, dist)
|
||||
|
@ -160,23 +163,12 @@ public class DistributionDownloadPlugin implements Plugin<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) {
|
||||
classifier = ":amd64";
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
package org.elasticsearch.gradle;
|
||||
|
||||
import org.elasticsearch.gradle.internal.DistributionDependency;
|
||||
import org.gradle.api.Project;
|
||||
|
||||
public class DistributionResolution {
|
||||
|
|
|
@ -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 class ElasticsearchDistribution implements Buildable, Iterable<File> {
|
|||
}
|
||||
}
|
||||
|
||||
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.<Platform>conditional()
|
||||
.onLinux(() -> Platform.LINUX)
|
||||
|
@ -87,13 +42,13 @@ public class ElasticsearchDistribution implements Buildable, Iterable<File> {
|
|||
.supply();
|
||||
|
||||
private final String name;
|
||||
private final Provider<DockerSupportService> dockerSupport;
|
||||
private final Property<Boolean> dockerAvailability;
|
||||
// pkg private so plugin can configure
|
||||
final Configuration configuration;
|
||||
|
||||
private final Property<Architecture> architecture;
|
||||
private final Property<String> version;
|
||||
private final Property<Type> type;
|
||||
private final Property<ElasticsearchDistributionType> type;
|
||||
private final Property<Platform> platform;
|
||||
private final Property<Boolean> bundledJdk;
|
||||
private final Property<Boolean> failIfUnavailable;
|
||||
|
@ -104,18 +59,18 @@ public class ElasticsearchDistribution implements Buildable, Iterable<File> {
|
|||
ElasticsearchDistribution(
|
||||
String name,
|
||||
ObjectFactory objectFactory,
|
||||
Provider<DockerSupportService> dockerSupport,
|
||||
Property<Boolean> dockerAvailability,
|
||||
Configuration fileConfiguration,
|
||||
Configuration extractedConfiguration,
|
||||
Action<ElasticsearchDistribution> 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 class ElasticsearchDistribution implements Buildable, Iterable<File> {
|
|||
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 class ElasticsearchDistribution implements Buildable, Iterable<File> {
|
|||
}
|
||||
|
||||
public Configuration getExtracted() {
|
||||
switch (getType()) {
|
||||
case DEB:
|
||||
case DOCKER:
|
||||
case DOCKER_UBI:
|
||||
case DOCKER_IRON_BANK:
|
||||
case RPM:
|
||||
if (getType().shouldExtract() == false) {
|
||||
throw new UnsupportedOperationException(
|
||||
"distribution type [" + getType() + "] for " + "elasticsearch distribution [" + name + "] cannot be extracted"
|
||||
"distribution type [" + getType().getName() + "] for " + "elasticsearch distribution [" + name + "] cannot be extracted"
|
||||
);
|
||||
|
||||
default:
|
||||
return extracted;
|
||||
}
|
||||
return extracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -231,7 +192,7 @@ public class ElasticsearchDistribution implements Buildable, Iterable<File> {
|
|||
}
|
||||
|
||||
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 class ElasticsearchDistribution implements Buildable, Iterable<File> {
|
|||
|
||||
// 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 @@ public class ElasticsearchDistribution implements Buildable, Iterable<File> {
|
|||
);
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
|
@ -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;
|
|
@ -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 class ReaperPlugin implements Plugin<Project> {
|
|||
|
||||
@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);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ public abstract class ReaperService implements BuildService<ReaperService.Params
|
|||
shutdown();
|
||||
}
|
||||
|
||||
interface Params extends BuildServiceParameters {
|
||||
public interface Params extends BuildServiceParameters {
|
||||
Boolean getInternal();
|
||||
|
||||
void setInternal(Boolean internal);
|
||||
|
|
|
@ -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;
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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();
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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<Project> {
|
|||
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(
|
||||
|
@ -44,18 +41,7 @@ public class BuildPlugin implements Plugin<Project> {
|
|||
project.getPluginManager().apply(DependenciesInfoPlugin.class);
|
||||
project.getPluginManager().apply(DependenciesGraphPlugin.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) {
|
||||
|
|
|
@ -10,6 +10,7 @@ package org.elasticsearch.gradle.internal;
|
|||
|
||||
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;
|
||||
|
|
|
@ -9,6 +9,7 @@ package org.elasticsearch.gradle.internal;
|
|||
|
||||
import org.elasticsearch.gradle.Architecture;
|
||||
import org.elasticsearch.gradle.Version;
|
||||
import org.elasticsearch.gradle.VersionProperties;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
|
|
@ -10,6 +10,7 @@ package org.elasticsearch.gradle.internal;
|
|||
|
||||
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;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
package org.elasticsearch.gradle.internal;
|
||||
|
||||
import org.elasticsearch.gradle.LoggedExec;
|
||||
import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin;
|
||||
import org.gradle.api.Action;
|
||||
import org.gradle.api.GradleException;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<DockerSupportService> 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 class InternalDistributionDownloadPlugin implements InternalPlugin {
|
|||
* BWC versions are resolved as project to projects under `:distribution:bwc`.
|
||||
*/
|
||||
private void registerInternalDistributionResolutions(NamedDomainObjectContainer<DistributionResolution> 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 @@ public class InternalDistributionDownloadPlugin implements InternalPlugin {
|
|||
: "expanded-" + distributionProjectName;
|
||||
} else {
|
||||
return distributionProjectName;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static String distributionProjectPath(ElasticsearchDistribution distribution) {
|
||||
String projectPath = ":distribution";
|
||||
switch (distribution.getType()) {
|
||||
case INTEG_TEST_ZIP:
|
||||
if (distribution.getType() == ElasticsearchDistributionTypes.INTEG_TEST_ZIP) {
|
||||
projectPath += ":archives:integ-test-zip";
|
||||
break;
|
||||
|
||||
case DOCKER:
|
||||
case DOCKER_UBI:
|
||||
case DOCKER_IRON_BANK:
|
||||
} else if (distribution.getType().isDocker()) {
|
||||
projectPath += ":docker:";
|
||||
projectPath += distributionProjectName(distribution);
|
||||
break;
|
||||
|
||||
default:
|
||||
projectPath += distribution.getType() == ElasticsearchDistribution.Type.ARCHIVE ? ":archives:" : ":packages:";
|
||||
} else {
|
||||
projectPath += distribution.getType() == ElasticsearchDistributionTypes.ARCHIVE ? ":archives:" : ":packages:";
|
||||
projectPath += distributionProjectName(distribution);
|
||||
break;
|
||||
}
|
||||
return projectPath;
|
||||
}
|
||||
|
@ -149,24 +151,21 @@ public class InternalDistributionDownloadPlugin implements InternalPlugin {
|
|||
projectName += "no-jdk-";
|
||||
}
|
||||
|
||||
switch (distribution.getType()) {
|
||||
case ARCHIVE:
|
||||
if (distribution.getType() == ElasticsearchDistributionTypes.ARCHIVE) {
|
||||
return projectName + platform.toString() + archString + (platform == ElasticsearchDistribution.Platform.WINDOWS
|
||||
? "-zip"
|
||||
: "-tar");
|
||||
|
||||
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() == 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 {
|
||||
|
|
|
@ -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<Object>(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<Project> 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));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<Project> {
|
||||
private final ProjectLayout projectLayout;
|
||||
|
||||
@Inject
|
||||
public InternalReaperPlugin(ProjectLayout projectLayout) {
|
||||
this.projectLayout = projectLayout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
registerReaperService(project, projectLayout, true);
|
||||
}
|
||||
}
|
|
@ -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<Project> {
|
||||
|
||||
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()));
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
|
@ -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;
|
||||
|
|
|
@ -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 ":amd64";
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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<ElasticsearchDistributionType> ALL_INTERNAL = List.of(DEB, RPM, DOCKER, DOCKER_UBI, DOCKER_IRONBANK);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -19,7 +19,11 @@ public class LoggerUsagePrecommitPlugin extends PrecommitPlugin implements Inter
|
|||
@Override
|
||||
public TaskProvider<? extends Task> createTask(Project project) {
|
||||
Configuration loggerUsageConfig = project.getConfigurations().create("loggerUsagePlugin");
|
||||
// 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<LoggerUsageTask> loggerUsage = project.getTasks().register("loggerUsageCheck", LoggerUsageTask.class);
|
||||
loggerUsage.configure(t -> t.setClasspath(loggerUsageConfig));
|
||||
return loggerUsage;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.fasterxml.jackson.databind.node.TextNode;
|
|||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
|
||||
import com.fasterxml.jackson.dataformat.yaml.YAMLParser;
|
||||
import org.elasticsearch.gradle.Version;
|
||||
import org.elasticsearch.gradle.internal.VersionProperties;
|
||||
import org.elasticsearch.gradle.VersionProperties;
|
||||
import org.elasticsearch.gradle.internal.test.rest.transform.RestTestTransform;
|
||||
import org.elasticsearch.gradle.internal.test.rest.transform.RestTestTransformer;
|
||||
import org.elasticsearch.gradle.internal.test.rest.transform.headers.InjectHeaders;
|
||||
|
|
|
@ -10,7 +10,7 @@ package org.elasticsearch.gradle.internal.rest.compat;
|
|||
|
||||
import org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin;
|
||||
import org.elasticsearch.gradle.Version;
|
||||
import org.elasticsearch.gradle.internal.VersionProperties;
|
||||
import org.elasticsearch.gradle.VersionProperties;
|
||||
import org.elasticsearch.gradle.internal.test.RestIntegTestTask;
|
||||
import org.elasticsearch.gradle.internal.test.RestTestBasePlugin;
|
||||
import org.elasticsearch.gradle.internal.test.rest.CopyRestApiTask;
|
||||
|
|
|
@ -12,11 +12,11 @@ import org.elasticsearch.gradle.Architecture;
|
|||
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.Map;
|
|||
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 class DistroTestPlugin implements Plugin<Project> {
|
|||
NamedDomainObjectContainer<ElasticsearchDistribution> allDistributions = DistributionDownloadPlugin.getContainer(project);
|
||||
List<ElasticsearchDistribution> testDistributions = configureDistributions(project);
|
||||
|
||||
Map<ElasticsearchDistribution.Type, TaskProvider<?>> lifecycleTasks = lifecycleTasks(project, "destructiveDistroTest");
|
||||
Map<ElasticsearchDistributionType, TaskProvider<?>> lifecycleTasks = lifecycleTasks(project, "destructiveDistroTest");
|
||||
Map<String, TaskProvider<?>> versionTasks = versionTasks(project, "destructiveDistroUpgradeTest");
|
||||
TaskProvider<Task> destructiveDistroTest = project.getTasks().register("destructiveDistroTest");
|
||||
|
||||
|
@ -96,7 +103,7 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
Configuration quotaAwareFsPlugin = configureQuotaAwareFsPlugin(project);
|
||||
|
||||
List<TaskProvider<Test>> windowsTestTasks = new ArrayList<>();
|
||||
Map<Type, List<TaskProvider<Test>>> linuxTestTasks = new HashMap<>();
|
||||
Map<ElasticsearchDistributionType, List<TaskProvider<Test>>> linuxTestTasks = new HashMap<>();
|
||||
Map<String, List<TaskProvider<Test>>> upgradeTestTasks = new HashMap<>();
|
||||
Map<String, TaskProvider<?>> depsTasks = new HashMap<>();
|
||||
|
||||
|
@ -122,7 +129,7 @@ public class DistroTestPlugin implements Plugin<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 class DistroTestPlugin implements Plugin<Project> {
|
|||
project.getConfigurations().getByName("testRuntimeClasspath")
|
||||
);
|
||||
|
||||
Map<ElasticsearchDistribution.Type, TaskProvider<?>> vmLifecyleTasks = lifecycleTasks(vmProject, "distroTest");
|
||||
Map<ElasticsearchDistributionType, TaskProvider<?>> vmLifecyleTasks = lifecycleTasks(vmProject, "distroTest");
|
||||
Map<String, TaskProvider<?>> vmVersionTasks = versionTasks(vmProject, "distroUpgradeTest");
|
||||
TaskProvider<Task> distroTest = vmProject.getTasks().register("distroTest");
|
||||
|
||||
|
@ -181,12 +188,12 @@ public class DistroTestPlugin implements Plugin<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 class DistroTestPlugin implements Plugin<Project> {
|
|||
});
|
||||
}
|
||||
|
||||
private static Map<ElasticsearchDistribution.Type, TaskProvider<?>> lifecycleTasks(Project project, String taskPrefix) {
|
||||
Map<ElasticsearchDistribution.Type, TaskProvider<?>> 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<ElasticsearchDistributionType, TaskProvider<?>> lifecycleTasks(Project project, String taskPrefix) {
|
||||
Map<ElasticsearchDistributionType, TaskProvider<?>> 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;
|
||||
}
|
||||
|
@ -364,7 +371,7 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
List<ElasticsearchDistribution> 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.
|
||||
|
@ -393,7 +400,7 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
}
|
||||
|
||||
currentDistros.add(
|
||||
createDistro(distributions, architecture, Type.ARCHIVE, platform, bundledJdk, VersionProperties.getElasticsearch())
|
||||
createDistro(distributions, architecture, ARCHIVE, platform, bundledJdk, VersionProperties.getElasticsearch())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -405,7 +412,7 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
private static ElasticsearchDistribution createDistro(
|
||||
NamedDomainObjectContainer<ElasticsearchDistribution> distributions,
|
||||
Architecture architecture,
|
||||
Type type,
|
||||
ElasticsearchDistributionType type,
|
||||
Platform platform,
|
||||
boolean bundledJdk,
|
||||
String version
|
||||
|
@ -415,7 +422,7 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
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) {
|
||||
|
@ -438,21 +445,21 @@ public class DistroTestPlugin implements Plugin<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
|
||||
+ "."
|
||||
|
|
|
@ -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 class RestTestPlugin implements Plugin<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<Task>() {
|
||||
@Override
|
||||
public void execute(Task task) {
|
||||
task.dependsOn(integTest);
|
||||
}
|
||||
});
|
||||
project.getTasks().named("check").configure(task -> task.dependsOn(integTest));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<Project> {
|
|||
|
||||
@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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
@ -51,7 +51,7 @@ public class RestTestUtil {
|
|||
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<Zip> bundle = project.getTasks().withType(Zip.class).named("bundlePlugin");
|
||||
testTask.dependsOn(bundle);
|
||||
if (GradleUtils.isModuleProject(project.getPath())) {
|
||||
|
|
|
@ -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;
|
||||
|
@ -33,7 +34,7 @@ public class VagrantBasePlugin implements Plugin<Project> {
|
|||
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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -12,19 +12,14 @@ import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin;
|
|||
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;
|
||||
|
@ -35,6 +30,7 @@ import org.gradle.api.Task;
|
|||
import org.gradle.api.Transformer;
|
||||
import org.gradle.api.file.RegularFile;
|
||||
import org.gradle.api.plugins.BasePlugin;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.gradle.api.plugins.JavaPluginExtension;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.publish.PublishingExtension;
|
||||
|
@ -51,7 +47,6 @@ import java.io.InputStream;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -60,15 +55,15 @@ import java.util.stream.Collectors;
|
|||
public class PluginBuildPlugin implements Plugin<Project> {
|
||||
@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
|
||||
|
@ -112,54 +107,7 @@ public class PluginBuildPlugin implements Plugin<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<Object>(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<Project> 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
|
||||
|
@ -193,13 +141,8 @@ public class PluginBuildPlugin implements Plugin<Project> {
|
|||
|
||||
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());
|
||||
}
|
||||
|
||||
// we "upgrade" these optional deps to provided for plugins, since they will run
|
||||
// with a full elasticsearch server that includes optional deps
|
||||
|
@ -296,28 +239,5 @@ public class PluginBuildPlugin implements Plugin<Project> {
|
|||
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";
|
||||
}
|
||||
|
|
|
@ -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<? extends Task> 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<JarHellTask> jarHell = project.getTasks().register("jarHell", JarHellTask.class);
|
||||
jarHell.configure(t -> {
|
||||
SourceSet testSourceSet = Util.getJavaTestSourceSet(project).get();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -57,6 +57,7 @@ public class ElasticsearchCluster implements TestClusterConfiguration, Named {
|
|||
private final FileSystemOperations fileSystemOperations;
|
||||
private final ArchiveOperations archiveOperations;
|
||||
private final ExecOperations execOperations;
|
||||
private final Provider<File> runtimeJava;
|
||||
private int nodeIndex = 0;
|
||||
|
||||
public ElasticsearchCluster(
|
||||
|
@ -67,7 +68,8 @@ public class ElasticsearchCluster implements TestClusterConfiguration, Named {
|
|||
FileSystemOperations fileSystemOperations,
|
||||
ArchiveOperations archiveOperations,
|
||||
ExecOperations execOperations,
|
||||
File workingDirBase
|
||||
File workingDirBase,
|
||||
Provider<File> runtimeJava
|
||||
) {
|
||||
this.path = path;
|
||||
this.clusterName = clusterName;
|
||||
|
@ -77,6 +79,7 @@ public class ElasticsearchCluster implements TestClusterConfiguration, Named {
|
|||
this.archiveOperations = archiveOperations;
|
||||
this.execOperations = execOperations;
|
||||
this.workingDirBase = workingDirBase;
|
||||
this.runtimeJava = runtimeJava;
|
||||
this.nodes = project.container(ElasticsearchNode.class);
|
||||
this.nodes.add(
|
||||
new ElasticsearchNode(
|
||||
|
@ -88,7 +91,8 @@ public class ElasticsearchCluster implements TestClusterConfiguration, Named {
|
|||
fileSystemOperations,
|
||||
archiveOperations,
|
||||
execOperations,
|
||||
workingDirBase
|
||||
workingDirBase,
|
||||
runtimeJava
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -119,7 +123,8 @@ public class ElasticsearchCluster implements TestClusterConfiguration, Named {
|
|||
fileSystemOperations,
|
||||
archiveOperations,
|
||||
execOperations,
|
||||
workingDirBase
|
||||
workingDirBase,
|
||||
runtimeJava
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,13 +14,13 @@ import org.elasticsearch.gradle.ElasticsearchDistribution;
|
|||
import org.elasticsearch.gradle.FileSupplier;
|
||||
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;
|
||||
|
@ -152,6 +152,7 @@ public class ElasticsearchNode implements TestClusterConfiguration {
|
|||
private final Path esLogFile;
|
||||
private final Path esStdinFile;
|
||||
private final Path tmpDir;
|
||||
private final Provider<File> runtimeJava;
|
||||
|
||||
private int currentDistro = 0;
|
||||
private TestDistribution testDistribution;
|
||||
|
@ -176,7 +177,8 @@ public class ElasticsearchNode implements TestClusterConfiguration {
|
|||
FileSystemOperations fileSystemOperations,
|
||||
ArchiveOperations archiveOperations,
|
||||
ExecOperations execOperations,
|
||||
File workingDirBase
|
||||
File workingDirBase,
|
||||
Provider<File> runtimeJava
|
||||
) {
|
||||
this.clusterName = clusterName;
|
||||
this.path = path;
|
||||
|
@ -186,6 +188,7 @@ public class ElasticsearchNode implements TestClusterConfiguration {
|
|||
this.fileSystemOperations = fileSystemOperations;
|
||||
this.archiveOperations = archiveOperations;
|
||||
this.execOperations = execOperations;
|
||||
this.runtimeJava = runtimeJava;
|
||||
workingDir = workingDirBase.toPath().resolve(safeName(name)).toAbsolutePath();
|
||||
confPathRepo = workingDir.resolve("repo");
|
||||
configFile = workingDir.resolve("config/elasticsearch.yml");
|
||||
|
@ -269,12 +272,12 @@ public class ElasticsearchNode implements TestClusterConfiguration {
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -762,7 +765,7 @@ public class ElasticsearchNode implements TestClusterConfiguration {
|
|||
Map<String, String> defaultEnv = new HashMap<>();
|
||||
// If we are testing the current version of Elasticsearch, use the configured runtime Java, otherwise use the bundled JDK
|
||||
if (getTestDistribution() == TestDistribution.INTEG_TEST || getVersion().equals(VersionProperties.getElasticsearchVersion())) {
|
||||
defaultEnv.put("ES_JAVA_HOME", BuildParams.getRuntimeJavaHome().getAbsolutePath());
|
||||
defaultEnv.put("ES_JAVA_HOME", runtimeJava.get().getAbsolutePath());
|
||||
}
|
||||
defaultEnv.put("ES_PATH_CONF", configFile.getParent().toString());
|
||||
String systemPropertiesString = "";
|
||||
|
|
|
@ -10,9 +10,6 @@ package org.elasticsearch.gradle.testclusters;
|
|||
import org.elasticsearch.gradle.DistributionDownloadPlugin;
|
||||
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;
|
||||
|
@ -26,7 +23,9 @@ import org.gradle.api.invocation.Gradle;
|
|||
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;
|
||||
|
@ -42,6 +41,8 @@ public class TestClustersPlugin implements Plugin<Project> {
|
|||
private static final String LIST_TASK_NAME = "listTestClusters";
|
||||
private static final String REGISTRY_SERVICE_NAME = "testClustersRegistry";
|
||||
private static final Logger logger = Logging.getLogger(TestClustersPlugin.class);
|
||||
private final ProviderFactory providerFactory;
|
||||
private Provider<File> runtimeJavaProvider;
|
||||
|
||||
@Inject
|
||||
protected FileSystemOperations getFileSystemOperations() {
|
||||
|
@ -58,16 +59,26 @@ public class TestClustersPlugin implements Plugin<Project> {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Inject
|
||||
public TestClustersPlugin(ProviderFactory providerFactory) {
|
||||
this.providerFactory = providerFactory;
|
||||
}
|
||||
|
||||
public void setRuntimeJava(Provider<File> runtimeJava) {
|
||||
this.runtimeJavaProvider = runtimeJava;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
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);
|
||||
Provider<ReaperService> reaperServiceProvider = GradleUtils.getBuildService(
|
||||
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<ElasticsearchCluster> container = createTestClustersContainerExtension(project, reaperServiceProvider);
|
||||
|
||||
|
@ -95,9 +106,8 @@ public class TestClustersPlugin implements Plugin<Project> {
|
|||
Provider<ReaperService> reaper
|
||||
) {
|
||||
// Create an extensions that allows describing clusters
|
||||
NamedDomainObjectContainer<ElasticsearchCluster> container = project.container(
|
||||
ElasticsearchCluster.class,
|
||||
name -> new ElasticsearchCluster(
|
||||
NamedDomainObjectContainer<ElasticsearchCluster> container = project.container(ElasticsearchCluster.class, name -> {
|
||||
return new ElasticsearchCluster(
|
||||
project.getPath(),
|
||||
name,
|
||||
project,
|
||||
|
@ -105,9 +115,10 @@ public class TestClustersPlugin implements Plugin<Project> {
|
|||
getFileSystemOperations(),
|
||||
getArchiveOperations(),
|
||||
getExecOperations(),
|
||||
new File(project.getBuildDir(), "testclusters")
|
||||
)
|
||||
new File(project.getBuildDir(), "testclusters"),
|
||||
runtimeJavaProvider
|
||||
);
|
||||
});
|
||||
project.getExtensions().add(EXTENSION_NAME, container);
|
||||
return container;
|
||||
}
|
||||
|
|
|
@ -13,5 +13,4 @@ package org.elasticsearch.gradle.testclusters;
|
|||
public enum TestDistribution {
|
||||
INTEG_TEST,
|
||||
DEFAULT,
|
||||
OSS
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.internal.BuildPlugin
|
|
@ -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
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.internal.docker.DockerSupportPlugin
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.internal.test.rerun.TestRerunPlugin
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.internal.JdkDownloadPlugin
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.internal.PublishPlugin
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.ReaperPlugin
|
|
@ -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
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.internal.test.RestTestPlugin
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
implementation-class=org.elasticsearch.gradle.internal.testfixtures.TestFixturesPlugin
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue