Skip to content

Commit 1cb96f4

Browse files
committed
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
1 parent 397fd24 commit 1cb96f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gradle/ide.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ eclipse.jdt {
1313
// Replace classpath entries with project dependencies (GRADLE-1116)
1414
// http://issues.gradle.org/browse/GRADLE-1116
1515
eclipse.classpath.file.whenMerged { classpath ->
16-
def regexp = /.*?\/([^\/]+)\/build\/[^\/]+\/(?:main|test)/ // only match those that end in main or test (avoids removing necessary entries like build/classes/jaxb)
16+
def regexp = /.*?\/([^\/]+)\/build\/([^\/]+\/)+(?:main|test)/ // only match those that end in main or test (avoids removing necessary entries like build/classes/jaxb)
1717
def projectOutputDependencies = classpath.entries.findAll { entry -> entry.path =~ regexp }
1818
projectOutputDependencies.each { entry ->
1919
def matcher = (entry.path =~ regexp)
2020
if (matcher) {
2121
def projectName = matcher[0][1]
2222
def path = "/${projectName}"
2323
if(!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) {
24-
def dependency = new ProjectDependency(path, project(":${projectName}").path)
24+
def dependency = new ProjectDependency(path)
2525
dependency.exported = true
2626
classpath.entries.add(dependency)
2727
}

0 commit comments

Comments
 (0)