Skip to content

Commit

Permalink
Merge branch '6.x' into feature-jindex-6x
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle committed Dec 5, 2018
2 parents 93044e2 + 8b9b2cb commit dfc5dd4
Show file tree
Hide file tree
Showing 456 changed files with 11,860 additions and 3,771 deletions.
2 changes: 1 addition & 1 deletion .ci/packer_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ while [ -h "$SCRIPT" ] ; do
done

source $(dirname "${SCRIPT}")/java-versions.properties
JAVA_HOME="${HOME}"/.java/${ES_BUILD_JAVA} ./gradlew resolveAllDependencies --parallel
JAVA_HOME="${HOME}"/.java/${ES_BUILD_JAVA} ./gradlew --parallel resolveAllDependencies composePull
3 changes: 3 additions & 0 deletions TESTING.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ If you want to just run the precommit checks:
./gradlew precommit
---------------------------------------------------------------------------

Some of these checks will require `docker-compose` installed for bringing up
test fixtures. If it's not present those checks will be skipped automatically.

== Testing the REST layer

The available integration tests make use of the java API to communicate with
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ dependencies {
compile "org.elasticsearch:jna:4.5.1"
compile 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
compile 'de.thetaphi:forbiddenapis:2.6'
compile 'com.avast.gradle:docker-compose-gradle-plugin:0.4.5'
testCompile "junit:junit:${props.getProperty('junit')}"
}

Expand Down Expand Up @@ -166,6 +167,10 @@ if (project != rootProject) {
apply plugin: 'nebula.maven-base-publish'
apply plugin: 'nebula.maven-scm'

// we need to apply these again to override the build plugin
targetCompatibility = "10"
sourceCompatibility = "10"

// groovydoc succeeds, but has some weird internal exception...
groovydoc.enabled = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ class BuildPlugin implements Plugin<Project> {
println " Gradle Version : ${project.gradle.gradleVersion}"
println " OS Info : ${System.getProperty('os.name')} ${System.getProperty('os.version')} (${System.getProperty('os.arch')})"
if (gradleJavaVersionDetails != compilerJavaVersionDetails || gradleJavaVersionDetails != runtimeJavaVersionDetails) {
println " Compiler JDK Version : ${getPaddedMajorVersion(compilerJavaVersionEnum)} (${compilerJavaVersionDetails})"
println " Compiler JDK Version : ${compilerJavaVersionEnum} (${compilerJavaVersionDetails})"
println " Compiler java.home : ${compilerJavaHome}"
println " Runtime JDK Version : ${getPaddedMajorVersion(runtimeJavaVersionEnum)} (${runtimeJavaVersionDetails})"
println " Runtime JDK Version : ${runtimeJavaVersionEnum} (${runtimeJavaVersionDetails})"
println " Runtime java.home : ${runtimeJavaHome}"
println " Gradle JDK Version : ${getPaddedMajorVersion(JavaVersion.toVersion(gradleJavaVersion))} (${gradleJavaVersionDetails})"
println " Gradle JDK Version : ${JavaVersion.toVersion(gradleJavaVersion)} (${gradleJavaVersionDetails})"
println " Gradle java.home : ${gradleJavaHome}"
} else {
println " JDK Version : ${getPaddedMajorVersion(JavaVersion.toVersion(gradleJavaVersion))} (${gradleJavaVersionDetails})"
println " JDK Version : ${JavaVersion.toVersion(gradleJavaVersion)} (${gradleJavaVersionDetails})"
println " JAVA_HOME : ${gradleJavaHome}"
}
println " Random Testing Seed : ${project.testSeed}"
Expand Down Expand Up @@ -232,10 +232,6 @@ class BuildPlugin implements Plugin<Project> {
project.ext.java9Home = project.rootProject.ext.java9Home
}

private static String getPaddedMajorVersion(JavaVersion compilerJavaVersionEnum) {
compilerJavaVersionEnum.getMajorVersion().toString().padLeft(2)
}

private static String findCompilerJavaHome() {
final String compilerJavaHome = System.getenv('JAVA_HOME')
final String compilerJavaProperty = System.getProperty('compiler.java')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class PrecommitTasks {
project.tasks.create('licenseHeaders', LicenseHeadersTask.class),
project.tasks.create('filepermissions', FilePermissionsTask.class),
configureJarHell(project),
configureThirdPartyAudit(project)
configureThirdPartyAudit(project),
configureTestingConventions(project)
]

// tasks with just tests don't need dependency licenses, so this flag makes adding
Expand Down Expand Up @@ -89,6 +90,10 @@ class PrecommitTasks {
])
}

static Task configureTestingConventions(Project project) {
project.getTasks().create("testingConventions", TestingConventionsTasks.class)
}

private static Task configureJarHell(Project project) {
Task task = project.tasks.create('jarHell', JarHellTask.class)
task.classpath = project.sourceSets.test.runtimeClasspath
Expand Down Expand Up @@ -212,7 +217,7 @@ class PrecommitTasks {
private static Task configureNamingConventions(Project project) {
if (project.sourceSets.findByName("test")) {
Task namingConventionsTask = project.tasks.create('namingConventions', NamingConventionsTask)
namingConventionsTask.javaHome = project.runtimeJavaHome
namingConventionsTask.javaHome = project.compilerJavaHome
return namingConventionsTask
}
return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
public class GradleServicesAdapter {

public final Project project;
private final Project project;

public GradleServicesAdapter(Project project) {
this.project = project;
Expand Down
14 changes: 10 additions & 4 deletions buildSrc/src/main/java/org/elasticsearch/gradle/Distribution.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,23 @@

public enum Distribution {

INTEG_TEST("integ-test"),
ZIP("elasticsearch"),
ZIP_OSS("elasticsearch-oss");
INTEG_TEST("integ-test", "zip"),
ZIP("elasticsearch", "zip"),
ZIP_OSS("elasticsearch-oss", "zip");

private final String fileName;
private final String fileExtension;

Distribution(String name) {
Distribution(String name, String fileExtension) {
this.fileName = name;
this.fileExtension = fileExtension;
}

public String getFileName() {
return fileName;
}

public String getFileExtension() {
return fileExtension;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@
import java.util.stream.Collectors;

import org.apache.tools.ant.taskdefs.condition.Os;
import org.elasticsearch.gradle.tool.Boilerplate;
import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.FileTree;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.SourceSetContainer;
import org.gradle.api.tasks.StopExecutionException;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable;
Expand Down Expand Up @@ -81,8 +80,7 @@ private static boolean isExecutableFile(File file) {
@InputFiles
@SkipWhenEmpty
public FileCollection getFiles() {
SourceSetContainer sourceSets = getProject().getConvention().getPlugin(JavaPluginConvention.class).getSourceSets();
return sourceSets.stream()
return Boilerplate.getJavaSourceSets(getProject()).stream()
.map(sourceSet -> sourceSet.getAllSource().matching(filesFilter))
.reduce(FileTree::plus)
.orElse(getProject().files().getAsFileTree());
Expand Down
Loading

0 comments on commit dfc5dd4

Please sign in to comment.