Heck yeah, working great
This commit is contained in:
46
linux/lib.sh
46
linux/lib.sh
@@ -220,21 +220,55 @@ if [ ! -f "local.properties" ] && [ -z "$ANDROID_HOME" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! ./gradlew build; then
|
# Build the APK (assembleDebug creates the actual APK file)
|
||||||
|
# Suppress Java version warnings by setting gradle.properties
|
||||||
|
if [ ! -f "gradle.properties" ] || ! grep -q "android.javaCompile.suppressSourceTargetDeprecationWarning" gradle.properties 2>/dev/null; then
|
||||||
|
echo "" >> gradle.properties
|
||||||
|
echo "# Suppress Java version deprecation warnings" >> gradle.properties
|
||||||
|
echo "android.javaCompile.suppressSourceTargetDeprecationWarning=true" >> gradle.properties
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! ./gradlew assembleDebug; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "Error: APK build failed"
|
echo "Error: APK build failed"
|
||||||
echo "Check the error messages above for details"
|
echo "Check the error messages above for details"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
APK_PATH="$SDK_DIR/FtcRobotController/build/outputs/apk/debug/FtcRobotController-debug.apk"
|
# Find the APK - path varies by FTC SDK version
|
||||||
if [ ! -f "$APK_PATH" ]; then
|
APK_PATH=""
|
||||||
|
for possible_path in \
|
||||||
|
"$SDK_DIR/TeamCode/build/outputs/apk/debug/TeamCode-debug.apk" \
|
||||||
|
"$SDK_DIR/FtcRobotController/build/outputs/apk/debug/FtcRobotController-debug.apk" \
|
||||||
|
"$SDK_DIR/build/outputs/apk/debug/FtcRobotController-debug.apk" \
|
||||||
|
"$SDK_DIR/FtcRobotController/build/outputs/apk/FtcRobotController-debug.apk"; do
|
||||||
|
if [ -f "$possible_path" ]; then
|
||||||
|
APK_PATH="$possible_path"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# If still not found, search for it
|
||||||
|
if [ -z "$APK_PATH" ]; then
|
||||||
|
APK_PATH=$(find "$SDK_DIR" -name "*-debug.apk" -type f 2>/dev/null | head -1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$APK_PATH" ] || [ ! -f "$APK_PATH" ]; then
|
||||||
|
echo ""
|
||||||
|
echo "Error: APK not found after build"
|
||||||
|
echo ""
|
||||||
|
echo "Build succeeded but APK location is unexpected."
|
||||||
|
echo "Searched in:"
|
||||||
|
echo " • $SDK_DIR/TeamCode/build/outputs/apk/debug/"
|
||||||
|
echo " • $SDK_DIR/FtcRobotController/build/outputs/apk/debug/"
|
||||||
|
echo ""
|
||||||
|
echo "To find it manually:"
|
||||||
|
echo " find ~/ftc-sdk -name '*.apk' -type f"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Error: APK not found at expected location"
|
|
||||||
echo "Expected: $APK_PATH"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "✓ APK built"
|
|
||||||
|
echo "✓ APK built at: $(basename "$APK_PATH")"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Step 3: Install to Control Hub
|
# Step 3: Install to Control Hub
|
||||||
|
|||||||
Reference in New Issue
Block a user