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
9 changes: 7 additions & 2 deletions docs/ios-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ From a Linux checkout, with the Mac `hs-mac-mini` reachable through
`-DDATA_APP`; `ADHOC=1` ad-hoc signs the Debug build so the keychain, which
holds the pairing, works; `release` is an optimised build with
`BP_MEASURE`).
- `scripts/ios-archive.sh check|upload`: a no-signing Release device build to
see that it compiles, or an archive uploaded to TestFlight.
- `scripts/ios-archive.sh version|check|upload`: print the resolved version synced
from the hub (`native/host/Cargo.toml` / release git tags; `MARKETING_VERSION`
or `BACKPLANE_VERSION` overrides), run a no-signing Release device build to
see that it compiles, or archive and upload to TestFlight. `mobile/ios/build.sh`
likewise syncs `MARKETING_VERSION` / `CFBundleShortVersionString` from the hub
version when run in a repo checkout (falling back to `project.pbxproj` when
run standalone without env overrides).

Other `scripts/ios-*.sh` helpers (run, pair, shots, measure) exist; none is
described here.
Expand Down
2 changes: 1 addition & 1 deletion mobile/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ android {
minSdk = 26
targetSdk = 35
versionCode = releaseCode ?: 1
versionName = releaseVersion ?: "0.16.0"
versionName = releaseVersion ?: "0.16.4"
}

val configuredRelease = if (releaseConfigured) signingConfigs.create("configuredRelease") {
Expand Down
4 changes: 2 additions & 2 deletions mobile/ios/Backplane.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
APP_DISPLAY_NAME = Backplane;
URL_SCHEME = backplane-gpui;
CURRENT_PROJECT_VERSION = 1;
MARKETING_VERSION = 0.16.0;
MARKETING_VERSION = 0.16.4;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
Expand All @@ -238,7 +238,7 @@
APP_DISPLAY_NAME = Backplane;
URL_SCHEME = backplane-gpui;
CURRENT_PROJECT_VERSION = 1;
MARKETING_VERSION = 0.16.0;
MARKETING_VERSION = 0.16.4;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
Expand Down
115 changes: 111 additions & 4 deletions mobile/ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# (DEVICE=<id from `xcrun devicectl list devices`>, else the first)
# mobile/ios/build.sh archive a signed App Store archive, uploaded to TestFlight (BUILD_NUMBER=<n>
# sets the build number, default the date and minute)
# MARKETING_VERSION or BACKPLANE_VERSION overrides the app version; otherwise it is synced from the
# hub version (native/host/Cargo.toml / release git tags) when in a repo checkout, or project.pbxproj.
# device and archive read signing.env beside this script (never committed;
# mobile/README.md): TEAM_ID and BUNDLE_ID, and for archive the App Store
# Connect key (ASC_KEY_ID, ASC_ISSUER_ID, ASC_KEY_PATH).
Expand All @@ -17,16 +19,111 @@ MODE=${1:-sim}
export DEVELOPER_DIR=${DEVELOPER_DIR:-/Applications/Xcode.app/Contents/Developer}
CONDS="GPUI_NATIVE DATA_APP"

normalize_version() {
raw=$1
v=${raw#v}
v=${v%%-*}
case "$v" in
''|*[!0-9.]*|.*|*.|*..*) return 1 ;;
esac
old_ifs=$IFS; IFS=.
set -- $v
IFS=$old_ifs
[ $# -eq 2 ] || [ $# -eq 3 ] || return 1
printf '%s\n' "$v"
}

semver_gt() {
lhs=$1 rhs=$2
old_ifs=$IFS; IFS=.
set -- $lhs
a1=${1:-0} a2=${2:-0} a3=${3:-0}
set -- $rhs
b1=${1:-0} b2=${2:-0} b3=${3:-0}
IFS=$old_ifs
for n in a1 a2 a3 b1 b2 b3; do
eval "val=\$$n"
while case "$val" in 0[0-9]*) val=${val#0} ;; *) false ;; esac; do :; done
eval "$n=\$val"
done
[ "$a1" -gt "$b1" ] && return 0
[ "$a1" -lt "$b1" ] && return 1
[ "$a2" -gt "$b2" ] && return 0
[ "$a2" -lt "$b2" ] && return 1
[ "$a3" -gt "$b3" ] && return 0
return 1
}

resolve_marketing_version() {
if [ -n "${MARKETING_VERSION:-}" ]; then
normalize_version "$MARKETING_VERSION" || { echo "invalid MARKETING_VERSION: $MARKETING_VERSION" >&2; return 1; }
return 0
fi
if [ -n "${BACKPLANE_VERSION:-}" ]; then
normalize_version "$BACKPLANE_VERSION" || { echo "invalid BACKPLANE_VERSION: $BACKPLANE_VERSION" >&2; return 1; }
return 0
fi

if [ -f "../../native/host/Cargo.toml" ]; then
head_tags=$(git -C ../.. tag --points-at HEAD 'v[0-9]*' 2>/dev/null || true)
best_stable=""
best_pre=""
for tag in $head_tags; do
case "$tag" in
*-*)
norm=$(normalize_version "$tag" 2>/dev/null) || continue
if [ -z "$best_pre" ] || semver_gt "$norm" "$best_pre"; then best_pre=$norm; fi
;;
*)
norm=$(normalize_version "$tag" 2>/dev/null) || continue
if [ -z "$best_stable" ] || semver_gt "$norm" "$best_stable"; then best_stable=$norm; fi
;;
esac
done
if [ -n "$best_stable" ]; then printf '%s\n' "$best_stable"; return 0; fi
if [ -n "$best_pre" ]; then printf '%s\n' "$best_pre"; return 0; fi

best=""
raw_cargo=$(awk '
/^\[/ { in_pkg = ($0 ~ /^\[package\]([[:space:]]*(#.*)?)?$/) }
in_pkg && /^[[:space:]]*version[[:space:]]*=/ {
sub(/^[^"]*"/, ""); sub(/".*$/, ""); print; exit
}
' "../../native/host/Cargo.toml")
if [ -n "$raw_cargo" ]; then
best=$(normalize_version "$raw_cargo") || { echo "invalid version '$raw_cargo' in native/host/Cargo.toml" >&2; return 1; }
fi
rel_tags=$(git -C ../.. tag -l 'v[0-9]*.[0-9]*.[0-9]*' 2>/dev/null || true)
for tag in $rel_tags; do
case "$tag" in *-*) continue ;; esac
norm=$(normalize_version "$tag" 2>/dev/null) || continue
if [ -z "$best" ] || semver_gt "$norm" "$best"; then best=$norm; fi
done
[ -n "$best" ] && { printf '%s\n' "$best"; return 0; }
fi

pbx_ver=$(sed -n 's/.*MARKETING_VERSION = \([^;]*\);.*/\1/p' Backplane.xcodeproj/project.pbxproj | head -n 1)
normalize_version "$pbx_ver" || { echo "could not determine valid MARKETING_VERSION (pbxproj='$pbx_ver')" >&2; return 1; }
}

signing() {
[ -f signing.env ] || { echo "no signing.env beside $0 (see mobile/README.md)"; exit 1; }
. ./signing.env
: "${TEAM_ID:?signing.env sets TEAM_ID}" "${BUNDLE_ID:=dev.backplane.mobile}"
}

case $MODE in
sim|device|archive) ;;
*) echo "usage: $0 [sim|device|archive]" >&2; exit 2 ;;
esac

ver=$(resolve_marketing_version)

case $MODE in
sim)
xcodebuild -quiet -project Backplane.xcodeproj -scheme Backplane -configuration Debug \
-sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath build/dd SWIFT_ACTIVE_COMPILATION_CONDITIONS="DEBUG $CONDS" build
-sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath build/dd \
MARKETING_VERSION="$ver" SWIFT_ACTIVE_COMPILATION_CONDITIONS="DEBUG $CONDS" build
app=build/dd/Build/Products/Debug-iphonesimulator/Backplane.app
dev=$(xcrun simctl list devices booted | grep -o '[0-9A-F-]\{36\}' | head -1)
if [ -z "$dev" ]; then
Expand All @@ -41,7 +138,7 @@ device)
signing
xcodebuild -quiet -project Backplane.xcodeproj -scheme Backplane -configuration Debug \
-destination 'generic/platform=iOS' -derivedDataPath build/dd -allowProvisioningUpdates \
DEVELOPMENT_TEAM="$TEAM_ID" BASE_BUNDLE_ID="$BUNDLE_ID" build
DEVELOPMENT_TEAM="$TEAM_ID" BASE_BUNDLE_ID="$BUNDLE_ID" MARKETING_VERSION="$ver" build
app=build/dd/Build/Products/Debug-iphoneos/Backplane.app
dev=${DEVICE:-$(xcrun devicectl list devices 2>/dev/null | grep -o '[0-9A-F]\{8\}-[0-9A-F-]\{27\}' | head -1)}
[ -n "$dev" ] || { echo "no iPhone found: connect one (and trust this Mac), or set DEVICE"; exit 1; }
Expand Down Expand Up @@ -75,9 +172,19 @@ archive)
rm -rf build/Backplane.xcarchive
xcodebuild -quiet -project Backplane.xcodeproj -scheme Backplane -configuration Release \
-destination 'generic/platform=iOS' -archivePath build/Backplane.xcarchive -derivedDataPath build/dd \
DEVELOPMENT_TEAM="$TEAM_ID" BASE_BUNDLE_ID="$BUNDLE_ID" CURRENT_PROJECT_VERSION="$n" \
DEVELOPMENT_TEAM="$TEAM_ID" BASE_BUNDLE_ID="$BUNDLE_ID" MARKETING_VERSION="$ver" CURRENT_PROJECT_VERSION="$n" \
SWIFT_ACTIVE_COMPILATION_CONDITIONS="$CONDS" \
"$@" $auth archive
for plist in \
build/Backplane.xcarchive/Products/Applications/Backplane.app/Info.plist \
build/Backplane.xcarchive/Products/Applications/Backplane.app/PlugIns/BackplaneIsland.appex/Info.plist
do
[ -f "$plist" ] || { echo "missing archive Info.plist: $plist" >&2; exit 1; }
got_short=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$plist") || { echo "missing CFBundleShortVersionString in $plist" >&2; exit 1; }
got_build=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$plist") || { echo "missing CFBundleVersion in $plist" >&2; exit 1; }
[ "$got_short" = "$ver" ] || { echo "version mismatch in $plist: got $got_short, want $ver" >&2; exit 1; }
[ "$got_build" = "$n" ] || { echo "build mismatch in $plist: got $got_build, want $n" >&2; exit 1; }
done
cat > build/export.plist <<PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Expand All @@ -92,7 +199,7 @@ PLIST
rm -rf build/export
xcodebuild -exportArchive -archivePath build/Backplane.xcarchive -exportOptionsPlist build/export.plist \
-exportPath build/export $auth
echo "uploaded build $n to App Store Connect (TestFlight)"
echo "uploaded Backplane $ver ($n) to App Store Connect (TestFlight)"
;;
*)
echo "usage: $0 [sim|device|archive]"; exit 2
Expand Down
2 changes: 1 addition & 1 deletion native/gpui/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion native/gpui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "backplane-gpui"
version = "0.16.0"
version = "0.16.4"
edition = "2024"
publish = false
default-run = "backplane-gpui"
Expand Down
2 changes: 1 addition & 1 deletion native/guard/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion native/guard/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "backplane-guard"
version = "0.16.0"
version = "0.16.4"
edition = "2021"
publish = false
description = "`backplane`: keeps a Backplane hub running and restarts it on Windows, Linux and macOS. Shares no code with the hub, so a broken hub build cannot break its own recovery."
Expand Down
2 changes: 1 addition & 1 deletion native/guard/src/scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fn walk_rs(d: &Path, out: &mut Vec<PathBuf>) {
for d in ["native/host/src", "native/guard/src", "native/gpui/src"] { walk_rs(&r.join(d), &mut files) }
assert!(files.len() > 200, "walk found {} .rs files", files.len());
// production code that makes its own temp folder, each with a drop guard (proc.rs: a KiCad probe's throwaway KICAD_CONFIG_HOME)
let allowed_prod_join = ["native/host/src/agents/locks.rs", "native/host/src/kicad/embed.rs", "native/host/src/mcpx/health.rs", "native/host/src/proc.rs"];
let allowed_prod_join = ["native/host/src/agents/locks.rs", "native/host/src/kicad/embed.rs", "native/host/src/kicad/ipc.rs", "native/host/src/mcpx/health.rs", "native/host/src/proc.rs"];
let mut bad = vec![];
for f in files {
let rel = f.strip_prefix(&r).unwrap().to_string_lossy().replace('\\', "/");
Expand Down
2 changes: 1 addition & 1 deletion native/host/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion native/host/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "backplane-hub"
version = "0.16.0"
version = "0.16.4"
edition = "2021"
publish = false
description = "Backplane hub in Rust. Native clients only (GPUI desktop, iOS, Android); renderer mobile; no helper process, no JS, no ."
Expand Down
Loading
Loading