veilidchat/dev-setup/flutter_config.sh

36 lines
1.5 KiB
Bash
Raw Permalink Normal View History

2023-01-11 19:17:04 -05:00
#!/bin/bash
2023-07-02 11:31:40 -04:00
#
# Run this if you regenerate and need to reconfigure platform specific make system project files
#
2023-01-11 19:17:04 -05:00
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPTDIR/_script_common
# iOS: Set deployment target
2024-04-29 13:41:19 -04:00
sed -i '' 's/IPHONEOS_DEPLOYMENT_TARGET = [^;]*/IPHONEOS_DEPLOYMENT_TARGET = 12.4/g' $APPDIR/ios/Runner.xcodeproj/project.pbxproj
sed -i '' "s/platform :ios, '[^']*'/platform :ios, '12.4'/g" $APPDIR/ios/Podfile
2023-01-11 19:17:04 -05:00
# MacOS: Set deployment target
2024-04-29 13:41:19 -04:00
sed -i '' 's/MACOSX_DEPLOYMENT_TARGET = [^;]*/MACOSX_DEPLOYMENT_TARGET = 10.14.6/g' $APPDIR/macos/Runner.xcodeproj/project.pbxproj
sed -i '' "s/platform :osx, '[^']*'/platform :osx, '10.14.6'/g" $APPDIR/macos/Podfile
2023-01-11 19:17:04 -05:00
# Android: Set NDK version
if [[ "$TMPDIR" != "" ]]; then
ANDTMP=$TMPDIR/andtmp_$(date +%s)
else
ANDTMP=/tmp/andtmp_$(date +%s)
fi
cat <<EOF > $ANDTMP
2024-04-29 13:41:19 -04:00
ndkVersion '26.3.11579264'
2023-01-11 19:17:04 -05:00
EOF
2024-04-29 13:41:19 -04:00
sed -i '' -e "/android {/r $ANDTMP" $APPDIR/android/app/build.gradle
2023-01-11 19:17:04 -05:00
rm -- $ANDTMP
# Android: Set min sdk version
2024-04-29 13:41:19 -04:00
sed -i '' 's/minSdkVersion .*/minSdkVersion Math.max(flutter.minSdkVersion, 24)/g' $APPDIR/android/app/build.gradle
2023-01-11 19:17:04 -05:00
# Android: Set gradle plugin version
2024-04-29 13:41:19 -04:00
sed -i '' "s/classpath \'com.android.tools.build:gradle:[^\']*\'/classpath 'com.android.tools.build:gradle:7.2.0'/g" $APPDIR/android/build.gradle
2023-01-11 19:17:04 -05:00
# Android: Set gradle version
2024-04-29 13:41:19 -04:00
sed -i '' 's/distributionUrl=.*/distributionUrl=https:\/\/services.gradle.org\/distributions\/gradle-7.6.3-all.zip/g' $APPDIR/android/gradle/wrapper/gradle-wrapper.properties