diff --git a/platforms/android/tools/build-play-aab.sh b/platforms/android/tools/build-play-aab.sh index 00d7e1059e..f31aa67318 100755 --- a/platforms/android/tools/build-play-aab.sh +++ b/platforms/android/tools/build-play-aab.sh @@ -77,6 +77,18 @@ echo "-- both cores in AAB (expect 4k AND 16k) --" n_cores=$(unzip -l "$OUTPUT_AAB" | grep -cE "base/lib/arm64-v8a/libemucore_(4k|16k)\.so$" || true) unzip -l "$OUTPUT_AAB" | grep -E "libemucore_(4k|16k)\.so" || { echo "FATAL cores missing" >&2; exit 1; } [[ "$n_cores" -eq 2 ]] || { echo "FATAL expected 2 cores, got $n_cores" >&2; exit 1; } +echo "-- Discord Social SDK --" +# Same trap as the sideload script: DISCORD_SDK_DIR is read from the environment and gated only +# on include/discordpp.h, so an unset variable silently produces a build with no Discord. 2.6.6.8 +# shipped that way and it was caught only after publishing. +if [[ -n "${DISCORD_SDK_DIR:-}" ]]; then + unzip -l "$OUTPUT_AAB" | grep -q "libdiscord_partner_sdk.so" \ + || { echo "FATAL DISCORD_SDK_DIR is set but libdiscord_partner_sdk.so is not in the bundle" >&2; exit 1; } + echo " present" +else + echo " WARNING: DISCORD_SDK_DIR unset -- this bundle has NO Discord integration." >&2 + echo " Set it to the staged dir (include/ + arm64-v8a/ + .aar) before a release." >&2 +fi echo "-- package (must be $PKG) --" unzip -p "$OUTPUT_AAB" base/manifest/AndroidManifest.xml | strings | grep -oE "come\.nanodata\.armsx2" | head -1 \ || { echo "FATAL wrong package" >&2; exit 1; } diff --git a/platforms/android/tools/build-release-apk.sh b/platforms/android/tools/build-release-apk.sh index fe000bba7c..9b131459e4 100755 --- a/platforms/android/tools/build-release-apk.sh +++ b/platforms/android/tools/build-release-apk.sh @@ -130,6 +130,19 @@ rm -f "$OUTPUT_APK" echo; echo "================= VERIFY =================" echo "-- both cores present --" unzip -l "$OUTPUT_APK" | grep -E "libemucore_(4k|16k)\.so" || { echo "FATAL cores missing" >&2; exit 1; } +echo "-- Discord Social SDK --" +# ★ The SDK is resolved from $DISCORD_SDK_DIR at configure time and gated only on +# include/discordpp.h existing, so with the variable unset the build simply omits Discord -- +# no error, no warning, nothing in the log. A whole release shipped that way (2.6.6.8) and it +# was only noticed after publication. Make it impossible to do silently again. +if [[ -n "${DISCORD_SDK_DIR:-}" ]]; then + unzip -l "$OUTPUT_APK" | grep -q "libdiscord_partner_sdk.so" \ + || { echo "FATAL DISCORD_SDK_DIR is set but libdiscord_partner_sdk.so is not in the APK" >&2; exit 1; } + echo " present" +else + echo " WARNING: DISCORD_SDK_DIR unset -- this build has NO Discord integration." >&2 + echo " Set it to the staged dir (include/ + arm64-v8a/ + .aar) before a release." >&2 +fi echo "-- 16k alignment --" "$ZIPALIGN" -c -P 16 4 "$OUTPUT_APK" && echo " zipalign OK" echo "-- signer certs (expect BOTH old debug + new release) --"