From 1e72fa202cb05083f8f3daa55e55ceb71478131a Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 21 Jan 2020 12:47:29 +0000 Subject: [PATCH] Rework loader-tools resource generation to work with Buildship Previously, the generated resources were added as an output to the main source set. This worked on the command line, but resulted in the META-INF folder that contains the loader jar not being on the classpath of downstream projects in Eclipse. This commit changes loader-tools to add the generated resources as a srcDir to the main source set. This results in it appearing on the classpath of other projects in Eclipse that depend on loader-tools such as the Gradle plugin, thereby allowing its tests to be run in the IDE as well as on the command line. Fixes gh-19841 --- .../spring-boot-tools/spring-boot-loader-tools/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle index 43add46200c..dad2b9da87c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle @@ -30,7 +30,7 @@ dependencies { sourceSets { main { - output.dir(generatedResources, builtBy: 'reproducibleLoaderJar') + resources.srcDirs generatedResources } } @@ -45,6 +45,6 @@ task reproducibleLoaderJar(type: Jar) { destinationDirectory = file("${generatedResources}/META-INF/loader") } -jar { +processResources { dependsOn reproducibleLoaderJar }