Skip to content

[7.x] Cross compile Scala code using Gradle variants (#1521) #1551

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.elasticsearch.gradle.testclusters.TestDistribution
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.TaskCollection
import org.gradle.process.CommandLineArgumentProvider

/**
Expand All @@ -30,26 +31,28 @@ class ElasticsearchFixturePlugin implements Plugin<Project> {
def hasLocalRepo = project.hasProperty("localRepo")
def useFixture = !hasLocalRepo && Boolean.parseBoolean(project.findProperty("tests.fixture.es.enable") ?: "true")

def integrationTestTask = project.tasks.getByName("integrationTest") as StandaloneRestIntegTestTask
def integrationTestTasks = project.tasks.withType(StandaloneRestIntegTestTask)
if (useFixture) {
// Depends on project already containing an "integrationTest"
// task, as well as javaHome+runtimeJavaHome configured
createClusterFor(integrationTestTask, project, version)
createClusterFor(integrationTestTasks, project, version)
} else {
integrationTestTask.systemProperty("test.disable.local.es", "true")
integrationTestTasks.systemProperty("test.disable.local.es", "true")
}
}

private static void createClusterFor(StandaloneRestIntegTestTask integrationTest, Project project, String version) {
private static void createClusterFor(TaskCollection<StandaloneRestIntegTestTask> integrationTests, Project project, String version) {
def clustersContainer = project.extensions.getByName(TestClustersPlugin.EXTENSION_NAME) as NamedDomainObjectContainer<ElasticsearchCluster>
def integTestCluster = clustersContainer.create("integTest") { ElasticsearchCluster cluster ->
cluster.version = version
cluster.testDistribution = TestDistribution.DEFAULT
}

integrationTest.useCluster(integTestCluster)
// Add the cluster HTTP URI as a system property which isn't tracked as a task input
integrationTest.jvmArgumentProviders.add({ ["-Dtests.rest.cluster=${integTestCluster.httpSocketURI}"] } as CommandLineArgumentProvider)
integrationTests.all { StandaloneRestIntegTestTask integrationTest ->
integrationTest.useCluster(integTestCluster)
// Add the cluster HTTP URI as a system property which isn't tracked as a task input
integrationTest.jvmArgumentProviders.add({ ["-Dtests.rest.cluster=${integTestCluster.httpSocketURI}"] } as CommandLineArgumentProvider)
}

// Version settings
def majorVersion = version.tokenize(".").get(0).toInteger()
Expand Down

This file was deleted.

Loading