From d99c3c1e21b923f9a52fad75dd1e163c8dc553d1 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Fri, 10 Mar 2023 11:56:53 +0100 Subject: [PATCH] Make does not need all properties files --- src/org/argeo/build/Make.java | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/org/argeo/build/Make.java b/src/org/argeo/build/Make.java index b9fd48d..beacf01 100644 --- a/src/org/argeo/build/Make.java +++ b/src/org/argeo/build/Make.java @@ -195,12 +195,14 @@ public class Make { throw new IllegalArgumentException("One and only one --category must be specified"); String category = categories.get(0); + final String branch; Path branchMk = sdkSrcBase.resolve(BRANCH_MK); - if (!Files.exists(branchMk)) - throw new IllegalStateException("No " + branchMk + " file available"); - Map branchVariables = readeMakefileVariables(branchMk); - - String branch = branchVariables.get("BRANCH"); + if (Files.exists(branchMk)) { + Map branchVariables = readeMakefileVariables(branchMk); + branch = branchVariables.get("BRANCH"); + } else { + branch = null; + } long begin = System.currentTimeMillis(); // create jars in parallel @@ -235,15 +237,19 @@ public class Make { properties.load(in); } - Path branchBnd = sdkSrcBase.resolve("sdk/branches/" + branch + ".bnd"); - try (InputStream in = Files.newInputStream(branchBnd)) { - properties.load(in); + if (branch != null) { + Path branchBnd = sdkSrcBase.resolve("sdk/branches/" + branch + ".bnd"); + if (Files.exists(branchBnd)) + try (InputStream in = Files.newInputStream(branchBnd)) { + properties.load(in); + } } Path bndBnd = source.resolve("bnd.bnd"); - try (InputStream in = Files.newInputStream(bndBnd)) { - properties.load(in); - } + if (Files.exists(bndBnd)) + try (InputStream in = Files.newInputStream(bndBnd)) { + properties.load(in); + } // Normalise if (!properties.containsKey("Bundle-SymbolicName")) -- 2.39.2