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
1 change: 1 addition & 0 deletions wework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"tauri": "tauri",
"build": "tsc -b && vite build",
"build:mac": "bash scripts/build-mac-app.sh",
"build:mac:devtools": "WEWORK_RELEASE_DEVTOOLS=1 bash scripts/build-mac-app.sh",
"ios:init": "tauri ios init",
"dev:ios": "bash scripts/dev-ios-app.sh",
"build:ios": "bash scripts/build-ios-app.sh",
Expand Down
12 changes: 12 additions & 0 deletions wework/scripts/build-mac-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ BUILD_PROFILE="${WEWORK_BUILD_PROFILE:-release}"
MACOS_BUILD_TARGET="${MACOS_BUILD_TARGET:-}"
TAURI_BUNDLES="${WEWORK_TAURI_BUNDLES:-}"
NO_SIGN="${WEWORK_NO_SIGN:-}"
RELEASE_DEVTOOLS="${WEWORK_RELEASE_DEVTOOLS:-}"

usage() {
cat <<'EOF'
Expand All @@ -25,6 +26,7 @@ Options:
--profile <dev|release> Build profile. Default: release.
--target <target> macOS Rust/Tauri target, e.g. aarch64-apple-darwin.
--bundles <bundles> Tauri bundles to package, e.g. app or app,dmg.
--devtools Enable Web Inspector support in release builds.
--sign Allow signing in dev profile.
--no-sign Skip code signing.
-h, --help Show this help message.
Expand All @@ -33,11 +35,13 @@ Environment:
WEWORK_BUILD_PROFILE Default profile when --profile is not provided.
MACOS_BUILD_TARGET Default macOS Rust/Tauri target.
WEWORK_TAURI_BUNDLES Default bundle list when --bundles is not provided.
WEWORK_RELEASE_DEVTOOLS Set to 1 to compile Tauri devtools into release builds.
WEWORK_NO_SIGN Set to 1 to pass --no-sign.

Examples:
bash wework/scripts/build-mac-app.sh --profile dev --target aarch64-apple-darwin
bash wework/scripts/build-mac-app.sh --target aarch64-apple-darwin
WEWORK_RELEASE_DEVTOOLS=1 bash wework/scripts/build-mac-app.sh --target aarch64-apple-darwin
EOF
}

Expand Down Expand Up @@ -89,6 +93,10 @@ while [ "$#" -gt 0 ]; do
TAURI_BUNDLES="${1#*=}"
shift
;;
--devtools)
RELEASE_DEVTOOLS="1"
shift
;;
--sign)
NO_SIGN="0"
shift
Expand Down Expand Up @@ -132,6 +140,7 @@ echo " PROFILE=$BUILD_PROFILE"
echo " BACKEND_PORT=$BACKEND_PORT"
echo " MACOS_BUILD_TARGET=${MACOS_BUILD_TARGET:-<native>}"
echo " TAURI_BUNDLES=${TAURI_BUNDLES:-<default>}"
echo " RELEASE_DEVTOOLS=${RELEASE_DEVTOOLS:-0}"
echo " NO_SIGN=${NO_SIGN:-0}"
echo " VITE_API_BASE_URL=$VITE_API_BASE_URL"
echo " VITE_SOCKET_BASE_URL=$VITE_SOCKET_BASE_URL"
Expand All @@ -146,6 +155,9 @@ TAURI_ARGS=(build)
if [ "$BUILD_PROFILE" = "dev" ]; then
TAURI_ARGS+=(--debug)
fi
if [ "$RELEASE_DEVTOOLS" = "1" ]; then
TAURI_ARGS+=(--features release-devtools)
fi
if [ -n "$MACOS_BUILD_TARGET" ]; then
TAURI_ARGS+=(--target "$MACOS_BUILD_TARGET")
fi
Expand Down
3 changes: 3 additions & 0 deletions wework/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ rust-version = "1.77.2"
name = "app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]

[features]
release-devtools = ["tauri/devtools"]

[build-dependencies]
tauri-build = { version = "2.6.2", features = [] }

Expand Down
Loading
Loading