- Replace immediate task creations by using task avoidance api - One step closer to #56610 - Still many tasks are created during configuration phase. Tackled in separate steps
This commit is contained in:
parent
a721d6d19b
commit
ed4b70190b
|
@ -24,6 +24,7 @@ import org.elasticsearch.gradle.VersionProperties
|
|||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.Task
|
||||
import org.gradle.api.tasks.TaskProvider
|
||||
|
||||
/**
|
||||
* Sets up tests for documentation.
|
||||
|
@ -42,7 +43,7 @@ class DocsTestPlugin implements Plugin<Project> {
|
|||
project.testClusters.integTest.nameCustomization = { it.replace("integTest", "node") }
|
||||
// Docs are published separately so no need to assemble
|
||||
project.tasks.assemble.enabled = false
|
||||
Map<String, String> defaultSubstitutions = [
|
||||
Map<String, String> commonDefaultSubstitutions = [
|
||||
/* These match up with the asciidoc syntax for substitutions but
|
||||
* the values may differ. In particular {version} needs to resolve
|
||||
* to the version being built for testing but needs to resolve to
|
||||
|
@ -53,26 +54,26 @@ class DocsTestPlugin implements Plugin<Project> {
|
|||
'\\{build_flavor\\}' : distribution,
|
||||
'\\{build_type\\}' : OS.conditionalString().onWindows({"zip"}).onUnix({"tar"}).supply(),
|
||||
]
|
||||
Task listSnippets = project.tasks.create('listSnippets', SnippetsTask)
|
||||
listSnippets.group 'Docs'
|
||||
listSnippets.description 'List each snippet'
|
||||
listSnippets.defaultSubstitutions = defaultSubstitutions
|
||||
listSnippets.perSnippet { println(it.toString()) }
|
||||
|
||||
Task listConsoleCandidates = project.tasks.create(
|
||||
'listConsoleCandidates', SnippetsTask)
|
||||
listConsoleCandidates.group 'Docs'
|
||||
listConsoleCandidates.description
|
||||
'List snippets that probably should be marked // CONSOLE'
|
||||
listConsoleCandidates.defaultSubstitutions = defaultSubstitutions
|
||||
listConsoleCandidates.perSnippet {
|
||||
if (RestTestsFromSnippetsTask.isConsoleCandidate(it)) {
|
||||
println(it.toString())
|
||||
project.tasks.register('listSnippets', SnippetsTask) {
|
||||
group 'Docs'
|
||||
description 'List each snippet'
|
||||
defaultSubstitutions = commonDefaultSubstitutions
|
||||
perSnippet { println(it.toString()) }
|
||||
}
|
||||
project.tasks.register('listConsoleCandidates', SnippetsTask) {
|
||||
group 'Docs'
|
||||
description
|
||||
'List snippets that probably should be marked // CONSOLE'
|
||||
defaultSubstitutions = commonDefaultSubstitutions
|
||||
perSnippet {
|
||||
if (RestTestsFromSnippetsTask.isConsoleCandidate(it)) {
|
||||
println(it.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Task buildRestTests = project.tasks.create(
|
||||
'buildRestTests', RestTestsFromSnippetsTask)
|
||||
buildRestTests.defaultSubstitutions = defaultSubstitutions
|
||||
project.tasks.register('buildRestTests', RestTestsFromSnippetsTask) {
|
||||
defaultSubstitutions = commonDefaultSubstitutions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,9 @@ class PluginBuildPlugin implements Plugin<Project> {
|
|||
|
||||
createIntegTestTask(project)
|
||||
createBundleTasks(project, extension)
|
||||
project.tasks.integTest.dependsOn(project.tasks.bundlePlugin)
|
||||
project.tasks.named("integTest").configure {
|
||||
it.dependsOn(project.tasks.named("bundlePlugin"))
|
||||
}
|
||||
if (isModule) {
|
||||
project.testClusters.integTest.module(project.tasks.bundlePlugin.archiveFile)
|
||||
} else {
|
||||
|
@ -80,7 +82,7 @@ class PluginBuildPlugin implements Plugin<Project> {
|
|||
if (project.findProject(":modules:${pluginName}") != null) {
|
||||
project.integTest.dependsOn(project.project(":modules:${pluginName}").tasks.bundlePlugin)
|
||||
project.testClusters.integTest.module(
|
||||
project.project(":modules:${pluginName}").tasks.bundlePlugin.archiveFile
|
||||
project.project(":modules:${pluginName}").tasks.bundlePlugin.archiveFile
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -101,15 +103,15 @@ class PluginBuildPlugin implements Plugin<Project> {
|
|||
}
|
||||
|
||||
Map<String, String> properties = [
|
||||
'name' : extension1.name,
|
||||
'description' : extension1.description,
|
||||
'version' : extension1.version,
|
||||
'elasticsearchVersion': Version.fromString(VersionProperties.elasticsearch).toString(),
|
||||
'javaVersion' : project.targetCompatibility as String,
|
||||
'classname' : extension1.classname,
|
||||
'extendedPlugins' : extension1.extendedPlugins.join(','),
|
||||
'hasNativeController' : extension1.hasNativeController,
|
||||
'requiresKeystore' : extension1.requiresKeystore
|
||||
'name' : extension1.name,
|
||||
'description' : extension1.description,
|
||||
'version' : extension1.version,
|
||||
'elasticsearchVersion': Version.fromString(VersionProperties.elasticsearch).toString(),
|
||||
'javaVersion' : project.targetCompatibility as String,
|
||||
'classname' : extension1.classname,
|
||||
'extendedPlugins' : extension1.extendedPlugins.join(','),
|
||||
'hasNativeController' : extension1.hasNativeController,
|
||||
'requiresKeystore' : extension1.requiresKeystore
|
||||
]
|
||||
project.tasks.named('pluginProperties').configure {
|
||||
expand(properties)
|
||||
|
@ -142,7 +144,7 @@ class PluginBuildPlugin implements Plugin<Project> {
|
|||
}
|
||||
}
|
||||
project.configurations.getByName('default')
|
||||
.extendsFrom(project.configurations.getByName('runtimeClasspath'))
|
||||
.extendsFrom(project.configurations.getByName('runtimeClasspath'))
|
||||
// allow running ES with this plugin in the foreground of a build
|
||||
project.tasks.register('run', RunTask) {
|
||||
dependsOn(project.tasks.bundlePlugin)
|
||||
|
@ -235,7 +237,7 @@ class PluginBuildPlugin implements Plugin<Project> {
|
|||
*/
|
||||
from { project.plugins.hasPlugin(ShadowPlugin) ? project.shadowJar : project.jar }
|
||||
from project.configurations.runtimeClasspath - project.configurations.getByName(
|
||||
CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME
|
||||
CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME
|
||||
)
|
||||
// extra files for the plugin to go into the zip
|
||||
from('src/main/packaging') // TODO: move all config/bin/_size/etc into packaging
|
||||
|
|
|
@ -62,7 +62,7 @@ class StandaloneRestTestPlugin implements Plugin<Project> {
|
|||
project.pluginManager.apply(TestClustersPlugin)
|
||||
project.pluginManager.apply(RepositoriesSetupPlugin)
|
||||
|
||||
project.getTasks().create("buildResources", ExportElasticsearchBuildResourcesTask)
|
||||
project.getTasks().register("buildResources", ExportElasticsearchBuildResourcesTask)
|
||||
ElasticsearchJavaPlugin.configureTestTasks(project)
|
||||
ElasticsearchJavaPlugin.configureInputNormalization(project)
|
||||
ElasticsearchJavaPlugin.configureCompile(project)
|
||||
|
|
|
@ -114,12 +114,15 @@ public class TestClustersPlugin implements Plugin<Project> {
|
|||
}
|
||||
|
||||
private void createListClustersTask(Project project, NamedDomainObjectContainer<ElasticsearchCluster> container) {
|
||||
Task listTask = project.getTasks().create(LIST_TASK_NAME);
|
||||
listTask.setGroup("ES cluster formation");
|
||||
listTask.setDescription("Lists all ES clusters configured for this project");
|
||||
listTask.doLast(
|
||||
(Task task) -> container.forEach(cluster -> logger.lifecycle(" * {}: {}", cluster.getName(), cluster.getNumberOfNodes()))
|
||||
);
|
||||
// Task is never up to date so we can pass an lambda for the task action
|
||||
project.getTasks().register(LIST_TASK_NAME, task -> {
|
||||
task.setGroup("ES cluster formation");
|
||||
task.setDescription("Lists all ES clusters configured for this project");
|
||||
task.doLast(
|
||||
(Task t) -> container.forEach(cluster -> logger.lifecycle(" * {}: {}", cluster.getName(), cluster.getNumberOfNodes()))
|
||||
);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
static class TestClustersHookPlugin implements Plugin<Project> {
|
||||
|
|
|
@ -54,23 +54,23 @@ tasks.register("generateDependenciesReport", ConcatFilesTask) {
|
|||
*****************************************************************************/
|
||||
|
||||
// integ test zip only uses server, so a different notice file is needed there
|
||||
task buildServerNotice(type: NoticeTask)
|
||||
tasks.register("buildServerNotice", NoticeTask)
|
||||
|
||||
// other distributions include notices from modules as well, which are added below later
|
||||
task buildDefaultNotice(type: NoticeTask) {
|
||||
tasks.register("buildDefaultNotice", NoticeTask).configure {
|
||||
licensesDir new File(project(':distribution').projectDir, 'licenses')
|
||||
}
|
||||
|
||||
task buildOssNotice(type: NoticeTask) {
|
||||
tasks.register("buildOssNotice", NoticeTask).configure {
|
||||
licensesDir new File(project(':distribution').projectDir, 'licenses')
|
||||
}
|
||||
|
||||
task buildDefaultNoJdkNotice(type: NoticeTask)
|
||||
tasks.register("buildDefaultNoJdkNotice", NoticeTask)
|
||||
|
||||
task buildOssNoJdkNotice(type: NoticeTask)
|
||||
tasks.register("buildOssNoJdkNotice", NoticeTask)
|
||||
|
||||
// The :server and :libs projects belong to all distributions
|
||||
tasks.withType(NoticeTask) {
|
||||
tasks.withType(NoticeTask).configureEach {
|
||||
licensesDir project(':server').file('licenses')
|
||||
source project(':server').file('src/main/java')
|
||||
project(':libs').subprojects.each { Project lib ->
|
||||
|
|
|
@ -42,8 +42,9 @@ BuildParams.bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInf
|
|||
String bwcBranch = unreleasedVersion.branch
|
||||
apply plugin: 'distribution'
|
||||
// Not published so no need to assemble
|
||||
assemble.enabled = false
|
||||
|
||||
tasks.named("assemble").configure {
|
||||
enabled = false
|
||||
}
|
||||
File checkoutDir = file("${buildDir}/bwc/checkout-${bwcBranch}")
|
||||
|
||||
final String remote = System.getProperty("bwc.remote", "elastic")
|
||||
|
@ -58,13 +59,13 @@ BuildParams.bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInf
|
|||
throw new GradleException("tests.bwc.git_fetch_latest must be [true] or [false] but was [" + gitFetchLatestProperty + "]")
|
||||
}
|
||||
|
||||
task createClone(type: LoggedExec) {
|
||||
tasks.register("createClone", LoggedExec) {
|
||||
onlyIf { checkoutDir.exists() == false }
|
||||
commandLine = ['git', 'clone', rootDir, checkoutDir]
|
||||
}
|
||||
|
||||
task findRemote(type: LoggedExec) {
|
||||
dependsOn createClone
|
||||
tasks.register("findRemote", LoggedExec) {
|
||||
dependsOn "createClone"
|
||||
workingDir = checkoutDir
|
||||
commandLine = ['git', 'remote', '-v']
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream()
|
||||
|
@ -79,16 +80,16 @@ BuildParams.bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInf
|
|||
}
|
||||
}
|
||||
|
||||
task addRemote(type: LoggedExec) {
|
||||
tasks.register("addRemote", LoggedExec) {
|
||||
dependsOn findRemote
|
||||
onlyIf { project.ext.remoteExists == false }
|
||||
workingDir = checkoutDir
|
||||
commandLine = ['git', 'remote', 'add', "${remote}", "https://github.com/${remote}/elasticsearch.git"]
|
||||
}
|
||||
|
||||
task fetchLatest(type: LoggedExec) {
|
||||
tasks.register("fetchLatest", LoggedExec) {
|
||||
onlyIf { project.gradle.startParameter.isOffline() == false && gitFetchLatest }
|
||||
dependsOn addRemote
|
||||
dependsOn("addRemote")
|
||||
workingDir = checkoutDir
|
||||
commandLine = ['git', 'fetch', '--all']
|
||||
}
|
||||
|
@ -104,8 +105,8 @@ BuildParams.bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInf
|
|||
return os.toString().trim()
|
||||
}
|
||||
}
|
||||
task checkoutBwcBranch() {
|
||||
dependsOn fetchLatest
|
||||
tasks.register("checkoutBwcBranch") {
|
||||
dependsOn("fetchLatest")
|
||||
doLast {
|
||||
def refspec = System.getProperty("bwc.refspec." + bwcBranch) ?: System.getProperty("tests.bwc.refspec." + bwcBranch) ?: "${remote}/${bwcBranch}"
|
||||
if (System.getProperty("bwc.checkout.align") != null) {
|
||||
|
@ -156,9 +157,9 @@ BuildParams.bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInf
|
|||
}
|
||||
|
||||
|
||||
Closure createRunBwcGradleTask = { name, extraConfig ->
|
||||
Closure<TaskProvider> createRunBwcGradleTask = { name, extraConfig ->
|
||||
return tasks.register("$name", LoggedExec) {
|
||||
dependsOn checkoutBwcBranch
|
||||
dependsOn "checkoutBwcBranch"
|
||||
spoolOutput = true
|
||||
workingDir = checkoutDir
|
||||
doFirst {
|
||||
|
@ -304,7 +305,9 @@ BuildParams.bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInf
|
|||
Version currentVersion = Version.fromString(version)
|
||||
if (currentVersion.getMinor() == 0 && currentVersion.getRevision() == 0) {
|
||||
// We only want to resolve dependencies for live versions of master, without cascading this to older versions
|
||||
resolveAllDependencies.dependsOn resolveAllBwcDependencies
|
||||
tasks.named("resolveAllDependencies").configure {
|
||||
dependsOn("resolveAllBwcDependencies")
|
||||
}
|
||||
}
|
||||
|
||||
for (e in artifactFiles) {
|
||||
|
@ -326,7 +329,9 @@ BuildParams.bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInf
|
|||
}
|
||||
}
|
||||
// make sure no dependencies were added to assemble; we want it to be a no-op
|
||||
assemble.dependsOn = []
|
||||
tasks.named("assemble").configure {
|
||||
dependsOn = []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ project.ext {
|
|||
}
|
||||
|
||||
void addCopyDockerContextTask(final String architecture, final boolean oss) {
|
||||
task(taskName("copy", architecture, oss, "DockerContext"), type: Sync) {
|
||||
tasks.register(taskName("copy", architecture, oss, "DockerContext"), Sync) {
|
||||
expansions(architecture, oss, true).findAll { it.key != 'build_date' }.each { k, v ->
|
||||
inputs.property(k, { v.toString() })
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ def createAndSetWritable(Object... locations) {
|
|||
}
|
||||
}
|
||||
|
||||
task copyKeystore(type: Sync) {
|
||||
tasks.register("copyKeystore", Sync) {
|
||||
from project(':x-pack:plugin:core')
|
||||
.file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks')
|
||||
into "${buildDir}/certs"
|
||||
|
@ -167,9 +167,9 @@ elasticsearch_distributions {
|
|||
}
|
||||
}
|
||||
|
||||
preProcessFixture {
|
||||
tasks.named("preProcessFixture").configure {
|
||||
dependsOn elasticsearch_distributions.docker_default, elasticsearch_distributions.docker_oss
|
||||
dependsOn copyKeystore
|
||||
dependsOn "copyKeystore"
|
||||
doLast {
|
||||
// tests expect to have an empty repo
|
||||
project.delete(
|
||||
|
@ -187,21 +187,25 @@ preProcessFixture {
|
|||
}
|
||||
}
|
||||
|
||||
processTestResources {
|
||||
tasks.named("processTestResources").configure {
|
||||
from project(':x-pack:plugin:core')
|
||||
.file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks')
|
||||
}
|
||||
|
||||
task integTest(type: Test) {
|
||||
tasks.register("integTest", Test) {
|
||||
outputs.doNotCacheIf('Build cache is disabled for Docker tests') { true }
|
||||
maxParallelForks = '1'
|
||||
include '**/*IT.class'
|
||||
}
|
||||
|
||||
check.dependsOn integTest
|
||||
tasks.named("check").configure {
|
||||
dependsOn "integTest"
|
||||
}
|
||||
|
||||
void addBuildDockerImage(final String architecture, final boolean oss) {
|
||||
final Task buildDockerImageTask = task(taskName("build", architecture, oss, "DockerImage"), type: DockerBuildTask) {
|
||||
final TaskProvider<DockerBuildTask> buildDockerImageTask =
|
||||
tasks.register(taskName("build", architecture, oss, "DockerImage"), DockerBuildTask) {
|
||||
onlyIf { Architecture.current().name().toLowerCase().equals(architecture) }
|
||||
TaskProvider<Sync> copyContextTask = tasks.named(taskName("copy", architecture, oss, "DockerContext"))
|
||||
dependsOn(copyContextTask)
|
||||
dockerContext.fileProvider(copyContextTask.map { it.destinationDir })
|
||||
|
@ -220,8 +224,9 @@ void addBuildDockerImage(final String architecture, final boolean oss) {
|
|||
]
|
||||
}
|
||||
}
|
||||
buildDockerImageTask.onlyIf { Architecture.current().name().toLowerCase().equals(architecture) }
|
||||
assemble.dependsOn(buildDockerImageTask)
|
||||
tasks.named("assemble").configure {
|
||||
dependsOn(buildDockerImageTask)
|
||||
}
|
||||
}
|
||||
|
||||
for (final String architecture : ["aarch64", "x64"]) {
|
||||
|
@ -253,7 +258,7 @@ subprojects { Project subProject ->
|
|||
def buildTaskName = taskName("build", architecture, oss, "DockerImage")
|
||||
def tarFile = "${parent.projectDir}/build/elasticsearch${"aarch64".equals(architecture) ? '-aarch64' : ''}${oss ? '-oss' : ''}_test.${VersionProperties.elasticsearch}.docker.tar"
|
||||
|
||||
final Task exportDockerImageTask = task(exportTaskName, type: LoggedExec) {
|
||||
final TaskProvider<LoggedExec> exportDockerImageTask = tasks.register(exportTaskName, LoggedExec) {
|
||||
inputs.file("${parent.projectDir}/build/markers/${buildTaskName}.marker")
|
||||
executable 'docker'
|
||||
outputs.file(tarFile)
|
||||
|
@ -261,18 +266,19 @@ subprojects { Project subProject ->
|
|||
"-o",
|
||||
tarFile,
|
||||
"elasticsearch${oss ? '-oss' : ''}:test"
|
||||
|
||||
dependsOn(parent.path + ":" + buildTaskName)
|
||||
onlyIf { Architecture.current().name().toLowerCase().equals(architecture) }
|
||||
}
|
||||
|
||||
exportDockerImageTask.dependsOn(parent.tasks.getByName(buildTaskName))
|
||||
|
||||
exportDockerImageTask.onlyIf { Architecture.current().name().toLowerCase().equals(architecture) }
|
||||
|
||||
artifacts.add('default', file(tarFile)) {
|
||||
type 'tar'
|
||||
name "elasticsearch${"aarch64".equals(architecture) ? '-aarch64' : ''}${oss ? '-oss' : ''}"
|
||||
builtBy exportTaskName
|
||||
}
|
||||
|
||||
assemble.dependsOn exportTaskName
|
||||
tasks.named("assemble").configure {
|
||||
dependsOn(exportTaskName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
apply plugin: 'base'
|
||||
|
||||
task buildDockerBuildContext(type: Tar) {
|
||||
tasks.register("buildDockerBuildContext", Tar) {
|
||||
archiveExtension = 'tar.gz'
|
||||
compression = Compression.GZIP
|
||||
archiveClassifier = "docker-build-context"
|
||||
|
@ -10,4 +10,4 @@ task buildDockerBuildContext(type: Tar) {
|
|||
with dockerBuildContext("<remote>", false, false)
|
||||
}
|
||||
|
||||
assemble.dependsOn buildDockerBuildContext
|
||||
tasks.named("assemble").configure {dependsOn "buildDockerBuildContext"}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
apply plugin: 'base'
|
||||
|
||||
task buildOssDockerBuildContext(type: Tar) {
|
||||
tasks.register("buildOssDockerBuildContext", Tar) {
|
||||
archiveExtension = 'tar.gz'
|
||||
compression = Compression.GZIP
|
||||
archiveClassifier = "docker-build-context"
|
||||
|
@ -10,4 +10,4 @@ task buildOssDockerBuildContext(type: Tar) {
|
|||
with dockerBuildContext("<remote>", true, false)
|
||||
}
|
||||
|
||||
assemble.dependsOn buildOssDockerBuildContext
|
||||
tasks.named("assemble").configure { dependsOn "buildOssDockerBuildContext" }
|
||||
|
|
|
@ -59,7 +59,7 @@ void addProcessFilesTask(String type, boolean oss, boolean jdk) {
|
|||
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
|
||||
|
||||
String taskName = "process${oss ? 'Oss' : ''}${jdk ? '' : 'NoJdk'}${type.capitalize()}Files"
|
||||
task(taskName, type: Copy) {
|
||||
tasks.register(taskName, Copy) {
|
||||
into packagingFiles
|
||||
|
||||
with copySpec {
|
||||
|
@ -464,15 +464,15 @@ subprojects {
|
|||
}
|
||||
}
|
||||
|
||||
check.dependsOn checkExtraction
|
||||
tasks.named("check").configure { dependsOn "checkExtraction" }
|
||||
if (project.name.contains('deb')) {
|
||||
checkExtraction {
|
||||
tasks.named("checkExtraction").configure {
|
||||
onlyIf dpkgExists
|
||||
commandLine 'dpkg-deb', '-x', "${-> buildDist.get()outputs.files.filter(debFilter).singleFile}", packageExtractionDir
|
||||
commandLine 'dpkg-deb', '-x', "${-> buildDist.get().outputs.files.filter(debFilter).singleFile}", packageExtractionDir
|
||||
}
|
||||
} else {
|
||||
assert project.name.contains('rpm')
|
||||
checkExtraction {
|
||||
tasks.named("checkExtraction").configure {
|
||||
onlyIf rpmExists
|
||||
final File rpmDatabase = new File(extractionDir, 'rpm-database')
|
||||
commandLine 'rpm',
|
||||
|
@ -491,12 +491,12 @@ subprojects {
|
|||
}
|
||||
}
|
||||
|
||||
task checkLicense {
|
||||
dependsOn buildDist, checkExtraction
|
||||
tasks.register("checkLicense") {
|
||||
dependsOn buildDist, "checkExtraction"
|
||||
}
|
||||
check.dependsOn checkLicense
|
||||
check.dependsOn "checkLicense"
|
||||
if (project.name.contains('deb')) {
|
||||
checkLicense {
|
||||
tasks.named("checkLicense").configure {
|
||||
onlyIf dpkgExists
|
||||
doLast {
|
||||
Path copyrightPath
|
||||
|
@ -521,7 +521,7 @@ subprojects {
|
|||
}
|
||||
} else {
|
||||
assert project.name.contains('rpm')
|
||||
checkLicense {
|
||||
tasks.named("checkLicense").configure {
|
||||
onlyIf rpmExists
|
||||
doLast {
|
||||
String licenseFilename
|
||||
|
@ -537,8 +537,8 @@ subprojects {
|
|||
}
|
||||
}
|
||||
|
||||
task checkNotice {
|
||||
dependsOn buildDist, checkExtraction
|
||||
tasks.register("checkNotice") {
|
||||
dependsOn buildDist, "checkExtraction"
|
||||
onlyIf {
|
||||
(project.name.contains('deb') && dpkgExists.call(it)) || (project.name.contains('rpm') && rpmExists.call(it))
|
||||
}
|
||||
|
@ -548,10 +548,10 @@ subprojects {
|
|||
assertLinesInFile(noticePath, noticeLines)
|
||||
}
|
||||
}
|
||||
check.dependsOn checkNotice
|
||||
tasks.named("check").configure { dependsOn "checkNotice" }
|
||||
|
||||
tasks.register('checkLicenseMetadata', LoggedExec) {
|
||||
dependsOn buildDist, checkExtraction
|
||||
dependsOn buildDist, "checkExtraction"
|
||||
}
|
||||
check.dependsOn checkLicenseMetadata
|
||||
if (project.name.contains('deb')) {
|
||||
|
|
|
@ -16,7 +16,7 @@ buildscript {
|
|||
allprojects {
|
||||
apply plugin: 'idea'
|
||||
|
||||
tasks.named('idea') {
|
||||
tasks.named('idea').configure {
|
||||
doFirst { throw new GradleException("Use of the 'idea' task has been deprecated. For details on importing into IntelliJ see CONTRIBUTING.md.") }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,40 +43,41 @@ restResources {
|
|||
}
|
||||
}
|
||||
|
||||
task copyDefaultGeoIp2DatabaseFiles(type: Copy) {
|
||||
tasks.register("copyDefaultGeoIp2DatabaseFiles", Copy) {
|
||||
from { zipTree(configurations.testCompileClasspath.files.find { it.name.contains('geolite2-databases') }) }
|
||||
into "${project.buildDir}/ingest-geoip"
|
||||
include "*.mmdb"
|
||||
}
|
||||
|
||||
project.bundlePlugin.dependsOn(copyDefaultGeoIp2DatabaseFiles)
|
||||
|
||||
bundlePlugin {
|
||||
tasks.named("bundlePlugin").configure {
|
||||
dependsOn("copyDefaultGeoIp2DatabaseFiles")
|
||||
from("${project.buildDir}/ingest-geoip") {
|
||||
into '/'
|
||||
}
|
||||
}
|
||||
|
||||
thirdPartyAudit.ignoreMissingClasses(
|
||||
// geoip WebServiceClient needs apache http client, but we're not using WebServiceClient:
|
||||
'org.apache.http.HttpEntity',
|
||||
'org.apache.http.HttpHost',
|
||||
'org.apache.http.HttpResponse',
|
||||
'org.apache.http.StatusLine',
|
||||
'org.apache.http.auth.UsernamePasswordCredentials',
|
||||
'org.apache.http.client.config.RequestConfig$Builder',
|
||||
'org.apache.http.client.config.RequestConfig',
|
||||
'org.apache.http.client.methods.CloseableHttpResponse',
|
||||
'org.apache.http.client.methods.HttpGet',
|
||||
'org.apache.http.client.utils.URIBuilder',
|
||||
'org.apache.http.impl.auth.BasicScheme',
|
||||
'org.apache.http.impl.client.CloseableHttpClient',
|
||||
'org.apache.http.impl.client.HttpClientBuilder',
|
||||
'org.apache.http.util.EntityUtils'
|
||||
)
|
||||
tasks.named("thirdPartyAudit").configure {
|
||||
ignoreMissingClasses(
|
||||
// geoip WebServiceClient needs apache http client, but we're not using WebServiceClient:
|
||||
'org.apache.http.HttpEntity',
|
||||
'org.apache.http.HttpHost',
|
||||
'org.apache.http.HttpResponse',
|
||||
'org.apache.http.StatusLine',
|
||||
'org.apache.http.auth.UsernamePasswordCredentials',
|
||||
'org.apache.http.client.config.RequestConfig$Builder',
|
||||
'org.apache.http.client.config.RequestConfig',
|
||||
'org.apache.http.client.methods.CloseableHttpResponse',
|
||||
'org.apache.http.client.methods.HttpGet',
|
||||
'org.apache.http.client.utils.URIBuilder',
|
||||
'org.apache.http.impl.auth.BasicScheme',
|
||||
'org.apache.http.impl.client.CloseableHttpClient',
|
||||
'org.apache.http.impl.client.HttpClientBuilder',
|
||||
'org.apache.http.util.EntityUtils'
|
||||
)
|
||||
}
|
||||
|
||||
test {
|
||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||
tasks.named("test").configure {
|
||||
// Windows cannot cleanup database files properly unless it loads everything on heap.
|
||||
// See https://github.com/maxmind/MaxMind-DB-Reader-java#file-lock-on-windows for more information
|
||||
systemProperty 'es.geoip.load_db_on_heap', 'true'
|
||||
|
|
|
@ -56,27 +56,28 @@ restResources {
|
|||
|
||||
integTest.enabled = false
|
||||
|
||||
test {
|
||||
tasks.named("test").configure {
|
||||
// in WhenThingsGoWrongTests we intentionally generate an out of memory error, this prevents the heap from being dumped to disk
|
||||
jvmArgs '-XX:-OmitStackTraceInFastThrow', '-XX:-HeapDumpOnOutOfMemoryError'
|
||||
}
|
||||
|
||||
/* Build Javadoc for the Java classes in Painless's public API that are in the
|
||||
* Painless plugin */
|
||||
task apiJavadoc(type: Javadoc) {
|
||||
tasks.register("apiJavadoc", Javadoc) {
|
||||
source = sourceSets.main.allJava
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
include '**/org/elasticsearch/painless/api/'
|
||||
destinationDir = new File(docsDir, 'apiJavadoc')
|
||||
}
|
||||
|
||||
task apiJavadocJar(type: Jar) {
|
||||
tasks.register("apiJavadocJar", Jar) {
|
||||
archiveClassifier = 'apiJavadoc'
|
||||
from apiJavadoc
|
||||
}
|
||||
|
||||
assemble.dependsOn apiJavadocJar
|
||||
|
||||
tasks.named("assemble").configure {
|
||||
dependsOn "apiJavadocJar"
|
||||
}
|
||||
/**********************************************
|
||||
* Context API Generation *
|
||||
**********************************************/
|
||||
|
@ -96,7 +97,7 @@ testClusters {
|
|||
}
|
||||
}
|
||||
|
||||
task generateContextDoc(type: DefaultTestClustersTask) {
|
||||
tasks.register("generateContextDoc", DefaultTestClustersTask) {
|
||||
dependsOn sourceSets.doc.runtimeClasspath
|
||||
useCluster testClusters.generateContextCluster
|
||||
doFirst {
|
||||
|
@ -123,7 +124,7 @@ dependencies {
|
|||
String grammarPath = 'src/main/antlr'
|
||||
String outputPath = 'src/main/java/org/elasticsearch/painless/antlr'
|
||||
|
||||
task cleanGenerated(type: Delete) {
|
||||
tasks.register("cleanGenerated", Delete) {
|
||||
delete fileTree(grammarPath) {
|
||||
include '*.tokens'
|
||||
}
|
||||
|
@ -132,8 +133,8 @@ task cleanGenerated(type: Delete) {
|
|||
}
|
||||
}
|
||||
|
||||
task regenLexer(type: JavaExec) {
|
||||
dependsOn cleanGenerated
|
||||
tasks.register("regenLexer", JavaExec) {
|
||||
dependsOn "cleanGenerated"
|
||||
main = 'org.antlr.v4.Tool'
|
||||
classpath = configurations.regenerate
|
||||
systemProperty 'file.encoding', 'UTF-8'
|
||||
|
@ -146,8 +147,8 @@ task regenLexer(type: JavaExec) {
|
|||
"${file(grammarPath)}/PainlessLexer.g4"
|
||||
}
|
||||
|
||||
task regenParser(type: JavaExec) {
|
||||
dependsOn regenLexer
|
||||
tasks.register("regenParser", JavaExec) {
|
||||
dependsOn "regenLexer"
|
||||
main = 'org.antlr.v4.Tool'
|
||||
classpath = configurations.regenerate
|
||||
systemProperty 'file.encoding', 'UTF-8'
|
||||
|
@ -163,8 +164,8 @@ task regenParser(type: JavaExec) {
|
|||
"${file(grammarPath)}/PainlessParser.g4"
|
||||
}
|
||||
|
||||
task regen {
|
||||
dependsOn regenParser
|
||||
tasks.register("regen") {
|
||||
dependsOn "regenParser"
|
||||
doLast {
|
||||
// moves token files to grammar directory for use with IDE's
|
||||
ant.move(file: "${outputPath}/PainlessLexer.tokens", toDir: grammarPath)
|
||||
|
|
|
@ -72,7 +72,7 @@ String host = InetAddress.getLoopbackAddress().getHostAddress()
|
|||
File keystore = new File(project.buildDir, 'keystore/test-node.jks')
|
||||
|
||||
// generate the keystore
|
||||
task createKey(type: LoggedExec) {
|
||||
TaskProvider createKey = tasks.register("createKey", LoggedExec) {
|
||||
doFirst {
|
||||
project.delete(keystore.parentFile)
|
||||
keystore.parentFile.mkdirs()
|
||||
|
@ -91,9 +91,9 @@ task createKey(type: LoggedExec) {
|
|||
'-storepass', 'keypass'
|
||||
}
|
||||
//no unit tests
|
||||
test.enabled = false
|
||||
tasks.named("test").configure { enabled = false }
|
||||
// add keystore to test classpath: it expects it there
|
||||
processInternalClusterTestResources {
|
||||
tasks.named("processInternalClusterTestResources").configure {
|
||||
from createKey
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,9 @@ tasks.named("dependencyLicenses").configure {
|
|||
mapping from: /jaxb-.*/, to: 'jaxb'
|
||||
}
|
||||
|
||||
thirdPartyAudit.ignoreMissingClasses(
|
||||
|
||||
tasks.named("thirdPartyAudit").configure {
|
||||
ignoreMissingClasses(
|
||||
'javax.servlet.ServletContextEvent',
|
||||
'javax.servlet.ServletContextListener',
|
||||
'org.apache.avalon.framework.logger.Logger',
|
||||
|
@ -147,7 +149,7 @@ thirdPartyAudit.ignoreMissingClasses(
|
|||
|
||||
// jarhell with jdk (intentionally, because jaxb was removed from default modules in java 9)
|
||||
if (BuildParams.runtimeJavaVersion <= JavaVersion.VERSION_1_8) {
|
||||
thirdPartyAudit.ignoreJarHellWithJDK(
|
||||
ignoreJarHellWithJDK(
|
||||
'javax.xml.bind.Binder',
|
||||
'javax.xml.bind.ContextFinder$1',
|
||||
'javax.xml.bind.ContextFinder',
|
||||
|
@ -251,14 +253,15 @@ if (BuildParams.runtimeJavaVersion <= JavaVersion.VERSION_1_8) {
|
|||
'javax.xml.bind.util.ValidationEventCollector'
|
||||
)
|
||||
} else {
|
||||
thirdPartyAudit.ignoreMissingClasses(
|
||||
'javax.activation.ActivationDataFlavor',
|
||||
'javax.activation.DataContentHandler',
|
||||
'javax.activation.DataHandler',
|
||||
'javax.activation.DataSource',
|
||||
'javax.activation.FileDataSource',
|
||||
'javax.activation.FileTypeMap',
|
||||
'javax.activation.MimeType',
|
||||
'javax.activation.MimeTypeParseException',
|
||||
)
|
||||
ignoreMissingClasses(
|
||||
'javax.activation.ActivationDataFlavor',
|
||||
'javax.activation.DataContentHandler',
|
||||
'javax.activation.DataHandler',
|
||||
'javax.activation.DataSource',
|
||||
'javax.activation.FileDataSource',
|
||||
'javax.activation.FileTypeMap',
|
||||
'javax.activation.MimeType',
|
||||
'javax.activation.MimeTypeParseException',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,13 +53,13 @@ tasks.named("dependencyLicenses").configure {
|
|||
mapping from: /jackson-.*/, to: 'jackson'
|
||||
}
|
||||
|
||||
bundlePlugin {
|
||||
tasks.named("bundlePlugin").configure {
|
||||
from('config/discovery-ec2') {
|
||||
into 'config'
|
||||
}
|
||||
}
|
||||
|
||||
task writeTestJavaPolicy {
|
||||
tasks.register("writeTestJavaPolicy") {
|
||||
doLast {
|
||||
final File tmp = file("${buildDir}/tmp")
|
||||
if (tmp.exists() == false && tmp.mkdirs() == false) {
|
||||
|
@ -97,8 +97,8 @@ task writeTestJavaPolicy {
|
|||
}
|
||||
}
|
||||
|
||||
test {
|
||||
dependsOn writeTestJavaPolicy
|
||||
tasks.named("test").configure {
|
||||
dependsOn "writeTestJavaPolicy"
|
||||
// this is needed for insecure plugins, remove if possible!
|
||||
systemProperty 'tests.artifact', project.name
|
||||
|
||||
|
@ -113,43 +113,45 @@ test {
|
|||
}
|
||||
}
|
||||
|
||||
check {
|
||||
tasks.named("check").configure {
|
||||
// also execute the QA tests when testing the plugin
|
||||
dependsOn 'qa:amazon-ec2:check'
|
||||
}
|
||||
|
||||
thirdPartyAudit.ignoreMissingClasses(
|
||||
// classes are missing
|
||||
'com.amazonaws.jmespath.JmesPathEvaluationVisitor',
|
||||
'com.amazonaws.jmespath.JmesPathExpression',
|
||||
'com.amazonaws.jmespath.JmesPathField',
|
||||
'com.amazonaws.jmespath.JmesPathFlatten',
|
||||
'com.amazonaws.jmespath.JmesPathIdentity',
|
||||
'com.amazonaws.jmespath.JmesPathLengthFunction',
|
||||
'com.amazonaws.jmespath.JmesPathLiteral',
|
||||
'com.amazonaws.jmespath.JmesPathProjection',
|
||||
'com.amazonaws.jmespath.JmesPathSubExpression',
|
||||
'com.amazonaws.jmespath.ObjectMapperSingleton',
|
||||
'com.amazonaws.jmespath.OpGreaterThan',
|
||||
'software.amazon.ion.IonReader',
|
||||
'software.amazon.ion.IonSystem',
|
||||
'software.amazon.ion.IonType',
|
||||
'software.amazon.ion.IonWriter',
|
||||
'software.amazon.ion.Timestamp',
|
||||
'software.amazon.ion.system.IonBinaryWriterBuilder',
|
||||
'software.amazon.ion.system.IonSystemBuilder',
|
||||
'software.amazon.ion.system.IonTextWriterBuilder',
|
||||
'software.amazon.ion.system.IonWriterBuilder',
|
||||
'javax.servlet.ServletContextEvent',
|
||||
'javax.servlet.ServletContextListener',
|
||||
'org.apache.avalon.framework.logger.Logger',
|
||||
'org.apache.log.Hierarchy',
|
||||
'org.apache.log.Logger'
|
||||
)
|
||||
|
||||
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) {
|
||||
thirdPartyAudit.ignoreMissingClasses(
|
||||
'javax.xml.bind.DatatypeConverter',
|
||||
'javax.xml.bind.JAXBContext'
|
||||
tasks.named("thirdPartyAudit").configure {
|
||||
ignoreMissingClasses(
|
||||
// classes are missing
|
||||
'com.amazonaws.jmespath.JmesPathEvaluationVisitor',
|
||||
'com.amazonaws.jmespath.JmesPathExpression',
|
||||
'com.amazonaws.jmespath.JmesPathField',
|
||||
'com.amazonaws.jmespath.JmesPathFlatten',
|
||||
'com.amazonaws.jmespath.JmesPathIdentity',
|
||||
'com.amazonaws.jmespath.JmesPathLengthFunction',
|
||||
'com.amazonaws.jmespath.JmesPathLiteral',
|
||||
'com.amazonaws.jmespath.JmesPathProjection',
|
||||
'com.amazonaws.jmespath.JmesPathSubExpression',
|
||||
'com.amazonaws.jmespath.ObjectMapperSingleton',
|
||||
'com.amazonaws.jmespath.OpGreaterThan',
|
||||
'software.amazon.ion.IonReader',
|
||||
'software.amazon.ion.IonSystem',
|
||||
'software.amazon.ion.IonType',
|
||||
'software.amazon.ion.IonWriter',
|
||||
'software.amazon.ion.Timestamp',
|
||||
'software.amazon.ion.system.IonBinaryWriterBuilder',
|
||||
'software.amazon.ion.system.IonSystemBuilder',
|
||||
'software.amazon.ion.system.IonTextWriterBuilder',
|
||||
'software.amazon.ion.system.IonWriterBuilder',
|
||||
'javax.servlet.ServletContextEvent',
|
||||
'javax.servlet.ServletContextListener',
|
||||
'org.apache.avalon.framework.logger.Logger',
|
||||
'org.apache.log.Hierarchy',
|
||||
'org.apache.log.Logger'
|
||||
)
|
||||
|
||||
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) {
|
||||
ignoreMissingClasses(
|
||||
'javax.xml.bind.DatatypeConverter',
|
||||
'javax.xml.bind.JAXBContext'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ Map<String, Object> expansions = [
|
|||
'expected_nodes': gceNumberOfNodes
|
||||
]
|
||||
|
||||
processYamlRestTestResources {
|
||||
tasks.named("processYamlRestTestResources").configure {
|
||||
inputs.properties(expansions)
|
||||
MavenFilteringHack.filter(it, expansions)
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@ if (useFixture) {
|
|||
}
|
||||
|
||||
// 3rd Party Tests
|
||||
task s3ThirdPartyTest(type: Test) {
|
||||
TaskProvider s3ThirdPartyTest = tasks.register("s3ThirdPartyTest", Test) {
|
||||
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
|
||||
SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME)
|
||||
setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs())
|
||||
|
@ -297,7 +297,7 @@ task s3ThirdPartyTest(type: Test) {
|
|||
nonInputProperties.systemProperty 'test.s3.endpoint', "${-> fixtureAddress('minio-fixture', 'minio-fixture', '9000') }"
|
||||
}
|
||||
}
|
||||
check.dependsOn(s3ThirdPartyTest)
|
||||
tasks.named("check").configure { dependsOn(s3ThirdPartyTest) }
|
||||
|
||||
thirdPartyAudit.ignoreMissingClasses(
|
||||
// classes are missing
|
||||
|
|
|
@ -78,7 +78,7 @@ configurations {
|
|||
testArtifacts.extendsFrom testImplementation
|
||||
}
|
||||
|
||||
task testJar(type: Jar) {
|
||||
TaskProvider testJar = tasks.register("testJar", Jar) {
|
||||
appendix 'test'
|
||||
from sourceSets.test.output
|
||||
}
|
||||
|
|
|
@ -53,11 +53,10 @@ testClusters.mixedClusterTest {
|
|||
setting 'cluster.remote.connections_per_cluster', '1'
|
||||
}
|
||||
|
||||
|
||||
task integTest {
|
||||
dependsOn mixedClusterTest
|
||||
tasks.register("integTest") {
|
||||
dependsOn "mixedClusterTest"
|
||||
}
|
||||
|
||||
test.enabled = false // no unit tests for multi-cluster-search, only integration tests
|
||||
tasks.named("test").configure { enabled = false }// no unit tests for multi-cluster-search, only integration tests
|
||||
|
||||
check.dependsOn(integTest)
|
||||
tasks.named("check").configure { dependsOn("integTest") }
|
||||
|
|
|
@ -31,7 +31,7 @@ dependencies {
|
|||
testImplementation project(':client:rest-high-level')
|
||||
}
|
||||
|
||||
task copyKeystore(type: Sync) {
|
||||
tasks.register("copyKeystore", Sync) {
|
||||
from project(':x-pack:plugin:core')
|
||||
.file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks')
|
||||
into "${buildDir}/certs"
|
||||
|
@ -52,7 +52,7 @@ elasticsearch_distributions {
|
|||
}
|
||||
|
||||
preProcessFixture {
|
||||
dependsOn copyKeystore, elasticsearch_distributions.docker
|
||||
dependsOn "copyKeystore", elasticsearch_distributions.docker
|
||||
doLast {
|
||||
// tests expect to have an empty repo
|
||||
project.delete(
|
||||
|
@ -87,15 +87,15 @@ def createAndSetWritable(Object... locations) {
|
|||
}
|
||||
}
|
||||
|
||||
processTestResources {
|
||||
tasks.named("processTestResources").configure {
|
||||
from project(':x-pack:plugin:core')
|
||||
.file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks')
|
||||
}
|
||||
|
||||
task integTest(type: Test) {
|
||||
tasks.register("integTest", Test) {
|
||||
outputs.doNotCacheIf('Build cache is disabled for Docker tests') { true }
|
||||
maxParallelForks = '1'
|
||||
include '**/*IT.class'
|
||||
}
|
||||
|
||||
check.dependsOn integTest
|
||||
tasks.named("check").configure { dependsOn "integTest" }
|
||||
|
|
|
@ -92,7 +92,7 @@ configurations {
|
|||
testArtifacts.extendsFrom testImplementation
|
||||
}
|
||||
|
||||
task testJar(type: Jar) {
|
||||
def testJar = tasks.register("testJar", Jar) {
|
||||
appendix 'test'
|
||||
from sourceSets.test.output
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ dockerCompose {
|
|||
}
|
||||
}
|
||||
|
||||
task integTest(type: Test) {
|
||||
tasks.register("integTest", Test) {
|
||||
outputs.doNotCacheIf('Build cache is disabled for Docker tests') { true }
|
||||
maxParallelForks = '1'
|
||||
include '**/*IT.class'
|
||||
|
|
|
@ -132,9 +132,9 @@ dependencies {
|
|||
}
|
||||
}
|
||||
|
||||
compileJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked"
|
||||
compileTestJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked"
|
||||
compileInternalClusterTestJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked"
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked"
|
||||
}
|
||||
|
||||
// Until this project is always being formatted with spotless, we need to
|
||||
// guard against `spotless()` not existing.
|
||||
|
@ -152,187 +152,186 @@ catch (Exception e) {
|
|||
}
|
||||
}
|
||||
|
||||
forbiddenPatterns {
|
||||
exclude '**/*.json'
|
||||
exclude '**/*.jmx'
|
||||
exclude '**/*.dic'
|
||||
exclude '**/*.binary'
|
||||
exclude '**/*.st'
|
||||
tasks.named("forbiddenPatterns").configure {
|
||||
exclude '**/*.json'
|
||||
exclude '**/*.jmx'
|
||||
exclude '**/*.dic'
|
||||
exclude '**/*.binary'
|
||||
exclude '**/*.st'
|
||||
}
|
||||
|
||||
testingConventions {
|
||||
naming.clear()
|
||||
naming {
|
||||
Tests {
|
||||
baseClass "org.apache.lucene.util.LuceneTestCase"
|
||||
tasks.named("testingConventions").configure {
|
||||
naming.clear()
|
||||
naming {
|
||||
Tests {
|
||||
baseClass "org.apache.lucene.util.LuceneTestCase"
|
||||
}
|
||||
IT {
|
||||
baseClass "org.elasticsearch.test.ESIntegTestCase"
|
||||
baseClass "org.elasticsearch.test.ESSingleNodeTestCase"
|
||||
}
|
||||
}
|
||||
IT {
|
||||
baseClass "org.elasticsearch.test.ESIntegTestCase"
|
||||
baseClass "org.elasticsearch.test.ESSingleNodeTestCase"
|
||||
}
|
||||
|
||||
def generateModulesList = tasks.register("generateModulesList") {
|
||||
List<String> modules = project(':modules').subprojects.collect { it.name }
|
||||
modules.add('x-pack')
|
||||
File modulesFile = new File(buildDir, 'generated-resources/modules.txt')
|
||||
processResources.from(modulesFile)
|
||||
inputs.property('modules', modules)
|
||||
outputs.file(modulesFile)
|
||||
doLast {
|
||||
modulesFile.parentFile.mkdirs()
|
||||
modulesFile.setText(modules.join('\n'), 'UTF-8')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task generateModulesList {
|
||||
List<String> modules = project(':modules').subprojects.collect { it.name }
|
||||
modules.add('x-pack')
|
||||
File modulesFile = new File(buildDir, 'generated-resources/modules.txt')
|
||||
processResources.from(modulesFile)
|
||||
inputs.property('modules', modules)
|
||||
outputs.file(modulesFile)
|
||||
doLast {
|
||||
modulesFile.parentFile.mkdirs()
|
||||
modulesFile.setText(modules.join('\n'), 'UTF-8')
|
||||
}
|
||||
def generatePluginsList = tasks.register("generatePluginsList") {
|
||||
Set<String> plugins = new TreeSet<>(project(':plugins').childProjects.keySet())
|
||||
plugins.remove('example')
|
||||
|
||||
File pluginsFile = new File(buildDir, 'generated-resources/plugins.txt')
|
||||
processResources.from(pluginsFile)
|
||||
inputs.property('plugins', plugins)
|
||||
outputs.file(pluginsFile)
|
||||
doLast {
|
||||
pluginsFile.parentFile.mkdirs()
|
||||
pluginsFile.setText(plugins.join('\n'), 'UTF-8')
|
||||
}
|
||||
}
|
||||
|
||||
task generatePluginsList {
|
||||
Set<String> plugins = new TreeSet<>(project(':plugins').childProjects.keySet())
|
||||
plugins.remove('example')
|
||||
|
||||
File pluginsFile = new File(buildDir, 'generated-resources/plugins.txt')
|
||||
processResources.from(pluginsFile)
|
||||
inputs.property('plugins', plugins)
|
||||
outputs.file(pluginsFile)
|
||||
doLast {
|
||||
pluginsFile.parentFile.mkdirs()
|
||||
pluginsFile.setText(plugins.join('\n'), 'UTF-8')
|
||||
}
|
||||
tasks.named("processResources").configure {
|
||||
dependsOn generateModulesList, generatePluginsList
|
||||
}
|
||||
|
||||
processResources {
|
||||
dependsOn generateModulesList, generatePluginsList
|
||||
}
|
||||
tasks.named("thirdPartyAudit").configure {
|
||||
ignoreMissingClasses(
|
||||
// from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml)
|
||||
'com.fasterxml.jackson.databind.ObjectMapper',
|
||||
|
||||
thirdPartyAudit.ignoreMissingClasses(
|
||||
// from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml)
|
||||
'com.fasterxml.jackson.databind.ObjectMapper',
|
||||
// from log4j
|
||||
'com.conversantmedia.util.concurrent.DisruptorBlockingQueue',
|
||||
'com.conversantmedia.util.concurrent.SpinPolicy',
|
||||
'com.fasterxml.jackson.annotation.JsonInclude$Include',
|
||||
'com.fasterxml.jackson.databind.DeserializationContext',
|
||||
'com.fasterxml.jackson.databind.DeserializationFeature',
|
||||
'com.fasterxml.jackson.databind.JsonMappingException',
|
||||
'com.fasterxml.jackson.databind.JsonNode',
|
||||
'com.fasterxml.jackson.databind.Module$SetupContext',
|
||||
'com.fasterxml.jackson.databind.ObjectReader',
|
||||
'com.fasterxml.jackson.databind.ObjectWriter',
|
||||
'com.fasterxml.jackson.databind.SerializerProvider',
|
||||
'com.fasterxml.jackson.databind.deser.std.StdDeserializer',
|
||||
'com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer',
|
||||
'com.fasterxml.jackson.databind.module.SimpleModule',
|
||||
'com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter',
|
||||
'com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider',
|
||||
'com.fasterxml.jackson.databind.ser.std.StdScalarSerializer',
|
||||
'com.fasterxml.jackson.databind.ser.std.StdSerializer',
|
||||
'com.fasterxml.jackson.dataformat.xml.JacksonXmlModule',
|
||||
'com.fasterxml.jackson.dataformat.xml.XmlMapper',
|
||||
'com.fasterxml.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter',
|
||||
'com.fasterxml.jackson.databind.node.ObjectNode',
|
||||
'org.fusesource.jansi.Ansi',
|
||||
'org.fusesource.jansi.AnsiRenderer$Code',
|
||||
'com.lmax.disruptor.BlockingWaitStrategy',
|
||||
'com.lmax.disruptor.BusySpinWaitStrategy',
|
||||
'com.lmax.disruptor.EventFactory',
|
||||
'com.lmax.disruptor.EventTranslator',
|
||||
'com.lmax.disruptor.EventTranslatorTwoArg',
|
||||
'com.lmax.disruptor.EventTranslatorVararg',
|
||||
'com.lmax.disruptor.ExceptionHandler',
|
||||
'com.lmax.disruptor.LifecycleAware',
|
||||
'com.lmax.disruptor.RingBuffer',
|
||||
'com.lmax.disruptor.Sequence',
|
||||
'com.lmax.disruptor.SequenceReportingEventHandler',
|
||||
'com.lmax.disruptor.SleepingWaitStrategy',
|
||||
'com.lmax.disruptor.TimeoutBlockingWaitStrategy',
|
||||
'com.lmax.disruptor.WaitStrategy',
|
||||
'com.lmax.disruptor.YieldingWaitStrategy',
|
||||
'com.lmax.disruptor.dsl.Disruptor',
|
||||
'com.lmax.disruptor.dsl.ProducerType',
|
||||
'javax.jms.Connection',
|
||||
'javax.jms.ConnectionFactory',
|
||||
'javax.jms.Destination',
|
||||
'javax.jms.JMSException',
|
||||
'javax.jms.MapMessage',
|
||||
'javax.jms.Message',
|
||||
'javax.jms.MessageConsumer',
|
||||
'javax.jms.MessageProducer',
|
||||
'javax.jms.Session',
|
||||
'javax.mail.Authenticator',
|
||||
'javax.mail.Message$RecipientType',
|
||||
'javax.mail.PasswordAuthentication',
|
||||
'javax.mail.Session',
|
||||
'javax.mail.Transport',
|
||||
'javax.mail.internet.InternetAddress',
|
||||
'javax.mail.internet.InternetHeaders',
|
||||
'javax.mail.internet.MimeBodyPart',
|
||||
'javax.mail.internet.MimeMessage',
|
||||
'javax.mail.internet.MimeMultipart',
|
||||
'javax.mail.internet.MimeUtility',
|
||||
'javax.mail.util.ByteArrayDataSource',
|
||||
'org.apache.commons.compress.compressors.CompressorStreamFactory',
|
||||
'org.apache.commons.compress.utils.IOUtils',
|
||||
'org.apache.commons.csv.CSVFormat',
|
||||
'org.apache.commons.csv.QuoteMode',
|
||||
'org.apache.kafka.clients.producer.Callback',
|
||||
'org.apache.kafka.clients.producer.KafkaProducer',
|
||||
'org.apache.kafka.clients.producer.Producer',
|
||||
'org.apache.kafka.clients.producer.ProducerRecord',
|
||||
'org.apache.kafka.clients.producer.RecordMetadata',
|
||||
'org.codehaus.stax2.XMLStreamWriter2',
|
||||
'org.jctools.queues.MessagePassingQueue$Consumer',
|
||||
'org.jctools.queues.MpscArrayQueue',
|
||||
'org.osgi.framework.AdaptPermission',
|
||||
'org.osgi.framework.AdminPermission',
|
||||
'org.osgi.framework.Bundle',
|
||||
'org.osgi.framework.BundleActivator',
|
||||
'org.osgi.framework.BundleContext',
|
||||
'org.osgi.framework.BundleEvent',
|
||||
'org.osgi.framework.BundleReference',
|
||||
'org.osgi.framework.FrameworkUtil',
|
||||
'org.osgi.framework.ServiceRegistration',
|
||||
'org.osgi.framework.SynchronousBundleListener',
|
||||
'org.osgi.framework.wiring.BundleWire',
|
||||
'org.osgi.framework.wiring.BundleWiring',
|
||||
'org.zeromq.ZMQ$Context',
|
||||
'org.zeromq.ZMQ$Socket',
|
||||
'org.zeromq.ZMQ',
|
||||
|
||||
// from log4j
|
||||
'com.conversantmedia.util.concurrent.DisruptorBlockingQueue',
|
||||
'com.conversantmedia.util.concurrent.SpinPolicy',
|
||||
'com.fasterxml.jackson.annotation.JsonInclude$Include',
|
||||
'com.fasterxml.jackson.databind.DeserializationContext',
|
||||
'com.fasterxml.jackson.databind.DeserializationFeature',
|
||||
'com.fasterxml.jackson.databind.JsonMappingException',
|
||||
'com.fasterxml.jackson.databind.JsonNode',
|
||||
'com.fasterxml.jackson.databind.Module$SetupContext',
|
||||
'com.fasterxml.jackson.databind.ObjectReader',
|
||||
'com.fasterxml.jackson.databind.ObjectWriter',
|
||||
'com.fasterxml.jackson.databind.SerializerProvider',
|
||||
'com.fasterxml.jackson.databind.deser.std.StdDeserializer',
|
||||
'com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer',
|
||||
'com.fasterxml.jackson.databind.module.SimpleModule',
|
||||
'com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter',
|
||||
'com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider',
|
||||
'com.fasterxml.jackson.databind.ser.std.StdScalarSerializer',
|
||||
'com.fasterxml.jackson.databind.ser.std.StdSerializer',
|
||||
'com.fasterxml.jackson.dataformat.xml.JacksonXmlModule',
|
||||
'com.fasterxml.jackson.dataformat.xml.XmlMapper',
|
||||
'com.fasterxml.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter',
|
||||
'com.fasterxml.jackson.databind.node.ObjectNode',
|
||||
'org.fusesource.jansi.Ansi',
|
||||
'org.fusesource.jansi.AnsiRenderer$Code',
|
||||
'com.lmax.disruptor.BlockingWaitStrategy',
|
||||
'com.lmax.disruptor.BusySpinWaitStrategy',
|
||||
'com.lmax.disruptor.EventFactory',
|
||||
'com.lmax.disruptor.EventTranslator',
|
||||
'com.lmax.disruptor.EventTranslatorTwoArg',
|
||||
'com.lmax.disruptor.EventTranslatorVararg',
|
||||
'com.lmax.disruptor.ExceptionHandler',
|
||||
'com.lmax.disruptor.LifecycleAware',
|
||||
'com.lmax.disruptor.RingBuffer',
|
||||
'com.lmax.disruptor.Sequence',
|
||||
'com.lmax.disruptor.SequenceReportingEventHandler',
|
||||
'com.lmax.disruptor.SleepingWaitStrategy',
|
||||
'com.lmax.disruptor.TimeoutBlockingWaitStrategy',
|
||||
'com.lmax.disruptor.WaitStrategy',
|
||||
'com.lmax.disruptor.YieldingWaitStrategy',
|
||||
'com.lmax.disruptor.dsl.Disruptor',
|
||||
'com.lmax.disruptor.dsl.ProducerType',
|
||||
'javax.jms.Connection',
|
||||
'javax.jms.ConnectionFactory',
|
||||
'javax.jms.Destination',
|
||||
'javax.jms.JMSException',
|
||||
'javax.jms.MapMessage',
|
||||
'javax.jms.Message',
|
||||
'javax.jms.MessageConsumer',
|
||||
'javax.jms.MessageProducer',
|
||||
'javax.jms.Session',
|
||||
'javax.mail.Authenticator',
|
||||
'javax.mail.Message$RecipientType',
|
||||
'javax.mail.PasswordAuthentication',
|
||||
'javax.mail.Session',
|
||||
'javax.mail.Transport',
|
||||
'javax.mail.internet.InternetAddress',
|
||||
'javax.mail.internet.InternetHeaders',
|
||||
'javax.mail.internet.MimeBodyPart',
|
||||
'javax.mail.internet.MimeMessage',
|
||||
'javax.mail.internet.MimeMultipart',
|
||||
'javax.mail.internet.MimeUtility',
|
||||
'javax.mail.util.ByteArrayDataSource',
|
||||
'org.apache.commons.compress.compressors.CompressorStreamFactory',
|
||||
'org.apache.commons.compress.utils.IOUtils',
|
||||
'org.apache.commons.csv.CSVFormat',
|
||||
'org.apache.commons.csv.QuoteMode',
|
||||
'org.apache.kafka.clients.producer.Callback',
|
||||
'org.apache.kafka.clients.producer.KafkaProducer',
|
||||
'org.apache.kafka.clients.producer.Producer',
|
||||
'org.apache.kafka.clients.producer.ProducerRecord',
|
||||
'org.apache.kafka.clients.producer.RecordMetadata',
|
||||
'org.codehaus.stax2.XMLStreamWriter2',
|
||||
'org.jctools.queues.MessagePassingQueue$Consumer',
|
||||
'org.jctools.queues.MpscArrayQueue',
|
||||
'org.osgi.framework.AdaptPermission',
|
||||
'org.osgi.framework.AdminPermission',
|
||||
'org.osgi.framework.Bundle',
|
||||
'org.osgi.framework.BundleActivator',
|
||||
'org.osgi.framework.BundleContext',
|
||||
'org.osgi.framework.BundleEvent',
|
||||
'org.osgi.framework.BundleReference',
|
||||
'org.osgi.framework.FrameworkUtil',
|
||||
'org.osgi.framework.ServiceRegistration',
|
||||
'org.osgi.framework.SynchronousBundleListener',
|
||||
'org.osgi.framework.wiring.BundleWire',
|
||||
'org.osgi.framework.wiring.BundleWiring',
|
||||
'org.zeromq.ZMQ$Context',
|
||||
'org.zeromq.ZMQ$Socket',
|
||||
'org.zeromq.ZMQ',
|
||||
// from org.locationtech.spatial4j.io.GeoJSONReader (spatial4j)
|
||||
'org.noggit.JSONParser',
|
||||
|
||||
// from org.locationtech.spatial4j.io.GeoJSONReader (spatial4j)
|
||||
'org.noggit.JSONParser',
|
||||
// from lucene-spatial
|
||||
'com.fasterxml.jackson.databind.JsonSerializer',
|
||||
'com.fasterxml.jackson.databind.JsonDeserializer',
|
||||
'com.fasterxml.jackson.databind.node.ArrayNode',
|
||||
'com.google.common.geometry.S2Cell',
|
||||
'com.google.common.geometry.S2CellId',
|
||||
'com.google.common.geometry.S2Projections',
|
||||
'com.google.common.geometry.S2Point',
|
||||
'com.google.common.geometry.S2$Metric',
|
||||
'com.google.common.geometry.S2LatLng'
|
||||
)
|
||||
|
||||
// from lucene-spatial
|
||||
'com.fasterxml.jackson.databind.JsonSerializer',
|
||||
'com.fasterxml.jackson.databind.JsonDeserializer',
|
||||
'com.fasterxml.jackson.databind.node.ArrayNode',
|
||||
'com.google.common.geometry.S2Cell',
|
||||
'com.google.common.geometry.S2CellId',
|
||||
'com.google.common.geometry.S2Projections',
|
||||
'com.google.common.geometry.S2Point',
|
||||
'com.google.common.geometry.S2$Metric',
|
||||
'com.google.common.geometry.S2LatLng'
|
||||
)
|
||||
|
||||
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) {
|
||||
thirdPartyAudit.ignoreMissingClasses 'javax.xml.bind.DatatypeConverter'
|
||||
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) {
|
||||
ignoreMissingClasses 'javax.xml.bind.DatatypeConverter'
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("dependencyLicenses").configure {
|
||||
mapping from: /lucene-.*/, to: 'lucene'
|
||||
dependencies = project.configurations.runtimeClasspath.fileCollection {
|
||||
it.group.startsWith('org.elasticsearch') == false ||
|
||||
// keep the following org.elasticsearch jars in
|
||||
(it.name == 'jna' ||
|
||||
it.name == 'securesm')
|
||||
}
|
||||
mapping from: /lucene-.*/, to: 'lucene'
|
||||
dependencies = project.configurations.runtimeClasspath.fileCollection {
|
||||
it.group.startsWith('org.elasticsearch') == false ||
|
||||
// keep the following org.elasticsearch jars in
|
||||
(it.name == 'jna' ||
|
||||
it.name == 'securesm')
|
||||
}
|
||||
}
|
||||
|
||||
licenseHeaders {
|
||||
// Ignore our vendored version of Google Guice
|
||||
excludes << 'org/elasticsearch/common/inject/**/*'
|
||||
}
|
||||
|
||||
licenseHeaders {
|
||||
excludes << 'org/elasticsearch/client/documentation/placeholder.txt'
|
||||
}
|
||||
tasks.named("licenseHeaders").configure {
|
||||
// Ignore our vendored version of Google Guice
|
||||
excludes << 'org/elasticsearch/common/inject/**/*'
|
||||
excludes << 'org/elasticsearch/client/documentation/placeholder.txt'
|
||||
}
|
|
@ -66,7 +66,7 @@ test {
|
|||
systemProperty 'tests.gradle_unreleased_versions', BuildParams.bwcVersions.unreleased.join(',')
|
||||
}
|
||||
|
||||
task integTest(type: Test) {
|
||||
tasks.register("integTest", Test) {
|
||||
include "**/*IT.class"
|
||||
}
|
||||
|
||||
|
|
|
@ -25,22 +25,27 @@ dependencies {
|
|||
testImplementation project(":test:framework")
|
||||
}
|
||||
|
||||
loggerUsageCheck.enabled = false
|
||||
tasks.named("loggerUsageCheck").configure {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
tasks.named('forbiddenApisMain').configure {
|
||||
replaceSignatureFiles 'jdk-signatures' // does not depend on core, only jdk signatures
|
||||
}
|
||||
|
||||
jarHell.enabled = true // disabled by parent project
|
||||
|
||||
thirdPartyAudit.ignoreMissingClasses(
|
||||
// log4j
|
||||
'org.osgi.framework.AdaptPermission',
|
||||
'org.osgi.framework.AdminPermission',
|
||||
'org.osgi.framework.Bundle',
|
||||
'org.osgi.framework.BundleActivator',
|
||||
'org.osgi.framework.BundleContext',
|
||||
'org.osgi.framework.BundleEvent',
|
||||
'org.osgi.framework.SynchronousBundleListener',
|
||||
'org.osgi.framework.wiring.BundleWire',
|
||||
'org.osgi.framework.wiring.BundleWiring'
|
||||
)
|
||||
tasks.named("thirdPartyAudit").configure {
|
||||
ignoreMissingClasses(
|
||||
// log4j
|
||||
'org.osgi.framework.AdaptPermission',
|
||||
'org.osgi.framework.AdminPermission',
|
||||
'org.osgi.framework.Bundle',
|
||||
'org.osgi.framework.BundleActivator',
|
||||
'org.osgi.framework.BundleContext',
|
||||
'org.osgi.framework.BundleEvent',
|
||||
'org.osgi.framework.SynchronousBundleListener',
|
||||
'org.osgi.framework.wiring.BundleWire',
|
||||
'org.osgi.framework.wiring.BundleWiring'
|
||||
)
|
||||
}
|
|
@ -31,7 +31,7 @@ subprojects {
|
|||
project.esplugin.noticeFile = xpackRootProject.file('NOTICE.txt')
|
||||
}
|
||||
|
||||
tasks.withType(LicenseHeadersTask.class) {
|
||||
tasks.withType(LicenseHeadersTask.class).configureEach {
|
||||
approvedLicenses = ['Elastic License', 'Generated', 'Vendored']
|
||||
additionalLicense 'ELAST', 'Elastic License', 'Licensed under the Elastic License'
|
||||
}
|
||||
|
|
|
@ -12,7 +12,8 @@ project.forbiddenPatterns {
|
|||
|
||||
tasks.named("dependencyLicenses").configure { it.enabled = false }
|
||||
|
||||
task buildZip(type: Zip, dependsOn: jar) {
|
||||
tasks.register("buildZip", Zip) {
|
||||
dependsOn "jar"
|
||||
String parentDir = "license-tools-${archiveVersion}"
|
||||
into(parentDir + '/lib') {
|
||||
from jar
|
||||
|
@ -23,4 +24,4 @@ task buildZip(type: Zip, dependsOn: jar) {
|
|||
}
|
||||
}
|
||||
|
||||
assemble.dependsOn buildZip
|
||||
tasks.named("assemble").configure { dependsOn("buildZip") }
|
||||
|
|
|
@ -75,7 +75,7 @@ artifacts {
|
|||
restXpackTests(new File(projectDir, "src/test/resources/rest-api-spec/test"))
|
||||
}
|
||||
|
||||
task testJar(type: Jar) {
|
||||
def testJar = tasks.register("testJar", Jar) {
|
||||
appendix 'test'
|
||||
from sourceSets.test.output
|
||||
/*
|
||||
|
@ -107,7 +107,7 @@ File nodeCert = file("$keystoreDir/testnode.crt")
|
|||
// it can run in a FIPS 140 JVM
|
||||
// TODO: Remove all existing uses of cross project file references when the new approach for referencing static files is available
|
||||
// https://github.com/elastic/elasticsearch/pull/32201
|
||||
task copyKeyCerts(type: Copy) {
|
||||
tasks.register("copyKeyCerts", Copy) {
|
||||
from(project(':x-pack:plugin:core').file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/')) {
|
||||
include 'testnode.crt', 'testnode.pem'
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ task copyKeyCerts(type: Copy) {
|
|||
}
|
||||
// Add keystores to test classpath: it expects it there
|
||||
sourceSets.test.resources.srcDir(keystoreDir)
|
||||
processTestResources.dependsOn(copyKeyCerts)
|
||||
processTestResources.dependsOn("copyKeyCerts")
|
||||
|
||||
integTest.runner {
|
||||
/*
|
||||
|
|
|
@ -22,7 +22,7 @@ testClusters."leader-cluster" {
|
|||
}
|
||||
|
||||
File policyFile = file("${buildDir}/tmp/java.policy")
|
||||
task writeJavaPolicy {
|
||||
tasks.register("writeJavaPolicy") {
|
||||
doLast {
|
||||
if (policyFile.parentFile.exists() == false && policyFile.parentFile.mkdirs() == false) {
|
||||
throw new GradleException("failed to create temporary directory [${tmp}]")
|
||||
|
@ -82,5 +82,6 @@ testClusters."follow-cluster" {
|
|||
}
|
||||
|
||||
|
||||
check.dependsOn "follow-cluster"
|
||||
test.enabled = false // no unit tests for multi-cluster-search, only the rest integration test
|
||||
tasks.named("check").configure { dependsOn "follow-cluster" }
|
||||
// no unit tests for multi-cluster-search, only the rest integration test
|
||||
tasks.named("test").configure { enabled = false }
|
|
@ -9,7 +9,7 @@ dependencies {
|
|||
testImplementation project(':x-pack:plugin:ccr:qa')
|
||||
}
|
||||
|
||||
task resolve {
|
||||
tasks.register("resolve") {
|
||||
doLast {
|
||||
configurations.testCompileClasspath.files.each {
|
||||
println it
|
||||
|
|
|
@ -125,7 +125,7 @@ configurations {
|
|||
testArtifacts.extendsFrom testRuntime
|
||||
testArtifacts.extendsFrom testImplementation
|
||||
}
|
||||
task testJar(type: Jar) {
|
||||
def testJar = tasks.register("testJar", Jar) {
|
||||
appendix 'test'
|
||||
from sourceSets.test.output
|
||||
}
|
||||
|
@ -136,15 +136,17 @@ artifacts {
|
|||
testArtifacts testJar
|
||||
}
|
||||
|
||||
thirdPartyAudit.ignoreMissingClasses(
|
||||
//commons-logging optional dependencies
|
||||
'org.apache.avalon.framework.logger.Logger',
|
||||
'org.apache.log.Hierarchy',
|
||||
'org.apache.log.Logger',
|
||||
//commons-logging provided dependencies
|
||||
'javax.servlet.ServletContextEvent',
|
||||
'javax.servlet.ServletContextListener'
|
||||
)
|
||||
tasks.named("thirdPartyAudit").configure {
|
||||
ignoreMissingClasses(
|
||||
//commons-logging optional dependencies
|
||||
'org.apache.avalon.framework.logger.Logger',
|
||||
'org.apache.log.Hierarchy',
|
||||
'org.apache.log.Logger',
|
||||
//commons-logging provided dependencies
|
||||
'javax.servlet.ServletContextEvent',
|
||||
'javax.servlet.ServletContextListener'
|
||||
)
|
||||
}
|
||||
|
||||
restResources {
|
||||
restApi {
|
||||
|
@ -160,4 +162,4 @@ testClusters.yamlRestTest {
|
|||
user username: "x_pack_rest_user", password: "x-pack-test-password"
|
||||
}
|
||||
|
||||
testingConventions.enabled = false
|
||||
tasks.named("testingConventions").configure { enabled = false }
|
||||
|
|
|
@ -73,7 +73,7 @@ dependencies {
|
|||
String grammarPath = 'src/main/antlr'
|
||||
String outputPath = 'src/main/java/org/elasticsearch/xpack/eql/parser'
|
||||
|
||||
task cleanGenerated(type: Delete) {
|
||||
tasks.register("cleanGenerated", Delete) {
|
||||
delete fileTree(grammarPath) {
|
||||
include '*.tokens'
|
||||
}
|
||||
|
@ -82,8 +82,8 @@ task cleanGenerated(type: Delete) {
|
|||
}
|
||||
}
|
||||
|
||||
task regenParser(type: JavaExec) {
|
||||
dependsOn cleanGenerated
|
||||
tasks.register("regenParser", JavaExec) {
|
||||
dependsOn "cleanGenerated"
|
||||
main = 'org.antlr.v4.Tool'
|
||||
classpath = configurations.regenerate
|
||||
systemProperty 'file.encoding', 'UTF-8'
|
||||
|
@ -98,8 +98,8 @@ task regenParser(type: JavaExec) {
|
|||
"${file(grammarPath)}/EqlBase.g4"
|
||||
}
|
||||
|
||||
task regen {
|
||||
dependsOn regenParser
|
||||
tasks.register("regen") {
|
||||
dependsOn "regenParser"
|
||||
doLast {
|
||||
// moves token files to grammar directory for use with IDE's
|
||||
ant.move(file: "${outputPath}/EqlBase.tokens", toDir: grammarPath)
|
||||
|
|
|
@ -69,17 +69,17 @@ configurations {
|
|||
testArtifacts.extendsFrom testRuntime
|
||||
testArtifacts.extendsFrom testImplementation
|
||||
}
|
||||
task testJar(type: Jar) {
|
||||
TaskProvider testJar = tasks.register("testJar", Jar) {
|
||||
appendix 'test'
|
||||
from sourceSets.test.output
|
||||
}
|
||||
artifacts {
|
||||
// normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions
|
||||
archives jar
|
||||
archives tasks.named('jar')
|
||||
testArtifacts testJar
|
||||
}
|
||||
|
||||
task extractNativeLicenses(type: Copy) {
|
||||
tasks.register("extractNativeLicenses", Copy) {
|
||||
dependsOn configurations.nativeBundle
|
||||
into "${buildDir}"
|
||||
from {
|
||||
|
@ -89,23 +89,28 @@ task extractNativeLicenses(type: Copy) {
|
|||
}
|
||||
project.afterEvaluate {
|
||||
// Add an extra licenses directory to the combined notices
|
||||
project.tasks.findByName('generateNotice').dependsOn extractNativeLicenses
|
||||
project.tasks.findByName('generateNotice').licensesDir new File("${project.buildDir}/platform/licenses")
|
||||
project.tasks.findByName('generateNotice').outputs.upToDateWhen {
|
||||
extractNativeLicenses.state.upToDate
|
||||
tasks.named('generateNotice').configure {
|
||||
dependsOn "extractNativeLicenses"
|
||||
licensesDir new File("${project.buildDir}/platform/licenses")
|
||||
outputs.upToDateWhen {
|
||||
extractNativeLicenses.didWork
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// xpack modules are installed in real clusters as the meta plugin, so
|
||||
// installing them as individual plugins for integ tests doesn't make sense,
|
||||
// so we disable integ tests
|
||||
integTest.enabled = false
|
||||
tasks.named("integTest").configure {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
def checkTask = tasks.named("check")
|
||||
// add all sub-projects of the qa sub-project
|
||||
gradle.projectsEvaluated {
|
||||
project.subprojects
|
||||
.find { it.path == project.path + ":qa" }
|
||||
.subprojects
|
||||
.findAll { it.path.startsWith(project.path + ":qa") }
|
||||
.each { check.dependsOn it.check }
|
||||
.each { subProj -> checkTask.configure { dependsOn subProj.tasks.named("check") } }
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ File keystoreDir = new File(project.buildDir, 'keystore')
|
|||
File nodeKey = file("$keystoreDir/testnode.pem")
|
||||
File nodeCert = file("$keystoreDir/testnode.crt")
|
||||
// Add key and certs to test classpath: it expects it there
|
||||
task copyKeyCerts(type: Copy) {
|
||||
tasks.register("copyKeyCerts", Copy) {
|
||||
from(project(':x-pack:plugin:core').file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/')) {
|
||||
include 'testnode.crt', 'testnode.pem'
|
||||
}
|
||||
|
@ -24,10 +24,10 @@ task copyKeyCerts(type: Copy) {
|
|||
}
|
||||
// Add keys and cets to test classpath: it expects it there
|
||||
sourceSets.test.resources.srcDir(keystoreDir)
|
||||
processTestResources.dependsOn(copyKeyCerts)
|
||||
tasks.named("processTestResources").configure { dependsOn("copyKeyCerts") }
|
||||
|
||||
integTest {
|
||||
dependsOn copyKeyCerts
|
||||
dependsOn "copyKeyCerts"
|
||||
runner {
|
||||
/*
|
||||
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
|
||||
|
|
|
@ -28,13 +28,13 @@ configurations {
|
|||
testArtifacts.extendsFrom testRuntime
|
||||
testArtifacts.extendsFrom testImplementation
|
||||
}
|
||||
task testJar(type: Jar) {
|
||||
TaskProvider testJar = tasks.register("testJar", Jar) {
|
||||
appendix 'test'
|
||||
from sourceSets.test.output
|
||||
}
|
||||
artifacts {
|
||||
// normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions
|
||||
archives jar
|
||||
archives tasks.named("jar")
|
||||
testArtifacts testJar
|
||||
}
|
||||
|
||||
|
@ -46,4 +46,4 @@ tasks.named("dependencyLicenses").configure {
|
|||
// xpack modules are installed in real clusters as the meta plugin, so
|
||||
// installing them as individual plugins for integ tests doesn't make sense,
|
||||
// so we disable integ tests
|
||||
integTest.enabled = false
|
||||
tasks.named("integTest").configure { enabled = false }
|
||||
|
|
|
@ -21,17 +21,18 @@ configurations {
|
|||
testArtifacts.extendsFrom testImplementation
|
||||
}
|
||||
|
||||
task testJar(type: Jar) {
|
||||
TaskProvider testJar = tasks.register("testJar", Jar) {
|
||||
appendix 'test'
|
||||
from sourceSets.test.output
|
||||
}
|
||||
|
||||
artifacts {
|
||||
// normal es plugins do not publish the jar but we need to since users need it for extensions
|
||||
archives jar
|
||||
archives tasks.named("jar")
|
||||
testArtifacts testJar
|
||||
}
|
||||
|
||||
|
||||
// disable integration tests for now
|
||||
integTest.enabled = false
|
||||
tasks.named("integTest").configure {
|
||||
enabled = false
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ configurations {
|
|||
testArtifacts.extendsFrom testImplementation
|
||||
}
|
||||
|
||||
task testJar(type: Jar) {
|
||||
def testJar = tasks.register("testJar", Jar) {
|
||||
appendix 'test'
|
||||
from sourceSets.test.output
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ testClusters.integTest {
|
|||
}
|
||||
}
|
||||
|
||||
task azureThirdPartyTest {
|
||||
dependsOn integTest
|
||||
tasks.register("azureThirdPartyTest") {
|
||||
dependsOn "integTest"
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ if (!gcsServiceAccount && !gcsBucket && !gcsBasePath) {
|
|||
}
|
||||
|
||||
/** A service account file that points to the Google Cloud Storage service emulated by the fixture **/
|
||||
task createServiceAccountFile() {
|
||||
tasks.register("createServiceAccountFile") {
|
||||
doLast {
|
||||
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA")
|
||||
keyPairGenerator.initialize(1024)
|
||||
|
@ -133,6 +133,6 @@ testClusters.integTest {
|
|||
setting 'xpack.license.self_generated.type', 'trial'
|
||||
}
|
||||
|
||||
task gcsThirdPartyTest {
|
||||
dependsOn integTest
|
||||
tasks.register("gcsThirdPartyTest") {
|
||||
dependsOn "integTest"
|
||||
}
|
||||
|
|
|
@ -77,6 +77,6 @@ testClusters.integTest {
|
|||
}
|
||||
}
|
||||
|
||||
task s3ThirdPartyTest {
|
||||
dependsOn integTest
|
||||
tasks.register("s3ThirdPartyTest") {
|
||||
dependsOn "integTest"
|
||||
}
|
||||
|
|
|
@ -145,13 +145,13 @@ configurations {
|
|||
testArtifacts.extendsFrom testRuntime
|
||||
testArtifacts.extendsFrom testImplementation
|
||||
}
|
||||
task testJar(type: Jar) {
|
||||
TaskProvider testJar = tasks.register("testJar", Jar) {
|
||||
appendix 'test'
|
||||
from sourceSets.test.output
|
||||
}
|
||||
artifacts {
|
||||
// normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions
|
||||
archives jar
|
||||
archives tasks.named('jar')
|
||||
testArtifacts testJar
|
||||
}
|
||||
|
||||
|
|
|
@ -55,5 +55,5 @@ task integTestSecurity(type: RestTestRunnerTask) {
|
|||
nonInputProperties.systemProperty 'tests.rest.cluster', "${-> testClusters.integTest.getAllHttpSocketURI().join(",")}"
|
||||
}
|
||||
}
|
||||
check.dependsOn(integTestSecurity)
|
||||
tasks.named("check").configure { dependsOn(integTestSecurity) }
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ dependencies {
|
|||
String grammarPath = 'src/main/antlr'
|
||||
String outputPath = 'src/main/java/org/elasticsearch/xpack/sql/parser'
|
||||
|
||||
task cleanGenerated(type: Delete) {
|
||||
tasks.register("cleanGenerated", Delete) {
|
||||
delete fileTree(grammarPath) {
|
||||
include '*.tokens'
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ task cleanGenerated(type: Delete) {
|
|||
}
|
||||
}
|
||||
|
||||
task regenParser(type: JavaExec) {
|
||||
dependsOn cleanGenerated
|
||||
tasks.register("regenParser", JavaExec) {
|
||||
dependsOn "cleanGenerated"
|
||||
main = 'org.antlr.v4.Tool'
|
||||
classpath = configurations.regenerate
|
||||
systemProperty 'file.encoding', 'UTF-8'
|
||||
|
@ -110,8 +110,8 @@ task regenParser(type: JavaExec) {
|
|||
"${file(grammarPath)}/SqlBase.g4"
|
||||
}
|
||||
|
||||
task regen {
|
||||
dependsOn regenParser
|
||||
tasks.register("regen") {
|
||||
dependsOn "regenParser"
|
||||
doLast {
|
||||
// moves token files to grammar directory for use with IDE's
|
||||
ant.move(file: "${outputPath}/SqlBase.tokens", toDir: grammarPath)
|
||||
|
|
|
@ -33,15 +33,12 @@ dependencies {
|
|||
testRuntimeOnly "org.elasticsearch:jna:${versions.jna}"
|
||||
}
|
||||
|
||||
/* disable unit tests because these are all integration tests used
|
||||
* other qa projects. */
|
||||
test.enabled = false
|
||||
|
||||
tasks.named("dependencyLicenses").configure { it.enabled = false }
|
||||
dependenciesInfo.enabled = false
|
||||
|
||||
// just a test fixture: we aren't using this jars in releases and H2GIS requires disabling a lot of checks
|
||||
thirdPartyAudit.enabled = false
|
||||
// this is just a test fixture used by other projects and not in production
|
||||
['test', 'dependencyLicenses', 'thirdPartyAudit', 'dependenciesInfo'].each {
|
||||
tasks.named(it).configure {
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
if (subprojects.isEmpty()) {
|
||||
|
|
|
@ -54,9 +54,9 @@ tasks.named('forbiddenApisMain').configure {
|
|||
signaturesFiles += files('src/forbidden/cli-signatures.txt')
|
||||
}
|
||||
|
||||
task runcli {
|
||||
tasks.register("runcli") {
|
||||
description = 'Run the CLI and connect to elasticsearch running on 9200'
|
||||
dependsOn shadowJar
|
||||
dependsOn "shadowJar"
|
||||
doLast {
|
||||
List command = ["${BuildParams.runtimeJavaHome}/bin/java"]
|
||||
if ('true'.equals(System.getProperty('debug', 'false'))) {
|
||||
|
|
|
@ -14,7 +14,7 @@ File keystoreDir = new File(project.buildDir, 'keystore')
|
|||
File nodeKey = file("$keystoreDir/testnode.pem")
|
||||
File nodeCert = file("$keystoreDir/testnode.crt")
|
||||
// Add key and certs to test classpath: it expects it there
|
||||
task copyKeyCerts(type: Copy) {
|
||||
tasks.register("copyKeyCerts", Copy) {
|
||||
from(project(':x-pack:plugin:core').file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/')) {
|
||||
include 'testnode.crt', 'testnode.pem'
|
||||
}
|
||||
|
@ -22,9 +22,9 @@ task copyKeyCerts(type: Copy) {
|
|||
}
|
||||
// Add keys and cets to test classpath: it expects it there
|
||||
sourceSets.test.resources.srcDir(keystoreDir)
|
||||
processTestResources.dependsOn(copyKeyCerts)
|
||||
tasks.named("processTestResources").configure { dependsOn("copyKeyCerts") }
|
||||
|
||||
integTest.dependsOn copyKeyCerts
|
||||
tasks.named("integTest").configure { dependsOn "copyKeyCerts" }
|
||||
|
||||
testClusters.integTest {
|
||||
testDistribution = 'DEFAULT'
|
||||
|
|
|
@ -12,7 +12,7 @@ configurations {
|
|||
testArtifacts.extendsFrom testImplementation
|
||||
}
|
||||
|
||||
task testJar(type: Jar) {
|
||||
def testJar = tasks.register("testJar", Jar) {
|
||||
appendix 'test'
|
||||
from sourceSets.test.output
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@ dependencies {
|
|||
testImplementation project(':x-pack:qa')
|
||||
}
|
||||
|
||||
licenseHeaders {
|
||||
tasks.named("licenseHeaders").configure {
|
||||
approvedLicenses << 'Apache'
|
||||
}
|
||||
|
||||
forbiddenPatterns {
|
||||
tasks.named("forbiddenPatterns") {
|
||||
exclude '**/system_key'
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ testClusters.integTest {
|
|||
user username: "test_kibana_user", password: "x-pack-test-password", role: "kibana_system"
|
||||
}
|
||||
|
||||
task copyKeytabToGeneratedResources(type: Copy) {
|
||||
tasks.register("copyKeytabToGeneratedResources", Copy) {
|
||||
from project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("peppa", "peppa.keytab")
|
||||
into "$buildDir/generated-resources/keytabs"
|
||||
dependsOn project(':test:fixtures:krb5kdc-fixture').postProcessFixture
|
||||
|
|
|
@ -55,9 +55,9 @@ testClusters.'mixed-cluster' {
|
|||
user username: "test_user", password: "x-pack-test-password"
|
||||
}
|
||||
|
||||
task integTest {
|
||||
tasks.register("integTest") {
|
||||
dependsOn 'mixed-cluster'
|
||||
}
|
||||
|
||||
test.enabled = false // no unit tests for multi-cluster-search, only the rest integration test
|
||||
check.dependsOn(integTest)
|
||||
tasks.named("test").configure { enabled = false } // no unit tests for multi-cluster-search, only the rest integration test
|
||||
tasks.named("check").configure { dependsOn("integTest") }
|
||||
|
|
|
@ -54,9 +54,9 @@ testClusters.'mixed-cluster' {
|
|||
user username: "test_user", password: "x-pack-test-password"
|
||||
}
|
||||
|
||||
task integTest {
|
||||
tasks.register("integTest") {
|
||||
dependsOn 'mixed-cluster'
|
||||
}
|
||||
|
||||
test.enabled = false // no unit tests for multi-cluster-search, only the rest integration test
|
||||
check.dependsOn(integTest)
|
||||
tasks.named("test").configure { enabled = false } // no unit tests for multi-cluster-search, only the rest integration test
|
||||
tasks.named("check").configure { dependsOn("integTest") }
|
||||
|
|
|
@ -14,7 +14,7 @@ testFixtures.useFixture ":x-pack:test:idp-fixture", "oidc-provider"
|
|||
|
||||
String ephemeralOpPort
|
||||
String ephemeralProxyPort
|
||||
task setupPorts {
|
||||
tasks.register("setupPorts") {
|
||||
// Don't attempt to get ephemeral ports when Docker is not available
|
||||
onlyIf { idpFixtureProject.postProcessFixture.state.skipped == false }
|
||||
dependsOn idpFixtureProject.postProcessFixture
|
||||
|
@ -25,7 +25,7 @@ task setupPorts {
|
|||
}
|
||||
|
||||
integTest.runner {
|
||||
dependsOn setupPorts
|
||||
dependsOn "setupPorts"
|
||||
}
|
||||
|
||||
testClusters.integTest {
|
||||
|
|
|
@ -11,7 +11,7 @@ testFixtures.useFixture ":x-pack:test:idp-fixture", "openldap"
|
|||
|
||||
Project idpFixtureProject = xpackProject("test:idp-fixture")
|
||||
String outputDir = "${project.buildDir}/generated-resources/${project.name}"
|
||||
task copyIdpTrust(type: Copy) {
|
||||
def copyIdpTrust = tasks.register("copyIdpTrust", Copy) {
|
||||
from idpFixtureProject.file('openldap/certs/ca.jks');
|
||||
from idpFixtureProject.file('openldap/certs/ca_server.pem');
|
||||
into outputDir
|
||||
|
|
|
@ -25,7 +25,7 @@ forbiddenPatterns {
|
|||
|
||||
String outputDir = "${buildDir}/generated-resources/${project.name}"
|
||||
|
||||
task copyTestNodeKeyMaterial(type: Copy) {
|
||||
tasks.register("copyTestNodeKeyMaterial", Copy) {
|
||||
from project(':x-pack:plugin:core').files('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.pem',
|
||||
'src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.crt')
|
||||
into outputDir
|
||||
|
@ -92,7 +92,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
|
|||
tasks.register("${baseName}#oldClusterTest", RestTestRunnerTask) {
|
||||
useCluster testClusters."${baseName}"
|
||||
mustRunAfter(precommit)
|
||||
dependsOn copyTestNodeKeyMaterial
|
||||
dependsOn "copyTestNodeKeyMaterial"
|
||||
systemProperty 'tests.rest.suite', 'old_cluster'
|
||||
systemProperty 'tests.upgrade_from_version', oldVersion
|
||||
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
|
||||
|
|
|
@ -13,13 +13,13 @@ testFixtures.useFixture ":x-pack:test:idp-fixture"
|
|||
|
||||
|
||||
String outputDir = "${project.buildDir}/generated-resources/${project.name}"
|
||||
task copyIdpFiles(type: Copy) {
|
||||
def copyIdpFiles = tasks.register("copyIdpFiles", Copy) {
|
||||
from idpFixtureProject.files('idp/shibboleth-idp/credentials/idp-browser.pem', 'idp/shibboleth-idp/metadata/idp-metadata.xml');
|
||||
into outputDir
|
||||
}
|
||||
project.sourceSets.test.output.dir(outputDir, builtBy: copyIdpFiles)
|
||||
|
||||
task setupPorts {
|
||||
tasks.register("setupPorts") {
|
||||
dependsOn copyIdpFiles, idpFixtureProject.postProcessFixture
|
||||
// Don't attempt to get ephemeral ports when Docker is not available
|
||||
onlyIf { idpFixtureProject.postProcessFixture.state.skipped == false }
|
||||
|
@ -39,7 +39,7 @@ task setupPorts {
|
|||
}
|
||||
|
||||
|
||||
integTest.runner.dependsOn setupPorts
|
||||
integTest.runner.dependsOn "setupPorts"
|
||||
|
||||
testClusters.integTest {
|
||||
testDistribution = 'DEFAULT'
|
||||
|
@ -85,13 +85,13 @@ testClusters.integTest {
|
|||
user username: "test_admin", password: 'x-pack-test-password'
|
||||
}
|
||||
|
||||
forbiddenPatterns {
|
||||
tasks.named("forbiddenPatterns").configure {
|
||||
exclude '**/*.der'
|
||||
exclude '**/*.p12'
|
||||
exclude '**/*.key'
|
||||
}
|
||||
|
||||
thirdPartyAudit {
|
||||
tasks.named("thirdPartyAudit").configure {
|
||||
ignoreViolations(
|
||||
// uses internal java api: sun.misc.Unsafe
|
||||
'com.google.common.cache.Striped64',
|
||||
|
|
|
@ -12,7 +12,7 @@ dependencies {
|
|||
}
|
||||
|
||||
String outputDir = "${buildDir}/generated-resources/${project.name}"
|
||||
task copyXPackPluginProps(type: Copy) {
|
||||
def copyXPackPluginProps = tasks.register("copyXPackPluginProps", Copy) {
|
||||
from project(xpackModule('core')).file('src/main/plugin-metadata')
|
||||
from project(xpackModule('core')).tasks.pluginProperties
|
||||
into outputDir
|
||||
|
@ -29,7 +29,7 @@ File clientKey = file("$keystoreDir/testclient.pem")
|
|||
File clientCert = file("$keystoreDir/testclient.crt")
|
||||
|
||||
// Add keystores to test classpath: it expects it there
|
||||
task copyKeyCerts(type: Copy) {
|
||||
def copyKeyCerts = tasks.register("copyKeyCerts", Copy) {
|
||||
from('./') {
|
||||
include '*.crt', '*.pem', '*.jks'
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ ext.expansions = [
|
|||
'expected.plugins.count': pluginsCount
|
||||
]
|
||||
|
||||
processTestResources {
|
||||
tasks.named("processTestResources").configure {
|
||||
from(sourceSets.test.resources.srcDirs) {
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
include '**/*.yml'
|
||||
|
|
|
@ -24,7 +24,7 @@ String jiraUser = System.getenv('jira_user')
|
|||
String jiraPassword = System.getenv('jira_password')
|
||||
String jiraProject = System.getenv('jira_project')
|
||||
|
||||
task cleanJira(type: DefaultTask) {
|
||||
tasks.register("cleanJira", DefaultTask) {
|
||||
doLast {
|
||||
List<String> issues = jiraIssues(jiraProject)
|
||||
assert issues instanceof List
|
||||
|
@ -54,7 +54,7 @@ if (!jiraUrl && !jiraUser && !jiraPassword && !jiraProject) {
|
|||
keystore 'xpack.notification.jira.account.test.secure_user', jiraUser
|
||||
keystore 'xpack.notification.jira.account.test.secure_password', jiraPassword
|
||||
}
|
||||
integTest.runner.finalizedBy cleanJira
|
||||
integTest.runner.finalizedBy "cleanJira"
|
||||
}
|
||||
|
||||
/** List all issues associated to a given Jira project **/
|
||||
|
|
Loading…
Reference in New Issue