Skip to content
Snippets Groups Projects
Commit 3b9f382d authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Fix apk package name in build process

parent 9de5287c
No related branches found
No related tags found
1 merge request!74Resolve "Fix package name"
Pipeline #6128 passed
......@@ -23,12 +23,16 @@ android:build-debug:
- echo keyAlias=$ANDROID_DEBUG_KEY_ALIAS >> android/key.properties
- echo keyPassword=$ANDROID_DEBUG_KEY_PASSWORD >> android/key.properties
# build flutter app
- VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)"
- VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)"
- flutter packages get
- flutter clean
- flutter build apk --debug --split-per-abi
- flutter build apk --debug
# prepare artifact
- find . -name "*.apk" # where is my apk?
- BASE_APK_FOLDER="build/app/outputs/flutter-apk"
- for APK in ${BASE_APK_FOLDER}/*.apk; do mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|")"; done
- find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk?
artifacts:
paths:
- build/app/outputs/flutter-apk
......@@ -67,7 +71,9 @@ android:build-release:
flutter build apk --release
fi
# prepare artifact
- find . -name "*.apk" # where is my apk?
- BASE_APK_FOLDER="build/app/outputs/flutter-apk"
- for APK in ${BASE_APK_FOLDER}/*.apk; do mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|")"; done
- find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk?
artifacts:
paths:
- build/app/outputs/flutter-apk
......
......@@ -30,6 +30,7 @@ android {
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
archivesBaseName = "$applicationId" + "_" + "$versionCode"
}
signingConfigs {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment