first pass of merging in warp (doesn't build)
This commit is contained in:
+36
-11
@@ -21,11 +21,19 @@ cd "${REPO_ROOT}"
|
||||
: "${WARP_CHANNEL:?WARP_CHANNEL must be set (invoke via ./script/run)}"
|
||||
: "${FEATURES:?FEATURES must be set (invoke via ./script/run)}"
|
||||
|
||||
# Resolve Cargo's actual target directory rather than assuming ./target. This
|
||||
# honors a shared CARGO_TARGET_DIR / build.target-dir (e.g. set in
|
||||
# ~/.cargo/config.toml), which is where `cargo bundle` writes the .app bundle.
|
||||
TARGET_DIR="$(cargo metadata --no-deps --format-version 1 | jq -r .target_directory)"
|
||||
if [ -z "$TARGET_DIR" ] || [ "$TARGET_DIR" = "null" ]; then
|
||||
TARGET_DIR="${REPO_ROOT}/target"
|
||||
fi
|
||||
|
||||
if [ "$WARP_CHANNEL" = "local" ]; then
|
||||
WARP_APP_PATH="target/debug/bundle/osx/Galaxy Local.app"
|
||||
WARP_APP_PATH="${TARGET_DIR}/debug/bundle/osx/Galaxy Local.app"
|
||||
WARP_SCHEME_NAME="galaxylocal"
|
||||
else
|
||||
WARP_APP_PATH="target/debug/bundle/osx/Galaxy.app"
|
||||
WARP_APP_PATH="${TARGET_DIR}/debug/bundle/osx/Galaxy.app"
|
||||
WARP_SCHEME_NAME="galaxyoss"
|
||||
fi
|
||||
DONT_OPEN=false
|
||||
@@ -58,11 +66,11 @@ while (( "$#" )); do
|
||||
shift
|
||||
;;
|
||||
--release)
|
||||
echo "Detected release build, pointing at release bundle under target/release/bundle"
|
||||
echo "Detected release build, pointing at release bundle under ${TARGET_DIR}/release/bundle"
|
||||
if [ "$WARP_CHANNEL" = "local" ]; then
|
||||
WARP_APP_PATH="target/release/bundle/osx/Galaxy Local.app"
|
||||
WARP_APP_PATH="${TARGET_DIR}/release/bundle/osx/Galaxy Local.app"
|
||||
else
|
||||
WARP_APP_PATH="target/release/bundle/osx/Galaxy.app"
|
||||
WARP_APP_PATH="${TARGET_DIR}/release/bundle/osx/Galaxy.app"
|
||||
fi
|
||||
PARAMS="$PARAMS $1"
|
||||
shift
|
||||
@@ -71,9 +79,9 @@ while (( "$#" )); do
|
||||
PROFILE="$2"
|
||||
shift 2
|
||||
if [ "$WARP_CHANNEL" = "local" ]; then
|
||||
WARP_APP_PATH="target/${PROFILE}/bundle/osx/Galaxy Local.app"
|
||||
WARP_APP_PATH="${TARGET_DIR}/${PROFILE}/bundle/osx/Galaxy Local.app"
|
||||
else
|
||||
WARP_APP_PATH="target/${PROFILE}/bundle/osx/Galaxy.app"
|
||||
WARP_APP_PATH="${TARGET_DIR}/${PROFILE}/bundle/osx/Galaxy.app"
|
||||
fi
|
||||
PARAMS="$PARAMS --profile $PROFILE"
|
||||
;;
|
||||
@@ -103,6 +111,7 @@ popd > /dev/null
|
||||
if [[ ",$FEATURES," =~ ",cocoa_sentry," ]]; then
|
||||
echo "Copying Sentry framework into app bundle..."
|
||||
SENTRY_FRAMEWORK="app/frameworks/dev/Sentry-Dynamic-WithARM64e.xcframework/macos-arm64_arm64e_x86_64/Sentry.framework"
|
||||
mkdir -p "$WARP_APP_PATH/Contents/Frameworks"
|
||||
cp -a "$SENTRY_FRAMEWORK" "$WARP_APP_PATH/Contents/Frameworks/"
|
||||
fi
|
||||
echo "Adding rpath to support mac frameworks (e.g. Sentry)"
|
||||
@@ -126,6 +135,14 @@ if [[ ",$FEATURES," =~ ",heap_usage_tracking," ]]; then
|
||||
"${REPO_ROOT}/script/prepare_bundled_pprof" "$HELPERS_DIR"
|
||||
fi
|
||||
|
||||
if [[ ",$FEATURES," =~ ",warp_control_cli," ]]; then
|
||||
WARPCTRL_SCRIPT_PATH="$WARP_APP_PATH/Contents/Resources/bin/warpctrl-$WARP_CHANNEL"
|
||||
echo "Creating warpctrl wrapper script at $WARPCTRL_SCRIPT_PATH..."
|
||||
"${REPO_ROOT}/script/macos/create_warpctrl_wrapper" \
|
||||
"$WARPCTRL_SCRIPT_PATH" \
|
||||
"../../MacOS/$WARP_BIN_NAME"
|
||||
fi
|
||||
|
||||
echo "Codesigning app..."
|
||||
SIGNING_CERT="$(security find-identity -p codesigning -v | grep "Apple Development" | awk '{print $2}' | head -1)"
|
||||
codesign --force --deep --options runtime --sign "${SIGNING_CERT:--}" "$WARP_APP_PATH" --entitlements script/Debug-Entitlements.plist
|
||||
@@ -133,10 +150,18 @@ codesign --force --deep --options runtime --sign "${SIGNING_CERT:--}" "$WARP_APP
|
||||
if [ "$DONT_OPEN" = false ] ; then
|
||||
if [ "$OPEN_WITH_LAUNCHD" = true ]; then
|
||||
echo "Launching with MacOS application launcher"
|
||||
PATH="" /usr/bin/open "./$WARP_APP_PATH"
|
||||
tail -f ~/Library/Logs/warp_local.log
|
||||
PATH="" /usr/bin/open "$WARP_APP_PATH"
|
||||
if [ "$WARP_CHANNEL" = "local" ]; then
|
||||
LOG_FILE=~/Library/Logs/warp_local.log
|
||||
elif [ "$WARP_CHANNEL" = "oss" ]; then
|
||||
LOG_FILE=~/Library/Logs/warp-oss.log
|
||||
else
|
||||
echo "Warning: unrecognized WARP_CHANNEL '$WARP_CHANNEL', defaulting to OSS log path" >&2
|
||||
LOG_FILE=~/Library/Logs/warp-oss.log
|
||||
fi
|
||||
tail -F "$LOG_FILE"
|
||||
else
|
||||
echo "Opening app at ./$WARP_APP_PATH/Contents/MacOS/$WARP_BIN_NAME"
|
||||
"./$WARP_APP_PATH/Contents/MacOS/$WARP_BIN_NAME" "${WARP_ARGS[@]}"
|
||||
echo "Opening app at $WARP_APP_PATH/Contents/MacOS/$WARP_BIN_NAME"
|
||||
"$WARP_APP_PATH/Contents/MacOS/$WARP_BIN_NAME" "${WARP_ARGS[@]}"
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user