Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Common/Models/BuildDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)] {
Expand Down
1 change: 1 addition & 0 deletions Loop/Managers/LoopAppManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
"",
Expand Down
14 changes: 14 additions & 0 deletions Scripts/capture-build-details.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ then
popd . > /dev/null
fi

# --- Customizations ---
# Each customization adds an empty <identifier>.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 "")
Expand Down