Skip to content

Commit 07902d7

Browse files
committed
feat: change build dir and git ignore it
1 parent 7873aa7 commit 07902d7

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,6 @@ test-logs.txt
210210
smoke-logs.txt
211211
extract_links.py.py
212212
extract_links.py
213+
214+
# deploy-qa.sh --bundle output
215+
scripts/build/

scripts/deploy-qa.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ set -euo pipefail
66
# ---------------------------------------------------------------------------
77
if [[ "${1:-}" == "--bundle" ]]; then
88
APP_NAME="DeployQA"
9-
APP_DIR="${APP_NAME}.app"
9+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
10+
BUILD_DIR="${SCRIPT_DIR}/build"
11+
APP_DIR="${BUILD_DIR}/${APP_NAME}.app"
1012
MACOS_DIR="${APP_DIR}/Contents/MacOS"
1113
RESOURCES_DIR="${APP_DIR}/Contents/Resources"
12-
SCRIPT_PATH="$(cd "$(dirname "$0")" && pwd)/$(basename "$0")"
14+
SCRIPT_PATH="${SCRIPT_DIR}/$(basename "$0")"
1315

1416
echo "Building $APP_NAME..."
1517

@@ -21,7 +23,7 @@ if [[ "${1:-}" == "--bundle" ]]; then
2123
chmod +x "$RESOURCES_DIR/deploy-qa.sh"
2224

2325
# 3. Write the SwiftUI code to a temporary file
24-
cat << 'SWIFT_EOF' > DeployApp.swift
26+
cat << 'SWIFT_EOF' > "${BUILD_DIR}/DeployApp.swift"
2527
import SwiftUI
2628
import AppKit
2729
@@ -244,8 +246,8 @@ struct SettingsView: View {
244246
SWIFT_EOF
245247

246248
# 4. Compile the Swift code into the app bundle executable
247-
swiftc DeployApp.swift -parse-as-library -o "$MACOS_DIR/$APP_NAME" || { echo "Compilation failed! Aborting."; rm DeployApp.swift; exit 1; }
248-
rm DeployApp.swift
249+
swiftc "${BUILD_DIR}/DeployApp.swift" -parse-as-library -o "$MACOS_DIR/$APP_NAME" || { echo "Compilation failed! Aborting."; rm "${BUILD_DIR}/DeployApp.swift"; exit 1; }
250+
rm "${BUILD_DIR}/DeployApp.swift"
249251

250252
# 5. Create an Info.plist so macOS recognizes it as a real GUI application
251253
cat << 'PLIST_EOF' > "${APP_DIR}/Contents/Info.plist"
@@ -270,9 +272,9 @@ SWIFT_EOF
270272
PLIST_EOF
271273

272274
# 6. Zip it for distribution
273-
zip -r -q "${APP_NAME}.zip" "${APP_DIR}"
275+
(cd "${BUILD_DIR}" && zip -r -q "${APP_NAME}.zip" "${APP_NAME}.app")
274276

275-
echo "Done! You can now send ${APP_NAME}.zip to the QA team."
277+
echo "Done! You can now send scripts/build/${APP_NAME}.zip to the QA team."
276278
exit 0
277279
fi
278280

0 commit comments

Comments
 (0)