From c1afbafa9a2a34a60deb3735e0b2dc8df98419f0 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Tue, 13 Oct 2026 20:10:44 -0500 Subject: [PATCH] Record build customizations in BuildDetails.plist Customizations declare themselves with an empty .loopcustomization file at the workspace root or a submodule root. The build-details script collects the identifiers into com-loopkit-Loop-customizations, and the diagnostic report lists them. --- Common/Models/BuildDetails.swift | 4 ++++ Loop/Managers/LoopAppManager.swift | 1 + Scripts/capture-build-details.sh | 14 ++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/Common/Models/BuildDetails.swift b/Common/Models/BuildDetails.swift index b71e265885..aed7cf9c4b 100644 --- a/Common/Models/BuildDetails.swift +++ b/Common/Models/BuildDetails.swift @@ -66,6 +66,10 @@ class BuildDetails { return dict["com-loopkit-LoopWorkspace-git-branch"] as? String } + var customizations: [String] { + return dict["com-loopkit-Loop-customizations"] as? [String] ?? [] + } + /// Returns a dictionary of submodule details. /// The keys are the submodule names, and the values are tuples (branch, commitSHA). var submodules: [String: (branch: String, commitSHA: String)] { diff --git a/Loop/Managers/LoopAppManager.swift b/Loop/Managers/LoopAppManager.swift index a4bb304c25..afd5380565 100644 --- a/Loop/Managers/LoopAppManager.swift +++ b/Loop/Managers/LoopAppManager.swift @@ -1082,6 +1082,7 @@ extension LoopAppManager: DiagnosticReportGenerator { "* xcodeVersion: \(BuildDetails.default.xcodeVersion ?? "N/A")", "* Workspace branch: \(BuildDetails.default.workspaceGitBranch ?? "N/A")", "* Workspace SHA: \(BuildDetails.default.workspaceGitRevision ?? "N/A")", + "* Customizations: \(BuildDetails.default.customizations.isEmpty ? "None" : BuildDetails.default.customizations.joined(separator: ", "))", "* Submodule name: branch, SHA", "\(submodulesInfo)", "", diff --git a/Scripts/capture-build-details.sh b/Scripts/capture-build-details.sh index 2393e5afa4..56303a7461 100755 --- a/Scripts/capture-build-details.sh +++ b/Scripts/capture-build-details.sh @@ -101,6 +101,20 @@ then popd . > /dev/null fi +# --- Customizations --- +# Each customization adds an empty .loopcustomization file at the workspace root or a submodule root. +customizations_key="com-loopkit-Loop-customizations" +/usr/libexec/PlistBuddy -c "Delete :${customizations_key}" "${info_plist_path}" 2>/dev/null || true +/usr/libexec/PlistBuddy -c "Add :${customizations_key} array" "${info_plist_path}" +if [ -e ../.git ]; then + customizations_root=.. +else + customizations_root=. +fi +find "${customizations_root}" -maxdepth 2 -name '*.loopcustomization' -exec basename {} .loopcustomization \; | sort -u | while read -r identifier; do + /usr/libexec/PlistBuddy -c "Add :${customizations_key}: string ${identifier}" "${info_plist_path}" +done + # --- Root repo details --- # Retrieve current branch (or tag) and commit SHA. git_branch=$(git symbolic-ref --short -q HEAD || echo "")