You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
998 B
22 lines
998 B
#!/bin/bash
|
|
|
|
# Fix for capacitor.build.gradle in plugin development projects
|
|
# This script should be run after any 'npx cap sync' or 'npx cap update'
|
|
|
|
set -e
|
|
|
|
CAPACITOR_BUILD_GRADLE="android/app/capacitor.build.gradle"
|
|
|
|
if [ -f "$CAPACITOR_BUILD_GRADLE" ]; then
|
|
echo "🔧 Fixing capacitor.build.gradle for plugin development project..."
|
|
|
|
# Comment out the problematic line if it exists and isn't already commented
|
|
if grep -q "^apply from: \"../capacitor-cordova-android-plugins/cordova.variables.gradle\"" "$CAPACITOR_BUILD_GRADLE"; then
|
|
sed -i 's/^apply from: "\.\.\/capacitor-cordova-android-plugins\/cordova\.variables\.gradle"/\/\/ Plugin development project - no Capacitor integration files needed\n\/\/ &/' "$CAPACITOR_BUILD_GRADLE"
|
|
echo "✅ Fixed capacitor.build.gradle"
|
|
else
|
|
echo "ℹ️ capacitor.build.gradle already fixed or doesn't need fixing"
|
|
fi
|
|
else
|
|
echo "⚠️ capacitor.build.gradle not found at $CAPACITOR_BUILD_GRADLE"
|
|
fi
|
|
|