Add auto generation of manifest file for android project even for iOS, macOS, Windows.

This commit is contained in:
m 2024-05-10 16:26:24 +01:00
parent 00f79a393e
commit ae1fe4023d
6 changed files with 29 additions and 6 deletions

View file

@ -7,6 +7,10 @@ set secrets_file_path=lib\.secrets.g.dart
set release_dir=build\windows\x64\runner\Release
@REM Path could be different
if [%~1]==[] (set tools_root=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.38.33135\x64\Microsoft.VC143.CRT) else (set tools_root=%1)
@REM Generate android manifest file
cd scripts
bash.exe gen_android_manifest.sh
cd /d %cw_root%
echo === Generating pubspec.yaml ===
copy /Y pubspec_description.yaml pubspec.yaml > nul
call flutter pub get > nul

View file

@ -8,5 +8,5 @@ fi
./app_properties.sh
./app_icon.sh
./pubspec_gen.sh
./manifest.sh
./manifest.sh true #force overwrite manifest
./inject_app_details.sh

View file

@ -1,5 +1,10 @@
#!/bin/bash
cd ../..
cp -rf ./android/app/src/main/AndroidManifestBase.xml ./android/app/src/main/AndroidManifest.xml
if [ "$1" = true ]; then
cp -rf ./android/app/src/main/AndroidManifestBase.xml ./android/app/src/main/AndroidManifest.xml
else
cp -n ./android/app/src/main/AndroidManifestBase.xml ./android/app/src/main/AndroidManifest.xml
fi
cd scripts/android

10
scripts/gen_android_manifest.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
ANDROID_SCRIPTS_DIR=`pwd`/android
if [ ! -d $ANDROID_SCRIPTS_DIR ]; then
echo "no android scripts directory found at ${ANDROID_SCRIPTS_DIR}"
exit 0
fi
cd $ANDROID_SCRIPTS_DIR
./manifest.sh

View file

@ -10,7 +10,9 @@ if [ -z "$APP_IOS_TYPE" ]; then
exit 1
fi
cd ../.. # go to root
cd .. # go to scipts
./gen_android_manifest.sh
cd .. # go to root
cp -rf ./ios/Runner/InfoBase.plist ./ios/Runner/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName ${APP_IOS_NAME}" ./ios/Runner/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier ${APP_IOS_BUNDLE_ID}" ./ios/Runner/Info.plist

View file

@ -9,7 +9,9 @@ if [ -z "$APP_MACOS_TYPE" ]; then
exit 1
fi
cd ../.. # go to root
cd .. # go to scipts
./gen_android_manifest.sh
cd .. # go to root
cp -rf ./macos/Runner/InfoBase.plist ./macos/Runner/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName ${APP_MACOS_NAME}" ./macos/Runner/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleName ${APP_MACOS_NAME}" ./macos/Runner/Info.plist