fix(ci): Make Android build check non-blocking in verify script
Android build check was causing verify script to exit early due to set -euo pipefail. Fixed by: - Using set +e / set -e around gradle command - Treating Android build failure as warning (expected in standalone context) - Adding explanatory message about Capacitor app context requirement Gradle wrapper exists and works - the build failure is expected when Capacitor Android is not available as a dependency (only available in Capacitor app context).
This commit is contained in:
@@ -340,10 +340,20 @@ check_android() {
|
||||
fi
|
||||
|
||||
# Try to run a minimal gradle task
|
||||
if run_check "Android build (compile)" ./gradlew compileDebugJavaWithJavac --no-daemon; then
|
||||
:
|
||||
# Note: This may fail if Capacitor Android is not available as a dependency
|
||||
# (it's only available in a Capacitor app context, not standalone)
|
||||
# So we catch the error and treat it as non-blocking
|
||||
set +e
|
||||
local gradle_output
|
||||
gradle_output=$(./gradlew compileDebugJavaWithJavac --no-daemon 2>&1)
|
||||
local gradle_exit=$?
|
||||
set -e
|
||||
|
||||
if [ $gradle_exit -eq 0 ]; then
|
||||
print_success "Android build (compile)"
|
||||
else
|
||||
print_warning "Android build check failed (non-blocking)"
|
||||
print_warning "Android build check failed (non-blocking - expected in standalone context)"
|
||||
print_info "Android plugin requires Capacitor app context to build"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user