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
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@ Testers should run the bundled app, not `swift run`. Build a release app bundle:
zsh Scripts/build-app.sh release
```

Local bundles default to version `1.0`. Set `ZOOMIT_VERSION` to stamp a
specific dotted-numeric version into both `CFBundleShortVersionString` and
`CFBundleVersion`:

```sh
ZOOMIT_VERSION=1.2.0 zsh Scripts/build-app.sh release
defaults read "$PWD/.build/ZoomIt (Dev).app/Contents/Info" CFBundleShortVersionString
defaults read "$PWD/.build/ZoomIt (Dev).app/Contents/Info" CFBundleVersion
```

The official Azure DevOps build supplies `ZOOMIT_VERSION` from the version
entered when the pipeline is queued. Values must contain two or three numeric
components, such as `1.2` or `1.2.0`; malformed values fail before compilation
or signing begins.
Comment thread
MarioHewardt marked this conversation as resolved.

By default this produces `.build/ZoomIt (Dev).app` with the app icon, bundled resources, and an `Info.plist` declaring the microphone and camera usage descriptions. `release` builds are **Universal** (Apple Silicon + Intel) by default; `debug` builds are native to the build machine for speed. Override the architectures with `ZOOMIT_ARCHS` (e.g. `ZOOMIT_ARCHS=arm64`). A Universal build routes through Xcode's build system, so it requires a **full Xcode** install — with only the Command Line Tools the script warns and falls back to a native build. The build summary prints the resulting architectures.

### Create and install a local development DMG
Expand Down
25 changes: 23 additions & 2 deletions Scripts/build-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ CONFIGURATION="${1:-debug}"
ICON_SOURCE="$ROOT_DIR/Sources/ZoomItMacCore/Resources/ZoomItColorIcon.png"
ENTITLEMENTS="$ROOT_DIR/Scripts/ZoomIt.entitlements"

# Local builds default to 1.0 when ZOOMIT_VERSION is absent. An explicitly
# empty value still fails, which prevents a queued official build from silently
# using the development default. Restrict the value to dotted numeric
# components so it is valid for both macOS bundle version keys and cannot
# inject content into the generated plist.
VERSION="${ZOOMIT_VERSION-1.0}"
VERSION_PATTERN='^[0-9]+\.[0-9]+(\.[0-9]+)?$'
if [[ ! "$VERSION" =~ $VERSION_PATTERN ]]; then
echo "error: ZOOMIT_VERSION must be a dotted numeric version such as 1.0 or 1.0.0 (got '$VERSION')." >&2
exit 2
fi
case "${ZOOMIT_REQUIRE_RELEASE_VERSION:-false}" in
true|True|TRUE|1)
if [[ "$VERSION" == "0.0.0" ]]; then
echo "error: replace the 0.0.0 PR placeholder with the intended release version." >&2
exit 2
fi
;;
esac

# Signing identity controls which "flavor" of the app is produced.
# - Ad-hoc (the default, "-"): a contributor build that cannot reproduce the
# official Developer ID signature. It uses a distinct .dev bundle id so its
Expand Down Expand Up @@ -128,9 +148,9 @@ cat > "$APP_PATH/Contents/Info.plist" <<PLIST
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>$VERSION</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$VERSION</string>
<key>LSMinimumSystemVersion</key>
<string>14.0</string>
<key>LSUIElement</key>
Expand Down Expand Up @@ -170,5 +190,6 @@ fi
echo "$APP_PATH"
echo " bundle id: $BUNDLE_ID" >&2
echo " display name: $DISPLAY_NAME" >&2
echo " version: $VERSION" >&2
echo " signed with: $SIGN_DESC" >&2
echo " architectures: $(lipo -archs "$APP_PATH/Contents/MacOS/ZoomIt" 2>/dev/null || echo unknown)" >&2