fix(android): remove hardcoded versionCode/Name from manifest so aapt2 CI injection works
Android Release / build-apk (push) Successful in 3m44s
Android Release / build-apk (push) Successful in 3m44s
aapt2 --version-code/--version-name only inject when the attribute is absent — they silently no-op when the manifest already has a value. Removed both attributes from AndroidManifest.xml so the CI flags take effect. Local debug builds fall back to code=1 / name=0.0.0-dev. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -76,12 +76,16 @@ if [ -d "$RES_DIR" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Derive versionCode/versionName from VERSION_NAME env var (e.g. "v0.28.0" → code 2800, name "0.28.0").
|
# Derive versionCode/versionName from VERSION_NAME env var (e.g. "v0.28.0" → code 2800, name "0.28.0").
|
||||||
# Falls back to the values hardcoded in AndroidManifest.xml when not set (local debug builds).
|
# AndroidManifest.xml intentionally has no versionCode/versionName — aapt2's --version-* flags only
|
||||||
VERSION_CODE=""
|
# inject when absent, so the manifest must be clean for CI injection to work. Local debug builds
|
||||||
|
# fall back to code=1 / name="0.0.0-dev".
|
||||||
if [ -n "${VERSION_NAME:-}" ]; then
|
if [ -n "${VERSION_NAME:-}" ]; then
|
||||||
VN="${VERSION_NAME#v}"
|
VN="${VERSION_NAME#v}"
|
||||||
IFS='.' read -r _MAJ _MIN _PAT <<< "$VN"
|
IFS='.' read -r _MAJ _MIN _PAT <<< "$VN"
|
||||||
VERSION_CODE=$(( ${_MAJ:-0} * 10000 + ${_MIN:-0} * 100 + ${_PAT:-0} ))
|
VERSION_CODE=$(( ${_MAJ:-0} * 10000 + ${_MIN:-0} * 100 + ${_PAT:-0} ))
|
||||||
|
else
|
||||||
|
VERSION_CODE=1
|
||||||
|
VERSION_NAME="0.0.0-dev"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LINK_ARGS=(
|
LINK_ARGS=(
|
||||||
|
|||||||
@@ -13,9 +13,7 @@
|
|||||||
shared object name without the `lib` prefix or `.so` suffix.
|
shared object name without the `lib` prefix or `.so` suffix.
|
||||||
-->
|
-->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.ferrousapp.solitaire"
|
package="com.ferrousapp.solitaire">
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0">
|
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="26"
|
android:minSdkVersion="26"
|
||||||
|
|||||||
Reference in New Issue
Block a user