From 1cb96f47c87cc15bfda2026dc85c7af95278c081 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 22 Aug 2017 22:16:34 +0100 Subject: [PATCH] Fix Eclipse support in Gradle build The upgrade to Gradle 4.0 broke the custom Eclipse support in the Spring Framework build. This commit includes the following changes which re-enable support for Eclipse in the build. - Switched to ProjectDependency(String) constructor - Updated regular expression that matches against project output dependencies to include more than one subdirectory between "build" and "main"|"test". Issue: SPR-15862 --- gradle/ide.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/ide.gradle b/gradle/ide.gradle index e7844180b1..469733d7a5 100644 --- a/gradle/ide.gradle +++ b/gradle/ide.gradle @@ -13,7 +13,7 @@ eclipse.jdt { // Replace classpath entries with project dependencies (GRADLE-1116) // http://issues.gradle.org/browse/GRADLE-1116 eclipse.classpath.file.whenMerged { classpath -> - def regexp = /.*?\/([^\/]+)\/build\/[^\/]+\/(?:main|test)/ // only match those that end in main or test (avoids removing necessary entries like build/classes/jaxb) + def regexp = /.*?\/([^\/]+)\/build\/([^\/]+\/)+(?:main|test)/ // only match those that end in main or test (avoids removing necessary entries like build/classes/jaxb) def projectOutputDependencies = classpath.entries.findAll { entry -> entry.path =~ regexp } projectOutputDependencies.each { entry -> def matcher = (entry.path =~ regexp) @@ -21,7 +21,7 @@ eclipse.classpath.file.whenMerged { classpath -> def projectName = matcher[0][1] def path = "/${projectName}" if(!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) { - def dependency = new ProjectDependency(path, project(":${projectName}").path) + def dependency = new ProjectDependency(path) dependency.exported = true classpath.entries.add(dependency) }