Skip to content

Commit a493af6

Browse files
cirrasfourls
authored andcommitted
Silence noisy warnings around library path properties
1 parent 4c9892c commit a493af6

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

delphi-frontend/src/main/java/au/com/integradev/delphi/msbuild/DelphiProjectParser.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ private List<Path> createSearchDirectories(Path dprojDirectory, ProjectPropertie
9898

9999
allPaths.add(dprojDirectory);
100100
allPaths.addAll(createPathList(properties, "DCC_UnitSearchPath"));
101-
allPaths.addAll(createPathList(properties, "DelphiLibraryPath"));
102-
allPaths.addAll(createPathList(properties, "DelphiTranslatedLibraryPath"));
101+
allPaths.addAll(createPathList(properties, "DelphiLibraryPath", false));
102+
allPaths.addAll(createPathList(properties, "DelphiTranslatedLibraryPath", false));
103103

104104
return Collections.unmodifiableList(allPaths);
105105
}
@@ -109,16 +109,21 @@ private List<Path> createDebugSourceDirectories(ProjectProperties properties) {
109109
}
110110

111111
private List<Path> createPathList(ProjectProperties properties, String propertyName) {
112+
return createPathList(properties, propertyName, true);
113+
}
114+
115+
private List<Path> createPathList(
116+
ProjectProperties properties, String propertyName, boolean emitWarnings) {
112117
List<Path> result = new ArrayList<>();
113118
propertyList(properties.get(propertyName))
114119
.forEach(
115120
pathString -> {
116121
Path path = resolveDirectory(pathString);
117-
if (path == null) {
122+
if (path != null) {
123+
result.add(path);
124+
} else if (emitWarnings) {
118125
LOG.warn("Invalid {} directory: {}", propertyName, pathString);
119-
return;
120126
}
121-
result.add(path);
122127
});
123128
return Collections.unmodifiableList(result);
124129
}

0 commit comments

Comments
 (0)