Switch to using new version of cargo bundle with more capabilities

This commit is contained in:
Mikayla Maki 2023-06-13 18:01:51 -07:00
parent b365e48ff0
commit 8ad7eb7598
No known key found for this signature in database
4 changed files with 35 additions and 12 deletions

View file

@ -142,20 +142,24 @@ workspace = { path = "../workspace", features = ["test-support"] }
unindent.workspace = true unindent.workspace = true
[package.metadata.bundle-dev] [package.metadata.bundle]
icon = ["resources/app-icon-preview@2x.png", "resources/app-icon-preview.png"] icon = ["resources/app-icon-preview@2x.png", "resources/app-icon-preview.png"]
identifier = "dev.zed.Zed-Dev" identifier = "dev.zed.Zed-Dev"
name = "Zed Dev" name = "Zed Dev"
osx_minimum_system_version = "10.15.7" osx_minimum_system_version = "10.15.7"
osx_info_plist_exts = ["resources/info/*"]
[package.metadata.bundle-preview] [package.metadata.bundle-preview]
icon = ["resources/app-icon-preview@2x.png", "resources/app-icon-preview.png"] icon = ["resources/app-icon-preview@2x.png", "resources/app-icon-preview.png"]
identifier = "dev.zed.Zed-Preview" identifier = "dev.zed.Zed-Preview"
name = "Zed Preview" name = "Zed Preview"
osx_minimum_system_version = "10.15.7" osx_minimum_system_version = "10.15.7"
osx_info_plist_exts = ["resources/info/*"]
[package.metadata.bundle-stable] [package.metadata.bundle-stable]
icon = ["resources/app-icon@2x.png", "resources/app-icon.png"] icon = ["resources/app-icon@2x.png", "resources/app-icon.png"]
identifier = "dev.zed.Zed" identifier = "dev.zed.Zed"
name = "Zed" name = "Zed"
osx_minimum_system_version = "10.15.7" osx_minimum_system_version = "10.15.7"
osx_info_plist_exts = ["resources/info/*"]

View file

@ -0,0 +1,24 @@
<key>NSSystemAdministrationUsageDescription</key>
<string>The operation being performed by a program in Zed requires elevated permission.</string>
<key>NSAppleEventsUsageDescription</key>
<string>An application in Zed wants to use AppleScript.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>An application in Zed wants to use Bluetooth.</string>
<key>NSCalendarsUsageDescription</key>
<string>An application in Zed wants to use Calendar data.</string>
<key>NSCameraUsageDescription</key>
<string>An application in Zed wants to use the camera.</string>
<key>NSContactsUsageDescription</key>
<string>An application in Zed wants to use your contacts.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>An application in Zed wants to use your location information, even in the background.</string>
<key>NSLocationUsageDescription</key>
<string>An application in Zed wants to use your location information.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>An application in Zed wants to use your location information while active.</string>
<key>NSMicrophoneUsageDescription</key>
<string>An application in Zed wants to use your microphone.</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>An application in Zed wants to use speech recognition.</string>
<key>NSRemindersUsageDescription</key>
<string>An application in Zed wants to use your reminders.</string>

View file

@ -23,7 +23,11 @@ done
export ZED_BUNDLE=true export ZED_BUNDLE=true
export MACOSX_DEPLOYMENT_TARGET=10.15.7 export MACOSX_DEPLOYMENT_TARGET=10.15.7
which cargo-bundle > /dev/null || cargo install cargo-bundle --version 0.5.0 cargo_bundle_version=$(cargo -q bundle --help 2>&1 | head -n 1 || echo "")
if [ "$cargo_bundle_version" != "cargo-bundle v0.6.0-zed" ]; then
cargo install cargo-bundle --git https://github.com/zed-industries/cargo-bundle.git --branch zed-deploy
fi
rustup target add wasm32-wasi rustup target add wasm32-wasi
# Deal with versions of macOS that don't include libstdc++ headers # Deal with versions of macOS that don't include libstdc++ headers
@ -46,9 +50,7 @@ sed \
-i .backup \ -i .backup \
"s/package.metadata.bundle-${channel}/package.metadata.bundle/" \ "s/package.metadata.bundle-${channel}/package.metadata.bundle/" \
Cargo.toml Cargo.toml
app_path=$(cargo bundle ${build_flag} --target x86_64-apple-darwin | xargs) app_path=$(cargo bundle ${build_flag} --target x86_64-apple-darwin --select-workspace-root | xargs)
echo app_path
mv Cargo.toml.backup Cargo.toml mv Cargo.toml.backup Cargo.toml
popd popd
@ -70,13 +72,6 @@ echo "Copying WebRTC.framework into the frameworks folder"
mkdir "${app_path}/Contents/Frameworks" mkdir "${app_path}/Contents/Frameworks"
cp -R target/x86_64-apple-darwin/${target_dir}/WebRTC.framework "${app_path}/Contents/Frameworks/" cp -R target/x86_64-apple-darwin/${target_dir}/WebRTC.framework "${app_path}/Contents/Frameworks/"
mv "${app_path}/Contents/Info.plist" "${app_path}/Contents/WithoutDocumentTypes.plist"
awk \
"/<\/dict>/{while(getline line<\"./crates/zed/BundleDocumentTypes.plist\"){print line}}1" \
"${app_path}/Contents/WithoutDocumentTypes.plist" \
> "${app_path}/Contents/Info.plist"
rm "${app_path}/Contents/WithoutDocumentTypes.plist"
if [[ -n $MACOS_CERTIFICATE && -n $MACOS_CERTIFICATE_PASSWORD && -n $APPLE_NOTARIZATION_USERNAME && -n $APPLE_NOTARIZATION_PASSWORD ]]; then if [[ -n $MACOS_CERTIFICATE && -n $MACOS_CERTIFICATE_PASSWORD && -n $APPLE_NOTARIZATION_USERNAME && -n $APPLE_NOTARIZATION_PASSWORD ]]; then
echo "Signing bundle with Apple-issued certificate" echo "Signing bundle with Apple-issued certificate"
security create-keychain -p "$MACOS_CERTIFICATE_PASSWORD" zed.keychain || echo "" security create-keychain -p "$MACOS_CERTIFICATE_PASSWORD" zed.keychain || echo ""