From 8c74d998fa7589a3f9977f0a0d226ac29160dfa1 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 31 Aug 2018 11:34:39 +0300 Subject: [PATCH 1/2] Work around to be able to generate eclipse projects https://github.com/gradle/gradle/issues/6582 --- build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build.gradle b/build.gradle index 36d3a543d89b6..1cbca5ce89fe9 100644 --- a/build.gradle +++ b/build.gradle @@ -512,6 +512,16 @@ allprojects { tasks.cleanEclipse.dependsOn(wipeEclipseSettings) // otherwise the eclipse merging is *super confusing* tasks.eclipse.dependsOn(cleanEclipse, copyEclipseSettings) + + // work arround https://github.com/gradle/gradle/issues/6582 + tasks.eclipseProject.mustRunAfter tasks.cleanEclipseProject + if (tasks.findByName('eclipseClasspath') != null) { + tasks.eclipseClasspath.mustRunAfter tasks.cleanEclipseClasspath + } + if (tasks.findByName('eclipseJdt') != null) { + tasks.eclipseJdt.mustRunAfter tasks.cleanEclipseJdt + } + tasks.copyEclipseSettings.mustRunAfter tasks.wipeEclipseSettings } allprojects { From b481d7f87ec9e8e9c581b0b93aab35a602c1a726 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 31 Aug 2018 13:11:13 +0300 Subject: [PATCH 2/2] Correct workaround --- build.gradle | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 1cbca5ce89fe9..f8282ca5ae89e 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,9 @@ * specific language governing permissions and limitations * under the License. */ + import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin +import org.apache.tools.ant.taskdefs.condition.Os import org.elasticsearch.gradle.BuildPlugin import org.elasticsearch.gradle.LoggedExec import org.elasticsearch.gradle.Version @@ -24,14 +26,9 @@ import org.elasticsearch.gradle.VersionCollection import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.plugin.PluginBuildPlugin import org.gradle.plugins.ide.eclipse.model.SourceFolder -import org.gradle.util.GradleVersion -import org.gradle.util.DistributionLocator -import org.apache.tools.ant.taskdefs.condition.Os -import org.apache.tools.ant.filters.ReplaceTokens import java.nio.file.Files import java.nio.file.Path -import java.security.MessageDigest plugins { id 'com.gradle.build-scan' version '1.13.2' @@ -515,11 +512,11 @@ allprojects { // work arround https://github.com/gradle/gradle/issues/6582 tasks.eclipseProject.mustRunAfter tasks.cleanEclipseProject - if (tasks.findByName('eclipseClasspath') != null) { - tasks.eclipseClasspath.mustRunAfter tasks.cleanEclipseClasspath + tasks.matching { it.name == 'eclipseClasspath' }.all { + it.mustRunAfter { tasks.cleanEclipseClasspath } } - if (tasks.findByName('eclipseJdt') != null) { - tasks.eclipseJdt.mustRunAfter tasks.cleanEclipseJdt + tasks.matching { it.name == 'eclipseJdt' }.all { + it.mustRunAfter { tasks.cleanEclipseJdt } } tasks.copyEclipseSettings.mustRunAfter tasks.wipeEclipseSettings }