mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Set ignore_optional_problems on all proto-generated source
Closes gh-51604
This commit is contained in:
@@ -29,6 +29,7 @@ import org.gradle.plugins.ide.eclipse.model.EclipseClasspath;
|
||||
import org.gradle.plugins.ide.eclipse.model.EclipseJdt;
|
||||
import org.gradle.plugins.ide.eclipse.model.EclipseModel;
|
||||
import org.gradle.plugins.ide.eclipse.model.Library;
|
||||
import org.gradle.plugins.ide.eclipse.model.SourceFolder;
|
||||
|
||||
/**
|
||||
* Conventions that are applied in the presence of the {@link EclipsePlugin} to work
|
||||
@@ -95,6 +96,7 @@ class EclipseConventions {
|
||||
merger.whenMerged((content) -> {
|
||||
if (content instanceof Classpath classpath) {
|
||||
classpath.getEntries().removeIf(this::isKotlinPluginContributedBuildDirectory);
|
||||
classpath.getEntries().forEach(this::ignoreOptionalProblemsInProtoGeneratedSources);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -121,4 +123,10 @@ class EclipseConventions {
|
||||
return (value instanceof String string && Boolean.parseBoolean(string));
|
||||
}
|
||||
|
||||
private void ignoreOptionalProblemsInProtoGeneratedSources(ClasspathEntry entry) {
|
||||
if (entry instanceof SourceFolder source && source.getPath().startsWith("build/generated/sources/proto/")) {
|
||||
source.getEntryAttributes().put("ignore_optional_problems", true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user