From e2d98d70dd76b357c72bc0f19332928546103aa4 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Fri, 10 Apr 2026 13:50:31 -0700 Subject: [PATCH] Support "dist" directory layout for szBuildVersion.json during product builds - Add fallback in findBuildVersionFile() to look for szBuildVersion.json directly under SENZING_PATH when the path ends in "dist", supporting the directory structure used during Senzing product builds - Retain existing lookup under {SENZING_PATH}/er/ as a fallback for completed/installed build structures - Use equalsIgnoreCase() for "dist" directory check to match the case-insensitive convention used elsewhere in the file - Add isFile() check on the "dist" path for consistency with the existing "er" path validation - Fix Javadoc typo "THe" to "The" in findBuildVersionFile() --- .../senzing/sdk/core/InstallUtilities.java | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/senzing/sdk/core/InstallUtilities.java b/src/main/java/com/senzing/sdk/core/InstallUtilities.java index 4e9d440..eb9eeec 100644 --- a/src/main/java/com/senzing/sdk/core/InstallUtilities.java +++ b/src/main/java/com/senzing/sdk/core/InstallUtilities.java @@ -497,20 +497,36 @@ static File findSenzingPathFromLib() { /** * Finds the Senzing build version JSON file. * - * @return THe Senzing build version JSON file. + * @return The Senzing build version JSON file. */ static File findBuildVersionFile() { if (SENZING_PATH == null) { return null; } - File erDir = new File(SENZING_PATH, "er"); - if (!erDir.exists() || !erDir.isDirectory()) { - return null; + + // declare the version file + File versionFile = null; + + // check if we might be building the Senzing product + if (SENZING_PATH.getName().equalsIgnoreCase("dist")) { + versionFile = new File(SENZING_PATH, "szBuildVersion.json"); + if (!versionFile.exists() || !versionFile.isFile()) { + versionFile = null; + } } - File versionFile = new File(erDir, "szBuildVersion.json"); - if (!versionFile.exists() || !versionFile.isFile()) { - return null; + + // fall back to a completed build structure if versionFile not found + if (versionFile == null) { + File erDir = new File(SENZING_PATH, "er"); + if (!erDir.exists() || !erDir.isDirectory()) { + return null; + } + versionFile = new File(erDir, "szBuildVersion.json"); + if (!versionFile.exists() || !versionFile.isFile()) { + return null; + } } + try { return versionFile.getCanonicalFile();