Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
make bundle script incremental when using debug or local builds
Mikayla31062d424f38
diff --git a/crates/zed/resources/zed.entitlements b/crates/zed/resources/zed.entitlementsindex f40a8a253ad..dca0ff67663 100644--- a/crates/zed/resources/zed.entitlements+++ b/crates/zed/resources/zed.entitlements@@ -10,14 +10,8 @@<true/><key>com.apple.security.device.camera</key><true/>- <key>com.apple.security.personal-information.addressbook</key>- <true/>- <key>com.apple.security.personal-information.calendars</key>- <true/>- <key>com.apple.security.personal-information.location</key>- <true/>- <key>com.apple.security.personal-information.photos-library</key>- <true/>+ <key>com.apple.security.keychain-access-groups</key>+ <array><string>MQ55VZLNZQ.dev.zed.Shared</string></array><!-- <key>com.apple.security.cs.disable-library-validation</key><true/> --></dict>diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rsindex c491d406aff..9d0451ecfa9 100644--- a/crates/zed/src/main.rs+++ b/crates/zed/src/main.rs@@ -32,12 +32,10 @@ use std::{ffi::OsStr,fs::OpenOptions,io::{IsTerminal, Write as _},- os::unix::prelude::OsStrExt,panic,path::{Path, PathBuf},- str,sync::{- atomic::{AtomicBool, AtomicU32, Ordering},+ atomic::{AtomicU32, Ordering},Arc, Weak,},thread,@@ -45,7 +43,7 @@ use std::{};use sum_tree::Bias;use util::{- channel::{ReleaseChannel, URL_SCHEME_PREFIX},+ channel::ReleaseChannel,http::{self, HttpClient},paths::PathLikeWithPosition,};diff --git a/crates/zed/src/open_url.rs b/crates/zed/src/open_url.rsindex f421633d5b8..1c741a02c89 100644--- a/crates/zed/src/open_url.rs+++ b/crates/zed/src/open_url.rs@@ -9,7 +9,7 @@ use std::{path::PathBuf, sync::atomic::AtomicBool};use util::channel::URL_SCHEME_PREFIX;use util::ResultExt;-use crate::{connect_to_cli, handle_cli_connection};+use crate::connect_to_cli;pub enum OpenRequest {Paths {diff --git a/script/bundle b/script/bundleindex 4882189c225..94741d290fc 100755--- a/script/bundle+++ b/script/bundle@@ -5,6 +5,7 @@ set -ebuild_flag="--release"target_dir="release"open_result=false+local_arch=falselocal_only=falseoverwrite_local_app=falsebundle_name=""@@ -16,8 +17,8 @@ Usage: ${0##*/} [options] [bundle_name]Build the application bundle.Options:- -d Compile in debug mode (doesn't currently work without -l)- -l Compile for local architecture only and copy bundle to /Applications.+ -d Compile in debug mode+ -l Compile for local architecture and copy bundle to /Applications, implies -d.-o Open the resulting DMG or the app itself in local mode.-f Overwrite the local app bundle if it exists.-h Display this help and exit.@@ -32,10 +33,20 @@ docase "${flag}" ino) open_result=true;;d)+ export CARGO_INCREMENTAL=true+ export CARGO_BUNDLE_SKIP_BUILD=truebuild_flag="";+ local_arch=true+ target_dir="debug"+ ;;+ l)+ export CARGO_INCREMENTAL=true+ export CARGO_BUNDLE_SKIP_BUILD=true+ build_flag=""+ local_arch=true+ local_only=truetarget_dir="debug";;- l) local_only=true;;f) overwrite_local_app=true;;h)help_info@@ -67,7 +78,7 @@ version_info=$(rustc --version --verbose)host_line=$(echo "$version_info" | grep host)local_target_triple=${host_line#*: }-if [ "$local_only" = true ]; then+if [ "$local_arch" = true ]; thenecho "Building for local target only."cargo build ${build_flag} --package zedcargo build ${build_flag} --package cli@@ -91,8 +102,8 @@ sed \"s/package.metadata.bundle-${channel}/package.metadata.bundle/" \Cargo.toml-if [ "$local_only" = true ]; then- app_path=$(cargo bundle ${build_flag} --target "$local_target_triple" --select-workspace-root | xargs)+if [ "$local_arch" = true ]; then+ app_path=$(cargo bundle ${build_flag} --select-workspace-root | xargs)elseapp_path=$(cargo bundle ${build_flag} --target x86_64-apple-darwin --select-workspace-root | xargs)fi@@ -101,7 +112,7 @@ mv Cargo.toml.backup Cargo.tomlpopdecho "Bundled ${app_path}"-if [ "$local_only" = false ]; then+if [ "$local_arch" = false ]; thenecho "Creating fat binaries"lipo \-create \@@ -136,7 +147,7 @@ elsecodesign --force --deep --entitlements crates/zed/resources/zed.entitlements --sign - "${app_path}" -vfi-if [ "$target_dir" = "debug" ]; then+if [[ "$target_dir" = "debug" && "$local_only" = false ]]; thenif [ "$open_result" = true ]; thenopen "$app_path"else