diff --git a/distribution/build.gradle b/distribution/build.gradle index b565e44279c..3463487caea 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -40,6 +40,8 @@ buildscript { } } +Collection distributions = project.subprojects.findAll { it.path.contains(':tools') == false } + /***************************************************************************** * Notice file * *****************************************************************************/ @@ -84,7 +86,7 @@ project.rootProject.subprojects.findAll { it.path.startsWith(':modules:') }.each // the finalizer task follow the original task immediately. To work around this, // we make the mustRunAfter the finalizer task itself. // See https://discuss.gradle.org/t/cross-project-task-dependencies-ordering-screws-up-finalizers/13190 - project.configure(project.subprojects.findAll { it.name != 'integ-test-zip' }) { Project distribution -> + project.configure(distributions.findAll { it.name != 'integ-test-zip' }) { Project distribution -> distribution.afterEvaluate({ // some integTest tasks will have multiple finalizers distribution.integTest.mustRunAfter module.tasks.find { t -> t.name.matches(".*integTest\$") }.getFinalizedBy() @@ -118,7 +120,7 @@ task clean(type: Delete) { delete 'build' } -subprojects { +configure(distributions) { /***************************************************************************** * Rest test config * *****************************************************************************/ @@ -162,6 +164,8 @@ subprojects { into 'lib' from project(':core').jar from project(':core').configurations.runtime + // delay add tools using closures, since they have not yet been configured, so no jar task exists yet + from { project(':distribution:tools:java-version-checker').jar } } modulesFiles = copySpec { @@ -217,7 +221,7 @@ subprojects { /***************************************************************************** * Zip and tgz configuration * *****************************************************************************/ -configure(subprojects.findAll { ['zip', 'tar', 'integ-test-zip'].contains(it.name) }) { +configure(distributions.findAll { ['zip', 'tar', 'integ-test-zip'].contains(it.name) }) { // CopySpec does not make it easy to create an empty director so we create the directory that we want, and then point CopySpec to its // parent to copy to the root of the distribution File plugins = new File(buildDir, 'plugins-hack/plugins') @@ -286,7 +290,7 @@ configure(subprojects.findAll { ['zip', 'tar', 'integ-test-zip'].contains(it.nam * rpm -qlp --dump path/to/elasticsearch.rpm * dpkg -c path/to/elasticsearch.deb */ -configure(subprojects.findAll { ['deb', 'rpm'].contains(it.name) }) { +configure(distributions.findAll { ['deb', 'rpm'].contains(it.name) }) { integTest.enabled = Os.isFamily(Os.FAMILY_WINDOWS) == false File packagingFiles = new File(buildDir, 'packaging') project.ext.packagingFiles = packagingFiles diff --git a/distribution/tools/java-version-checker/build.gradle b/distribution/tools/java-version-checker/build.gradle new file mode 100644 index 00000000000..e39f89f4b05 --- /dev/null +++ b/distribution/tools/java-version-checker/build.gradle @@ -0,0 +1,28 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.gradle.api.JavaVersion + +apply plugin: 'elasticsearch.build' + +targetCompatibility = JavaVersion.VERSION_1_6 +sourceCompatibility = JavaVersion.VERSION_1_6 + +test.enabled = false +loggerUsageCheck.enabled = false diff --git a/settings.gradle b/settings.gradle index 5b6ff5d67b8..c0996f86a04 100644 --- a/settings.gradle +++ b/settings.gradle @@ -19,6 +19,7 @@ List projects = [ 'distribution:tar', 'distribution:deb', 'distribution:rpm', + 'distribution:tools:java-version-checker', 'test:framework', 'test:fixtures:example-fixture', 'test:fixtures:hdfs-fixture',