fix empty dependencies element producing broken configure script - fixes #336

Fri, 05 Jan 2024 20:53:42 +0100

author
Mike Becker <universe@uap-core.de>
date
Fri, 05 Jan 2024 20:53:42 +0100
changeset 92
5a32534f2604
parent 91
f14d77dd4215
child 93
df47e083139b

fix empty dependencies element producing broken configure script - fixes #336

src/main/java/de/unixwork/uwproj/Target.java file | annotate | diff | comparison | revisions
src/main/java/de/unixwork/uwproj/TargetData.java file | annotate | diff | comparison | revisions
--- a/src/main/java/de/unixwork/uwproj/Target.java	Fri Jan 05 20:36:21 2024 +0100
+++ b/src/main/java/de/unixwork/uwproj/Target.java	Fri Jan 05 20:53:42 2024 +0100
@@ -9,6 +9,7 @@
 import java.util.List;
 
 import static de.unixwork.uwproj.Util.*;
+import static java.util.function.Predicate.not;
 
 public class Target {
     private String name = "";
@@ -45,6 +46,7 @@
                 } else if (n.equals("dependencies")) {
                     Arrays.stream(Util.getContent(elm).split(","))
                             .map(String::trim)
+                            .filter(not(String::isBlank))
                             .forEach(target::addDependency);
                 } else if (n.equals("alldependencies")) {
                     target.setAllDependencies(true);
--- a/src/main/java/de/unixwork/uwproj/TargetData.java	Fri Jan 05 20:36:21 2024 +0100
+++ b/src/main/java/de/unixwork/uwproj/TargetData.java	Fri Jan 05 20:53:42 2024 +0100
@@ -9,6 +9,7 @@
 import java.util.List;
 
 import static de.unixwork.uwproj.Util.shId;
+import static java.util.function.Predicate.not;
 
 public class TargetData {
     private final List<Define> defines = new LinkedList<>();
@@ -32,6 +33,7 @@
                 } else if (n.equals("dependencies")) {
                     Arrays.stream(Util.getContent(elm).split(","))
                             .map(String::trim)
+                            .filter(not(String::isBlank))
                             .forEach(target::addDependency);
                 } else if (n.equals("make")) {
                     target.addMake(Util.getContent(elm));

mercurial