Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit d176e2d

Browse files
committed
Fix Devtools exclusion with Gradle
Previous implementation was removing transitive dependencies, breaking the build. Closes gh-1579
1 parent be4bb46 commit d176e2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-aot-gradle-plugin/src/main/java/org/springframework/aot/gradle/SpringAotGradlePlugin.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private SourceSet createAotMainSourceSet(SourceSetContainer sourceSets, Configur
223223
File aotResourcesDirectory = generatedFilesPath.resolve("resources").resolve(AOT_MAIN_SOURCE_SET_NAME).toFile();
224224
SourceSet aotMainSourceSet = sourceSets.create(AOT_MAIN_SOURCE_SET_NAME);
225225
FileCollection aotCompileClasspath = sourceSets.findByName(SourceSet.MAIN_SOURCE_SET_NAME).getRuntimeClasspath()
226-
.minus(configurations.getByName(SpringBootPlugin.DEVELOPMENT_ONLY_CONFIGURATION_NAME));
226+
.filter(f -> !f.getName().startsWith("spring-boot-devtools"));
227227
aotMainSourceSet.setCompileClasspath(aotCompileClasspath);
228228
aotMainSourceSet.getJava().setSrcDirs(Collections.singletonList(aotSourcesDirectory));
229229
aotMainSourceSet.getResources().setSrcDirs(Collections.singletonList(aotResourcesDirectory));
@@ -275,7 +275,7 @@ private SourceSet createAotTestSourceSet(SourceSetContainer sourceSets, Configur
275275
File aotTestResourcesDirectory = generatedFilesPath.resolve("resources").resolve(AOT_TEST_SOURCE_SET_NAME).toFile();
276276
SourceSet aotTestSourceSet = sourceSets.create(AOT_TEST_SOURCE_SET_NAME);
277277
FileCollection aotTestCompileClasspath = sourceSets.findByName(SourceSet.TEST_SOURCE_SET_NAME).getRuntimeClasspath()
278-
.minus(configurations.getByName(SpringBootPlugin.DEVELOPMENT_ONLY_CONFIGURATION_NAME));
278+
.filter(f -> !f.getName().startsWith("spring-boot-devtools"));
279279
aotTestSourceSet.setCompileClasspath(aotTestCompileClasspath);
280280
aotTestSourceSet.getJava().setSrcDirs(Collections.singletonList(aotTestSourcesDirectory));
281281
aotTestSourceSet.getResources().setSrcDirs(Collections.singletonList(aotTestResourcesDirectory));

0 commit comments

Comments
 (0)