Skip to content

Commit 160fc6a

Browse files
abueideclaude
andcommitted
refactor: remove build commands, let users call gradle/xcodebuild directly
Removed android.sh build and ios.sh build commands. Users should call gradle/xcodebuild directly with their project-specific requirements. The plugins focus on what they're good at: device/emulator management and deployment. Build configuration is app-specific and better handled by users directly. Changes: - Removed build command handlers from android.sh and ios.sh - Deleted plugins/android/virtenv/scripts/domain/build.sh - Deleted plugins/ios/virtenv/scripts/domain/build.sh - Removed build.sh from plugin.json includes - Updated all test suites to call gradle/xcodebuild directly - Updated usage/help text with note about direct build commands Test suite changes: - Android: ./gradlew assembleDebug -PreactNativeDevServerPort=$METRO_PORT - iOS: xcodebuild -workspace ... -scheme ... -configuration ... build Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 8fa9949 commit 160fc6a

11 files changed

Lines changed: 32 additions & 489 deletions

File tree

examples/android/tests/test-suite.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ is_strict: true
1212
processes:
1313
# Phase 1: Build - runs first (no dependency)
1414
build-app:
15-
command: "android.sh build"
15+
command: "./gradlew assembleDebug"
1616
availability:
1717
restart: "no"
1818

examples/ios/tests/test-suite.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ is_strict: true
1111
processes:
1212
# Phase 1: Build app - runs first
1313
build-app:
14-
command: "ios.sh build"
14+
command: |
15+
xcodebuild -project ios.xcodeproj -scheme ios \
16+
-configuration Debug \
17+
-destination "generic/platform=iOS Simulator" \
18+
build
1519
availability:
1620
restart: "no"
1721

examples/react-native/tests/test-suite-all-e2e.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ processes:
2727
2828
BUILD_CONFIG="${ANDROID_BUILD_CONFIG:-Debug}"
2929
echo "Building Android app (${BUILD_CONFIG})..."
30-
android.sh build --config "$BUILD_CONFIG" -- -PreactNativeDevServerPort="$METRO_PORT"
30+
cd android
31+
./gradlew assemble${BUILD_CONFIG} -PreactNativeDevServerPort="$METRO_PORT"
3132
echo 'Build complete'
3233
depends_on:
3334
build-node:
@@ -214,9 +215,15 @@ processes:
214215
. ${REACT_NATIVE_VIRTENV}/metro/env-all.sh
215216
echo "Metro port: $METRO_PORT"
216217
217-
# Build with ios.sh build
218+
# Build with xcodebuild
219+
cd ios
218220
NODE_BINARY="$NODE_BINARY" RCT_METRO_PORT="$METRO_PORT" \
219-
ios.sh build --config "$BUILD_CONFIG" --quiet
221+
xcodebuild -workspace ReactNativeExample.xcworkspace \
222+
-scheme ReactNativeExample \
223+
-configuration "$BUILD_CONFIG" \
224+
-destination "generic/platform=iOS Simulator" \
225+
-quiet \
226+
build
220227
221228
echo "Build complete"
222229
depends_on:

examples/react-native/tests/test-suite-android-e2e.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ processes:
2626
2727
BUILD_CONFIG="${ANDROID_BUILD_CONFIG:-Debug}"
2828
echo "Building Android app (${BUILD_CONFIG})..."
29-
android.sh build --config "$BUILD_CONFIG" -- -PreactNativeDevServerPort="$METRO_PORT"
29+
cd android
30+
./gradlew assemble${BUILD_CONFIG} -PreactNativeDevServerPort="$METRO_PORT"
3031
echo 'Build complete'
3132
depends_on:
3233
build-node:

examples/react-native/tests/test-suite-ios-e2e.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,15 @@ processes:
126126
. ${REACT_NATIVE_VIRTENV}/metro/env-ios.sh
127127
echo "Metro port: $METRO_PORT"
128128
129-
# Build with ios.sh build
129+
# Build with xcodebuild
130+
cd ios
130131
NODE_BINARY="$NODE_BINARY" RCT_METRO_PORT="$METRO_PORT" \
131-
ios.sh build --config "$BUILD_CONFIG" --quiet
132+
xcodebuild -workspace ReactNativeExample.xcworkspace \
133+
-scheme ReactNativeExample \
134+
-configuration "$BUILD_CONFIG" \
135+
-destination "generic/platform=iOS Simulator" \
136+
-quiet \
137+
build
132138
133139
echo "Build complete"
134140
depends_on:

plugins/android/plugin.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"{{ .Virtenv }}/scripts/domain/avd.sh": "virtenv/scripts/domain/avd.sh",
4848
"{{ .Virtenv }}/scripts/domain/avd-reset.sh": "virtenv/scripts/domain/avd-reset.sh",
4949
"{{ .Virtenv }}/scripts/domain/emulator.sh": "virtenv/scripts/domain/emulator.sh",
50-
"{{ .Virtenv }}/scripts/domain/build.sh": "virtenv/scripts/domain/build.sh",
5150
"{{ .Virtenv }}/scripts/domain/deploy.sh": "virtenv/scripts/domain/deploy.sh",
5251
"{{ .Virtenv }}/scripts/domain/validate.sh": "virtenv/scripts/domain/validate.sh",
5352
"{{ .Virtenv }}/scripts/user/android.sh": "virtenv/scripts/user/android.sh",

plugins/android/virtenv/scripts/domain/build.sh

Lines changed: 0 additions & 169 deletions
This file was deleted.

plugins/android/virtenv/scripts/user/android.sh

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ usage() {
2929
Usage: android.sh <command> [args]
3030
3131
Commands:
32-
build [flags] Auto-detect and build Gradle project
3332
deploy [apk_path] Install and launch app on running emulator
3433
devices <command> [args] Manage device definitions
3534
info Display resolved SDK information
@@ -40,18 +39,9 @@ Commands:
4039
emulator reset Reset all emulator AVDs
4140
app status Check if deployed app is running
4241
app stop Stop the deployed app
43-
run [apk_path] [device] Build, install, and launch app on emulator
44-
45-
Build flags:
46-
--config Debug|Release Build configuration (default: Debug)
47-
--task gradle_task Gradle task override
48-
--quiet Suppress Gradle output
49-
-- extra_args... Extra args passed to gradle
42+
run [apk_path] [device] Start emulator, install, and launch app
5043
5144
Examples:
52-
android.sh build
53-
android.sh build --config Release
54-
android.sh build --task bundleRelease
5545
android.sh deploy
5646
android.sh deploy path/to/app.apk
5747
android.sh devices list
@@ -63,12 +53,13 @@ Examples:
6353
android.sh emulator ready
6454
android.sh app status
6555
android.sh app stop
66-
android.sh run # Build, install, launch
56+
android.sh run # Start emulator, install, launch
6757
android.sh run max # Same, but on 'max' device
6858
android.sh run path/to/app.apk # Install provided APK
6959
android.sh run path/to/app.apk max # Install APK on 'max' device
7060
7161
Note: Configuration is managed via environment variables in devbox.json.
62+
Note: Build your app with gradle directly (e.g., cd android && ./gradlew assembleDebug)
7263
USAGE
7364
exit 1
7465
}
@@ -118,23 +109,6 @@ android_state_dir() {
118109
# ============================================================================
119110

120111
case "$command_name" in
121-
# --------------------------------------------------------------------------
122-
# build - Auto-detect and build Gradle project
123-
# --------------------------------------------------------------------------
124-
build)
125-
ensure_lib_loaded
126-
127-
build_script="${scripts_dir%/}/domain/build.sh"
128-
if [ ! -f "$build_script" ]; then
129-
echo "ERROR: domain/build.sh not found: $build_script" >&2
130-
exit 1
131-
fi
132-
133-
# shellcheck source=/dev/null
134-
. "$build_script"
135-
android_build "$@"
136-
;;
137-
138112
# --------------------------------------------------------------------------
139113
# deploy - Install and launch app on running emulator (no build, no emu start)
140114
# --------------------------------------------------------------------------

plugins/ios/plugin.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"{{ .Virtenv }}/scripts/domain/device_manager.sh": "virtenv/scripts/domain/device_manager.sh",
4747
"{{ .Virtenv }}/scripts/domain/validate.sh": "virtenv/scripts/domain/validate.sh",
4848
"{{ .Virtenv }}/scripts/domain/simulator.sh": "virtenv/scripts/domain/simulator.sh",
49-
"{{ .Virtenv }}/scripts/domain/build.sh": "virtenv/scripts/domain/build.sh",
5049
"{{ .Virtenv }}/scripts/domain/deploy.sh": "virtenv/scripts/domain/deploy.sh",
5150
"{{ .Virtenv }}/scripts/user/config.sh": "virtenv/scripts/user/config.sh",
5251
"{{ .Virtenv }}/scripts/user/ios.sh": "virtenv/scripts/user/ios.sh",

0 commit comments

Comments
 (0)