Feat: overhaul to produce .dmg and .app on macOS build script
This commit is contained in:
@@ -229,6 +229,14 @@ bundle_plugins_native() {
|
||||
cargo xtask bundle "$PLUGIN_NAME" --release $tf
|
||||
}
|
||||
|
||||
bundle_desktop_native() {
|
||||
local platform="$1"
|
||||
local tf
|
||||
tf=$(target_flag "$platform")
|
||||
# shellcheck disable=SC2086
|
||||
cargo bundle --release --features desktop --bin cagire-desktop $tf
|
||||
}
|
||||
|
||||
bundle_plugins_cross() {
|
||||
local platform="$1"
|
||||
local rd
|
||||
@@ -300,6 +308,18 @@ copy_artifacts() {
|
||||
local dst="$OUT/cagire-desktop-${os}-${arch}${suffix}"
|
||||
cp "$src" "$dst"
|
||||
echo " cagire-desktop -> $dst"
|
||||
|
||||
# macOS .app bundle
|
||||
if [[ "$os" == "macos" ]]; then
|
||||
local app_src="$rd/bundle/osx/Cagire.app"
|
||||
if [[ -d "$app_src" ]]; then
|
||||
local app_dst="$OUT/Cagire-${arch}.app"
|
||||
rm -rf "$app_dst"
|
||||
cp -R "$app_src" "$app_dst"
|
||||
echo " Cagire.app -> $app_dst"
|
||||
scripts/make-dmg.sh "$app_dst" "$OUT"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# AppImage for Linux targets
|
||||
@@ -407,6 +427,10 @@ for platform in "${selected_platforms[@]}"; do
|
||||
if $build_desktop; then
|
||||
echo " -> cagire-desktop"
|
||||
build_binary "$platform" --features desktop --bin cagire-desktop
|
||||
if ! is_cross_target "$platform"; then
|
||||
echo " -> bundling cagire-desktop .app"
|
||||
bundle_desktop_native "$platform"
|
||||
fi
|
||||
fi
|
||||
|
||||
if $build_plugins; then
|
||||
|
||||
Reference in New Issue
Block a user