mirror of
https://gitee.com/dcren/initializr.git
synced 2025-07-16 16:50:42 +08:00
Make compileOnly configuration customization Gradle 4+ specific
Closes gh-848
This commit is contained in:
parent
8aabfc10d5
commit
db2c867f71
@ -37,12 +37,6 @@ public class GradleConfigurationBuildCustomizer implements BuildCustomizer<Gradl
|
||||
if (providedRuntimeUsed && !war) {
|
||||
build.addConfiguration("providedRuntime");
|
||||
}
|
||||
boolean annotationProcessorUsed = build.dependencies().items()
|
||||
.anyMatch((dependency) -> dependency.getScope() == DependencyScope.ANNOTATION_PROCESSOR);
|
||||
if (annotationProcessorUsed) {
|
||||
build.customizeConfiguration("compileOnly",
|
||||
(configuration) -> configuration.extendsFrom("annotationProcessor"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -259,6 +259,11 @@ public class GradleProjectGenerationConfiguration {
|
||||
return (build) -> build.customizeTasksWithType("Test", (test) -> test.invoke("useJUnitPlatform"));
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GradleAnnotationProcessorScopeBuildCustomizer gradleAnnotationProcessorScopeBuildCustomizer() {
|
||||
return new GradleAnnotationProcessorScopeBuildCustomizer();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user