Skip to content

Commit

Permalink
Merge remote-tracking branch 'elastic/master' into geosql
Browse files Browse the repository at this point in the history
  • Loading branch information
imotov committed Apr 9, 2019
2 parents 1ac266a + 96439b5 commit 513eba1
Show file tree
Hide file tree
Showing 784 changed files with 17,590 additions and 9,708 deletions.
2 changes: 1 addition & 1 deletion .ci/java-versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# are 'java' or 'openjdk' followed by the major release number.

ES_BUILD_JAVA=openjdk12
ES_RUNTIME_JAVA=java8
ES_RUNTIME_JAVA=java11
GRADLE_TASK=build

3 changes: 0 additions & 3 deletions .ci/matrix-runtime-javas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
# or 'openjdk' followed by the major release number.

ES_RUNTIME_JAVA:
- java8
- java8fips
- java11
- java12
- openjdk12
- zulu8
- zulu11
- zulu12
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Contributing to the Elasticsearch codebase
JDK 12 is required to build Elasticsearch. You must have a JDK 12 installation
with the environment variable `JAVA_HOME` referencing the path to Java home for
your JDK 12 installation. By default, tests use the same runtime as `JAVA_HOME`.
However, since Elasticsearch supports JDK 8, the build supports compiling with
JDK 12 and testing on a JDK 8 runtime; to do this, set `RUNTIME_JAVA_HOME`
pointing to the Java home of a JDK 8 installation. Note that this mechanism can
be used to test against other JDKs as well, this is not only limited to JDK 8.
However, since Elasticsearch supports JDK 11, the build supports compiling with
JDK 12 and testing on a JDK 11 runtime; to do this, set `RUNTIME_JAVA_HOME`
pointing to the Java home of a JDK 11 installation. Note that this mechanism can
be used to test against other JDKs as well, this is not only limited to JDK 11.

> Note: It is also required to have `JAVA8_HOME`, `JAVA9_HOME`, `JAVA10_HOME`
and `JAVA11_HOME` available so that the tests can pass.
Expand Down
6 changes: 5 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ def linux_common(config,
touch /is_vagrant_vm # for consistency between linux and windows
SHELL

config.vm.provision 'jdk-11', type: 'shell', inline: <<-SHELL
curl -sSL https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz | tar xz -C /opt/
SHELL

# This prevents leftovers from previous tests using the
# same VM from messing up the current test
config.vm.provision 'clean es installs in tmp', run: 'always', type: 'shell', inline: <<-SHELL
Expand Down Expand Up @@ -342,7 +346,7 @@ def sh_install_deps(config,
}
cat \<\<JAVA > /etc/profile.d/java_home.sh
if [ -z "\\\$JAVA_HOME" ]; then
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
export JAVA_HOME=/opt/jdk-11.0.2
fi
export SYSTEM_JAVA_HOME=\\\$JAVA_HOME
unset JAVA_HOME
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mainClassName = 'org.openjdk.jmh.Main'
assemble.enabled = false
archivesBaseName = 'elasticsearch-benchmarks'

unitTest.enabled = false
test.enabled = false

dependencies {
compile("org.elasticsearch:elasticsearch:${version}") {
Expand All @@ -39,7 +39,7 @@ dependencies {
runtime 'org.apache.commons:commons-math3:3.2'
}

compileJava.options.compilerArgs << "-Xlint:-cast,-deprecation,-rawtypes,-try,-unchecked,-processing"
compileJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked,-processing"
// enable the JMH's BenchmarkProcessor to generate the final benchmark classes
// needs to be added separately otherwise Gradle will quote it and javac will fail
compileJava.options.compilerArgs.addAll(["-processor", "org.openjdk.jmh.generators.BenchmarkProcessor"])
Expand Down
35 changes: 2 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.gradle.util.DistributionLocator
import org.gradle.plugins.ide.eclipse.model.SourceFolder

plugins {
id 'com.gradle.build-scan' version '2.0.2'
id 'com.gradle.build-scan' version '2.2.1'
id 'base'
}
if (Boolean.valueOf(project.findProperty('org.elasticsearch.acceptScanTOS') ?: "false")) {
Expand Down Expand Up @@ -338,14 +338,6 @@ gradle.projectsEvaluated {
integTest.mustRunAfter test
}
configurations.all { Configuration configuration ->
/*
* The featureAwarePlugin configuration has a dependency on x-pack:plugin:core and x-pack:plugin:core has a dependency on the
* featureAwarePlugin configuration. The below task ordering logic would force :x-pack:plugin:core:test
* :x-pack:test:feature-aware:test to depend on each other circularly. We break that cycle here.
*/
if (configuration.name == "featureAwarePlugin") {
return
}
dependencies.all { Dependency dep ->
Project upstreamProject = dependencyToProject(dep)
if (upstreamProject != null) {
Expand All @@ -357,7 +349,7 @@ gradle.projectsEvaluated {
Task task = project.tasks.findByName(taskName)
Task upstreamTask = upstreamProject.tasks.findByName(taskName)
if (task != null && upstreamTask != null) {
task.mustRunAfter(upstreamTask)
task.shouldRunAfter(upstreamTask)
}
}
}
Expand All @@ -382,21 +374,6 @@ allprojects {
// also ignore other possible build dirs
excludeDirs += file('build')
excludeDirs += file('build-eclipse')

iml {
// fix so that Gradle idea plugin properly generates support for resource folders
// see also https://issues.gradle.org/browse/GRADLE-2975
withXml {
it.asNode().component.content.sourceFolder.findAll { it.@url == 'file://$MODULE_DIR$/src/main/resources' }.each {
it.attributes().remove('isTestSource')
it.attributes().put('type', 'java-resource')
}
it.asNode().component.content.sourceFolder.findAll { it.@url == 'file://$MODULE_DIR$/src/test/resources' }.each {
it.attributes().remove('isTestSource')
it.attributes().put('type', 'java-test-resource')
}
}
}
}
}

Expand All @@ -414,14 +391,6 @@ idea {
vcs = 'Git'
}
}
// Make sure gradle idea was run before running anything in intellij (including import).
File ideaMarker = new File(projectDir, '.local-idea-is-configured')
tasks.idea.doLast {
ideaMarker.setText('', 'UTF-8')
}
if (System.getProperty('idea.active') != null && ideaMarker.exists() == false) {
throw new GradleException('You must run `./gradlew idea` from the root of elasticsearch before importing into IntelliJ')
}

// eclipse configuration
allprojects {
Expand Down
21 changes: 3 additions & 18 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ dependencies {
compile 'com.perforce:p4java:2012.3.551082' // THIS IS SUPPOSED TO BE OPTIONAL IN THE FUTURE....
compile 'org.apache.rat:apache-rat:0.11'
compile "org.elasticsearch:jna:4.5.1"
compile 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
compile 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
compile 'de.thetaphi:forbiddenapis:2.6'
compile 'com.avast.gradle:gradle-docker-compose-plugin:0.8.12'
testCompile "junit:junit:${props.getProperty('junit')}"
Expand Down Expand Up @@ -198,25 +198,14 @@ if (project != rootProject) {
from configurations.distribution
into localDownloads
}

unitTest {
// The test task is configured to runtimeJava version, but build-tools doesn't support all of them, so test
// with compiler instead on the ones that are too old.
if (project.runtimeJavaVersion <= JavaVersion.VERSION_1_10) {
jvm = "${project.compilerJavaHome}/bin/java"
}
}

// This can't be an RandomizedTestingTask because we can't yet reference it

task integTest(type: Test) {
// integration test requires the local testing repo for example plugin builds
dependsOn project.rootProject.allprojects.collect {
it.tasks.matching { it.name == 'publishNebulaPublicationToLocalTestRepository'}
}
dependsOn setupLocalDownloads
exclude "**/*Tests.class"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
inputs.dir(file("src/testKit"))
// tell BuildExamplePluginsIT where to find the example plugins
systemProperty (
Expand All @@ -232,11 +221,7 @@ if (project != rootProject) {
if (isLuceneSnapshot) {
systemProperty 'test.lucene-snapshot-revision', isLuceneSnapshot[0][1]
}
String defaultParallel = System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel)
if (defaultParallel == "auto") {
defaultParallel = Math.max(Runtime.getRuntime().availableProcessors(), 4)
}
maxParallelForks defaultParallel as Integer
maxParallelForks System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel.toString()) as Integer
}
check.dependsOn(integTest)

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 513eba1

Please sign in to comment.