Skip to content
Open
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
11 changes: 11 additions & 0 deletions .codex/environments/environment.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY
version = 1
name = "Easel"

[setup]
script = ""

[[actions]]
name = "Run"
icon = "run"
command = "./script/build_and_run.sh"
56 changes: 56 additions & 0 deletions script/build_and_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -euo pipefail

MODE="${1:-run}"
APP_NAME="Easel"
BUNDLE_ID="com.jamesrochabrun.Easel"
PROJECT_NAME="Easel.xcodeproj"
SCHEME="Easel"
CONFIGURATION="Debug"

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
DERIVED_DATA_DIR="$ROOT_DIR/.build/xcode"
APP_BUNDLE="$DERIVED_DATA_DIR/Build/Products/$CONFIGURATION/$APP_NAME.app"
APP_BINARY="$APP_BUNDLE/Contents/MacOS/$APP_NAME"

cd "$ROOT_DIR"

pkill -x "$APP_NAME" >/dev/null 2>&1 || true

xcodebuild \
-project "$PROJECT_NAME" \
-scheme "$SCHEME" \
-configuration "$CONFIGURATION" \
-derivedDataPath "$DERIVED_DATA_DIR" \
-skipPackagePluginValidation \
build

open_app() {
/usr/bin/open -n "$APP_BUNDLE"
}

case "$MODE" in
run)
open_app
;;
--debug|debug)
lldb -b -o run -- "$APP_BINARY"
;;
--logs|logs)
open_app
/usr/bin/log stream --info --style compact --predicate "process == \"$APP_NAME\""
;;
--telemetry|telemetry)
open_app
/usr/bin/log stream --info --style compact --predicate "subsystem == \"$BUNDLE_ID\""
;;
--verify|verify)
open_app
sleep 2
pgrep -x "$APP_NAME" >/dev/null
;;
*)
echo "usage: $0 [run|--debug|--logs|--telemetry|--verify]" >&2
exit 2
;;
esac
Loading