Skip to content

Commit f8d3519

Browse files
committed
build: prevent commenting out Android function declarations in Flatpak script
- Update `disable-android-for-flatpak.sh` to skip files that define `configureAndroidTarget` and `configureKotlinAndroid` functions. - Ensure only call sites of these functions are commented out during the Flatpak build preparation. - Use `grep` to identify and exclude function declarations from `sed` modifications to maintain script integrity.
1 parent 2e1df9d commit f8d3519

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packaging/flatpak/disable-android-for-flatpak.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ sed -i \
9696
-e 's|apply("com.android.library")|// apply("com.android.library")|' \
9797
"$CONVENTION_DIR/CmpFeatureConventionPlugin.kt" 2>/dev/null || true
9898

99-
# Remove configureKotlinAndroid calls and Android extension blocks
99+
# Remove configureKotlinAndroid calls and Android extension blocks (only at call sites)
100100
for f in "$CONVENTION_DIR"/*.kt "$CONVENTION_DIR"/zed/rainxch/githubstore/convention/*.kt; do
101101
[ -f "$f" ] || continue
102+
# Skip files that define these functions (declarations, not call sites)
103+
grep -q "fun Project.configureAndroidTarget" "$f" && continue
104+
grep -q "fun Project.configureKotlinAndroid" "$f" && continue
102105
sed -i \
103106
-e 's|configureAndroidTarget()|// configureAndroidTarget()|g' \
104107
-e 's|configureKotlinAndroid(this)|// configureKotlinAndroid(this)|g' \

0 commit comments

Comments
 (0)