create flutter packages under the prebuilt folder, fixes #224

This commit is contained in:
Taner Sener 2021-11-05 18:24:22 +00:00
parent b5c7a0c157
commit 626a7fa6d9

View File

@ -2,8 +2,8 @@
CURRENT_DIR=$(pwd)
BASEDIR="${CURRENT_DIR}/../../.."
TMPDIR="${BASEDIR}/.tmp"
PACKAGES_DIR="${TMPDIR}/flutter_packages"
PACKAGES_DIR_MAIN="${BASEDIR}/prebuilt/bundle-flutter-main"
PACKAGES_DIR_LTS="${BASEDIR}/prebuilt/bundle-flutter-lts"
SOURCE_DIR="${BASEDIR}/flutter/flutter"
PACKAGES=(min min-gpl https https-gpl audio video full full-gpl)
@ -18,8 +18,8 @@ prepare_inline_sed() {
create_main_releases() {
for CURRENT_PACKAGE in "${PACKAGES[@]}"; do
local FLUTTER_PACKAGE_NAME="$(echo "${CURRENT_PACKAGE}" | sed "s/\-/\_/g")"
local PACKAGE_PATH="${PACKAGES_DIR}/${CURRENT_PACKAGE}"
cp -r ${SOURCE_DIR} ${PACKAGE_PATH}
local PACKAGE_PATH="${PACKAGES_DIR_MAIN}/${CURRENT_PACKAGE}"
cp -R ${SOURCE_DIR} ${PACKAGE_PATH}
# 1. pubspec
$SED_INLINE "s|name: ffmpeg_kit_flutter|name: ffmpeg_kit_flutter_$FLUTTER_PACKAGE_NAME|g" ${PACKAGE_PATH}/pubspec.yaml
@ -47,14 +47,17 @@ create_main_releases() {
done;
# CREATE DEFAULT PACKAGE
cp -R "${SOURCE_DIR}" "${PACKAGES_DIR_MAIN}/default"
echo "main releases created!"
}
create_lts_releases() {
for CURRENT_PACKAGE in "${PACKAGES[@]}"; do
local FLUTTER_PACKAGE_NAME="$(echo "${CURRENT_PACKAGE}" | sed "s/\-/\_/g")"
local PACKAGE_PATH="${PACKAGES_DIR}/${CURRENT_PACKAGE}-lts"
cp -r ${SOURCE_DIR} ${PACKAGE_PATH}
local PACKAGE_PATH="${PACKAGES_DIR_LTS}/${CURRENT_PACKAGE}"
cp -R ${SOURCE_DIR} ${PACKAGE_PATH}
# 1. pubspec
$SED_INLINE "s|name: ffmpeg_kit_flutter|name: ffmpeg_kit_flutter_$FLUTTER_PACKAGE_NAME|g" ${PACKAGE_PATH}/pubspec.yaml
@ -82,6 +85,17 @@ create_lts_releases() {
done;
# CREATE DEFAULT PACKAGE
cp -R "${PACKAGES_DIR_LTS}/https" "${PACKAGES_DIR_LTS}/default"
$SED_INLINE "s|name: ffmpeg_kit_flutter_https|name: ffmpeg_kit_flutter|g" ${PACKAGES_DIR_LTS}/default/pubspec.yaml
rm -f ${PACKAGES_DIR_LTS}/default/pubspec.yaml.tmp
$SED_INLINE "s|ffmpeg_kit_flutter_https|ffmpeg_kit_flutter|g" ${PACKAGES_DIR_LTS}/default/ios/ffmpeg_kit_flutter_https.podspec
rm -f ${PACKAGES_DIR_LTS}/default/ios/ffmpeg_kit_flutter_https.podspec.tmp
mv ${PACKAGES_DIR_LTS}/default/ios/ffmpeg_kit_flutter_https.podspec ${PACKAGES_DIR_LTS}/default/ios/ffmpeg_kit_flutter.podspec
$SED_INLINE "s|ffmpeg_kit_flutter_https|ffmpeg_kit_flutter|g" ${PACKAGES_DIR_LTS}/default/macos/ffmpeg_kit_flutter_https.podspec
rm -f ${PACKAGES_DIR_LTS}/default/macos/ffmpeg_kit_flutter_https.podspec.tmp
mv ${PACKAGES_DIR_LTS}/default/macos/ffmpeg_kit_flutter_https.podspec ${PACKAGES_DIR_LTS}/default/macos/ffmpeg_kit_flutter.podspec
echo "lts releases created!"
}
@ -94,13 +108,13 @@ fi
VERSION="$1"
NATIVE_VERSION="$2"
rm -rf "${PACKAGES_DIR}"
mkdir -p "${PACKAGES_DIR}"
rm -rf "${PACKAGES_DIR_MAIN}"
mkdir -p "${PACKAGES_DIR_MAIN}"
rm -rf "${PACKAGES_DIR_LTS}"
mkdir -p "${PACKAGES_DIR_LTS}"
prepare_inline_sed
create_main_releases;
create_lts_releases;
cp -r "${BASEDIR}/flutter/flutter_platform_interface" "$PACKAGES_DIR"