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

Fix build process

parent 1da3b992
No related branches found
No related tags found
1 merge request!78Resolve "Fix build process"
Pipeline #6165 passed
...@@ -33,10 +33,11 @@ android:build-debug: ...@@ -33,10 +33,11 @@ android:build-debug:
- flutter build apk --debug - flutter build apk --debug
# prepare artifact # prepare artifact
- BASE_APK_FOLDER="build/app/outputs/flutter-apk" - BASE_APK_FOLDER="build/app/outputs/flutter-apk"
- APP_NAME="$(grep 'namespace' android/app/build.gradle | cut -d'"' -f2)"
- > - >
if [ "$(find "${BASE_APK_FOLDER}" -name "*.apk")" != "" ]; then if [ "$(find "${BASE_APK_FOLDER}" -name "*.apk")" != "" ]; then
for APK in ${BASE_APK_FOLDER}/*.apk; do for APK in ${BASE_APK_FOLDER}/*.apk; do
mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|")" mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|" | sed "s|/app-|/${APP_NAME}-|")"
done done
fi fi
- find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk? - find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk?
...@@ -69,6 +70,7 @@ android:build-release: ...@@ -69,6 +70,7 @@ android:build-release:
- mkdir -p "${BASE_APK_FOLDER}" - mkdir -p "${BASE_APK_FOLDER}"
- VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)" - VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)"
- VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)" - VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)"
- APP_NAME="$(grep 'namespace' android/app/build.gradle | cut -d'"' -f2)"
- TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}" - TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}"
- echo "${TAG_NAME}" - echo "${TAG_NAME}"
- > - >
...@@ -84,7 +86,7 @@ android:build-release: ...@@ -84,7 +86,7 @@ android:build-release:
- > - >
if [ "$(find "${BASE_APK_FOLDER}" -name "*.apk")" != "" ]; then if [ "$(find "${BASE_APK_FOLDER}" -name "*.apk")" != "" ]; then
for APK in ${BASE_APK_FOLDER}/*.apk; do for APK in ${BASE_APK_FOLDER}/*.apk; do
mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|")" mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|" | sed "s|/app-|/${APP_NAME}-|")"
done done
fi fi
- find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk? - find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk?
......
...@@ -3,7 +3,7 @@ description: A random application, for testing purpose only. ...@@ -3,7 +3,7 @@ description: A random application, for testing purpose only.
publish_to: "none" publish_to: "none"
version: 1.0.60+61 version: 1.0.61+62
environment: environment:
sdk: "^3.0.0" sdk: "^3.0.0"
......
test.sh 0 → 100755
#!/bin/bash -i
BASE_APK_FOLDER="build/app/outputs/flutter-apk"
VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)"
VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)"
APP_NAME="$(grep 'namespace' android/app/build.gradle | cut -d'"' -f2)"
if [ "$(find "${BASE_APK_FOLDER}" -name "*.apk")" != "" ]; then
for APK in ${BASE_APK_FOLDER}/*.apk; do
mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|" | sed "s|/app-|/${APP_NAME}-|")"
done
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment