Skip to content

Commit 0e3d6c5

Browse files
committed
Merge branch 'master' into HEAD
* master: (283 commits) HLREST: add update by query API (elastic#32760) TEST: Increase timeout testFollowIndexAndCloseNode (elastic#33333) HLRC: ML Flush job (elastic#33187) HLRC: Adding ML Job stats (elastic#33183) LLREST: Drop deprecated methods (elastic#33223) Mute testSyncerOnClosingShard [DOCS] Moves machine learning APIs to docs folder (elastic#31118) Mute test watcher usage stats output [Rollup] Fix FullClusterRestart test Adjust soft-deletes version after backport into 6.5 completely drop `index.shard.check_on_startup: fix` for 7.0 (elastic#33194) Fix AwaitsFix issue number Mute SmokeTestWatcherWithSecurityIT testsi drop `index.shard.check_on_startup: fix` (elastic#32279) tracked at [DOCS] Moves ml folder from x-pack/docs to docs (elastic#33248) [DOCS] Move rollup APIs to docs (elastic#31450) [DOCS] Rename X-Pack Commands section (elastic#33005) TEST: Disable soft-deletes in ParentChildTestCase Fixes SecurityIntegTestCase so it always adds at least one alias (elastic#33296) ...
2 parents 7273354 + ea4eef8 commit 0e3d6c5

File tree

1,530 files changed

+41137
-16736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,530 files changed

+41137
-16736
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Contributing to the Elasticsearch codebase
9595
JDK 10 is required to build Elasticsearch. You must have a JDK 10 installation
9696
with the environment variable `JAVA_HOME` referencing the path to Java home for
9797
your JDK 10 installation. By default, tests use the same runtime as `JAVA_HOME`.
98-
However, since Elasticsearch, supports JDK 8 the build supports compiling with
98+
However, since Elasticsearch supports JDK 8, the build supports compiling with
9999
JDK 10 and testing on a JDK 8 runtime; to do this, set `RUNTIME_JAVA_HOME`
100100
pointing to the Java home of a JDK 8 installation. Note that this mechanism can
101101
be used to test against other JDKs as well, this is not only limited to JDK 8.
@@ -325,21 +325,19 @@ common configurations in our build and how we use them:
325325

326326
<dl>
327327
<dt>`compile`</dt><dd>Code that is on the classpath at both compile and
328-
runtime. If the [`shadow`][shadow-plugin] plugin is applied to the project then
329-
this code is bundled into the jar produced by the project.</dd>
328+
runtime.</dd>
330329
<dt>`runtime`</dt><dd>Code that is not on the classpath at compile time but is
331330
on the classpath at runtime. We mostly use this configuration to make sure that
332331
we do not accidentally compile against dependencies of our dependencies also
333332
known as "transitive" dependencies".</dd>
334-
<dt>`compileOnly`</dt><dd>Code that is on the classpath at comile time but that
333+
<dt>`compileOnly`</dt><dd>Code that is on the classpath at compile time but that
335334
should not be shipped with the project because it is "provided" by the runtime
336335
somehow. Elasticsearch plugins use this configuration to include dependencies
337336
that are bundled with Elasticsearch's server.</dd>
338-
<dt>`shadow`</dt><dd>Only available in projects with the shadow plugin. Code
339-
that is on the classpath at both compile and runtime but it *not* bundled into
340-
the jar produced by the project. If you depend on a project with the `shadow`
341-
plugin then you need to depend on this configuration because it will bring
342-
along all of the dependencies you need at runtime.</dd>
337+
<dt>`bundle`</dt><dd>Only available in projects with the shadow plugin,
338+
dependencies with this configuration are bundled into the jar produced by the
339+
build. Since IDEs do not understand this configuration we rig them to treat
340+
dependencies in this configuration as `compile` dependencies.</dd>
343341
<dt>`testCompile`</dt><dd>Code that is on the classpath for compiling tests
344342
that are part of this project but not production code. The canonical example
345343
of this is `junit`.</dd>

build.gradle

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,19 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
1920
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
21+
import org.apache.tools.ant.taskdefs.condition.Os
2022
import org.elasticsearch.gradle.BuildPlugin
2123
import org.elasticsearch.gradle.LoggedExec
2224
import org.elasticsearch.gradle.Version
2325
import org.elasticsearch.gradle.VersionCollection
2426
import org.elasticsearch.gradle.VersionProperties
27+
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
2528
import org.gradle.plugins.ide.eclipse.model.SourceFolder
26-
import org.gradle.util.GradleVersion
27-
import org.gradle.util.DistributionLocator
28-
import org.apache.tools.ant.taskdefs.condition.Os
29-
import org.apache.tools.ant.filters.ReplaceTokens
3029

3130
import java.nio.file.Files
3231
import java.nio.file.Path
33-
import java.security.MessageDigest
3432

3533
plugins {
3634
id 'com.gradle.build-scan' version '1.13.2'
@@ -87,8 +85,15 @@ subprojects {
8785
}
8886
}
8987
}
88+
repositories {
89+
maven {
90+
name = 'localTest'
91+
url = "${rootProject.buildDir}/local-test-repo"
92+
}
93+
}
9094
}
9195
}
96+
9297
plugins.withType(BuildPlugin).whenPluginAdded {
9398
project.licenseFile = project.rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
9499
project.noticeFile = project.rootProject.file('NOTICE.txt')
@@ -228,6 +233,7 @@ subprojects {
228233
"org.elasticsearch.client:elasticsearch-rest-high-level-client:${version}": ':client:rest-high-level',
229234
"org.elasticsearch.client:test:${version}": ':client:test',
230235
"org.elasticsearch.client:transport:${version}": ':client:transport',
236+
"org.elasticsearch.plugin:elasticsearch-scripting-painless-spi:${version}": ':modules:lang-painless:spi',
231237
"org.elasticsearch.test:framework:${version}": ':test:framework',
232238
"org.elasticsearch.distribution.integ-test-zip:elasticsearch:${version}": ':distribution:archives:integ-test-zip',
233239
"org.elasticsearch.distribution.zip:elasticsearch:${version}": ':distribution:archives:zip',
@@ -296,7 +302,7 @@ subprojects {
296302
// org.elasticsearch:elasticsearch must be the last one or all the links for the
297303
// other packages (e.g org.elasticsearch.client) will point to server rather than
298304
// their own artifacts.
299-
if (project.plugins.hasPlugin(BuildPlugin)) {
305+
if (project.plugins.hasPlugin(BuildPlugin) || project.plugins.hasPlugin(PluginBuildPlugin)) {
300306
String artifactsHost = VersionProperties.elasticsearch.isSnapshot() ? "https://snapshots.elastic.co" : "https://artifacts.elastic.co"
301307
Closure sortClosure = { a, b -> b.group <=> a.group }
302308
Closure depJavadocClosure = { shadowed, dep ->
@@ -314,13 +320,6 @@ subprojects {
314320
*/
315321
project.evaluationDependsOn(upstreamProject.path)
316322
project.javadoc.source += upstreamProject.javadoc.source
317-
/*
318-
* Do not add those projects to the javadoc classpath because
319-
* we are going to resolve them with their source instead.
320-
*/
321-
project.javadoc.classpath = project.javadoc.classpath.filter { f ->
322-
false == upstreamProject.configurations.archives.artifacts.files.files.contains(f)
323-
}
324323
/*
325324
* Instead we need the upstream project's javadoc classpath so
326325
* we don't barf on the classes that it references.
@@ -337,16 +336,16 @@ subprojects {
337336
project.configurations.compile.dependencies
338337
.findAll()
339338
.toSorted(sortClosure)
340-
.each({ c -> depJavadocClosure(hasShadow, c) })
339+
.each({ c -> depJavadocClosure(false, c) })
341340
project.configurations.compileOnly.dependencies
342341
.findAll()
343342
.toSorted(sortClosure)
344-
.each({ c -> depJavadocClosure(hasShadow, c) })
343+
.each({ c -> depJavadocClosure(false, c) })
345344
if (hasShadow) {
346-
project.configurations.shadow.dependencies
345+
project.configurations.bundle.dependencies
347346
.findAll()
348347
.toSorted(sortClosure)
349-
.each({ c -> depJavadocClosure(false, c) })
348+
.each({ c -> depJavadocClosure(true, c) })
350349
}
351350
}
352351
}
@@ -510,30 +509,33 @@ allprojects {
510509
tasks.cleanEclipse.dependsOn(wipeEclipseSettings)
511510
// otherwise the eclipse merging is *super confusing*
512511
tasks.eclipse.dependsOn(cleanEclipse, copyEclipseSettings)
512+
513+
// work arround https://github.com/gradle/gradle/issues/6582
514+
tasks.eclipseProject.mustRunAfter tasks.cleanEclipseProject
515+
tasks.matching { it.name == 'eclipseClasspath' }.all {
516+
it.mustRunAfter { tasks.cleanEclipseClasspath }
517+
}
518+
tasks.matching { it.name == 'eclipseJdt' }.all {
519+
it.mustRunAfter { tasks.cleanEclipseJdt }
520+
}
521+
tasks.copyEclipseSettings.mustRunAfter tasks.wipeEclipseSettings
513522
}
514523

515524
allprojects {
516525
/*
517526
* IntelliJ and Eclipse don't know about the shadow plugin so when we're
518-
* in "IntelliJ mode" or "Eclipse mode" add "runtime" dependencies
519-
* eveywhere where we see a "shadow" dependency which will cause them to
520-
* reference shadowed projects directly rather than rely on the shadowing
521-
* to include them. This is the correct thing for it to do because it
522-
* doesn't run the jar shadowing at all. This isn't needed for the project
527+
* in "IntelliJ mode" or "Eclipse mode" switch "bundle" dependencies into
528+
* regular "compile" dependencies. This isn't needed for the project
523529
* itself because the IDE configuration is done by SourceSets but it is
524530
* *is* needed for projects that depends on the project doing the shadowing.
525531
* Without this they won't properly depend on the shadowed project.
526532
*/
527533
if (isEclipse || isIdea) {
528-
configurations.all { Configuration configuration ->
529-
dependencies.all { Dependency dep ->
530-
if (dep instanceof ProjectDependency) {
531-
if (dep.getTargetConfiguration() == 'shadow') {
532-
configuration.dependencies.add(project.dependencies.project(path: dep.dependencyProject.path, configuration: 'runtime'))
533-
}
534-
}
535-
}
536-
}
534+
project.plugins.withType(ShadowPlugin).whenPluginAdded {
535+
project.afterEvaluate {
536+
project.configurations.compile.extendsFrom project.configurations.bundle
537+
}
538+
}
537539
}
538540
}
539541

buildSrc/build.gradle

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919
import java.nio.file.Files
20+
import org.gradle.util.GradleVersion
2021

2122
plugins {
2223
id 'java-gradle-plugin'
@@ -102,7 +103,6 @@ dependencies {
102103
compile 'com.netflix.nebula:gradle-info-plugin:3.0.3'
103104
compile 'org.eclipse.jgit:org.eclipse.jgit:3.2.0.201312181205-r'
104105
compile 'com.perforce:p4java:2012.3.551082' // THIS IS SUPPOSED TO BE OPTIONAL IN THE FUTURE....
105-
compile 'de.thetaphi:forbiddenapis:2.5'
106106
compile 'org.apache.rat:apache-rat:0.11'
107107
compile "org.elasticsearch:jna:4.5.1"
108108
compile 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
@@ -162,11 +162,23 @@ if (project != rootProject) {
162162
// it's fine as we run them as part of :buildSrc
163163
test.enabled = false
164164
task integTest(type: Test) {
165+
// integration test requires the local testing repo for example plugin builds
166+
dependsOn project.rootProject.allprojects.collect {
167+
it.tasks.matching { it.name == 'publishNebulaPublicationToLocalTestRepository'}
168+
}
165169
exclude "**/*Tests.class"
166-
include "**/*IT.class"
167170
testClassesDirs = sourceSets.test.output.classesDirs
168171
classpath = sourceSets.test.runtimeClasspath
169172
inputs.dir(file("src/testKit"))
173+
// tell BuildExamplePluginsIT where to find the example plugins
174+
systemProperty (
175+
'test.build-tools.plugin.examples',
176+
files(
177+
project(':example-plugins').subprojects.collect { it.projectDir }
178+
).asPath,
179+
)
180+
systemProperty 'test.local-test-repo-path', "${rootProject.buildDir}/local-test-repo"
181+
systemProperty 'test.lucene-snapshot-revision', (versions.lucene =~ /\w+-snapshot-([a-z0-9]+)/)[0][1]
170182
}
171183
check.dependsOn(integTest)
172184

0 commit comments

Comments
 (0)