fix(tvos): sync build version from pubspec

This commit is contained in:
edde746
2026-05-05 00:23:32 +02:00
parent ed4be7b96d
commit ef8026797c
4 changed files with 91 additions and 14 deletions
+1 -8
View File
@@ -25,9 +25,6 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite_darwin (0.0.4):
- Flutter
- FlutterMacOS
- sqlite3 (3.52.0):
- sqlite3/common (= 3.52.0)
- sqlite3/common (3.52.0)
@@ -72,7 +69,6 @@ DEPENDENCIES:
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
- sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/darwin`)
- universal_gamepad (from `.symlinks/plugins/universal_gamepad/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
@@ -106,8 +102,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/sentry_flutter/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite_darwin:
:path: ".symlinks/plugins/sqflite_darwin/darwin"
sqlite3_flutter_libs:
:path: ".symlinks/plugins/sqlite3_flutter_libs/darwin"
universal_gamepad:
@@ -130,12 +124,11 @@ SPEC CHECKSUMS:
Sentry: d587a8fe91ca13503ecd69a1905f3e8a0fcf61be
sentry_flutter: 31101687061fb85211ebab09ce6eb8db4e9ba74f
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
sqlite3: a51c07cf16e023d6c48abd5e5791a61a47354921
sqlite3_flutter_libs: b3e120efe9a82017e5552a620f696589ed4f62ab
universal_gamepad: 838bbb70d37d8c7c719038aa397214f2c4c4f866
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
wakelock_plus: e29112ab3ef0b318e58cfa5c32326458be66b556
wakelock_plus: 5aaa6a7ccaf4749a96a7d8ff0721d68061ad62cf
PODFILE CHECKSUM: 16bb7f67e16d8aaa2bfb97666803fbfb291b6559
+1 -1
View File
@@ -1,7 +1,7 @@
name: plezy
description: "A beautiful Plex client for Flutter"
publish_to: "none"
version: 2.0.0+79
version: 2.0.0+80
environment:
sdk: ">=3.10.7 <4.0.0"
+2 -2
View File
@@ -312,7 +312,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "echo no-op thin binary\n";
shellScript = "/bin/bash \"$SOURCE_ROOT/scripts/xcode_appletv.sh\" sync_version\n";
};
570D41C54A87D72AB27F6F15 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
@@ -365,7 +365,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n/bin/sh \"$SOURCE_ROOT/scripts/xcode_appletv.sh\" build\n";
shellScript = "#/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n/bin/bash \"$SOURCE_ROOT/scripts/xcode_appletv.sh\" build\n";
};
/* End PBXShellScriptBuildPhase section */
+87 -3
View File
@@ -20,6 +20,86 @@ else
SIM_ARCH='x86_64'
fi
ReadPubspecVersion() {
local app_path="${FLUTTER_APPLICATION_PATH:-}"
if [[ -z "$app_path" ]]; then
if [[ -n "${PROJECT_DIR:-}" ]]; then
app_path="$(cd "$(dirname "$PROJECT_DIR")" && pwd)"
else
app_path="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
fi
fi
local pubspec="$app_path/pubspec.yaml"
local pub_version=""
if [[ -f "$pubspec" ]]; then
local line
while IFS= read -r line; do
case "$line" in
version:*)
pub_version="${line#version:}"
pub_version="${pub_version%%#*}"
pub_version="${pub_version#"${pub_version%%[![:space:]]*}"}"
pub_version="${pub_version%"${pub_version##*[![:space:]]}"}"
pub_version="${pub_version%\"}"
pub_version="${pub_version#\"}"
pub_version="${pub_version%\'}"
pub_version="${pub_version#\'}"
break
;;
esac
done < "$pubspec"
fi
if [[ -n "$pub_version" ]]; then
FLUTTER_BUILD_NAME="${pub_version%+*}"
if [[ "$pub_version" == *+* ]]; then
FLUTTER_BUILD_NUMBER="${pub_version#*+}"
else
FLUTTER_BUILD_NUMBER="1"
fi
else
FLUTTER_BUILD_NAME="${FLUTTER_BUILD_NAME:-1.0.0}"
FLUTTER_BUILD_NUMBER="${FLUTTER_BUILD_NUMBER:-1}"
fi
export FLUTTER_BUILD_NAME
export FLUTTER_BUILD_NUMBER
}
SetPlistString() {
local plist="$1"
local key="$2"
local value="$3"
if /usr/libexec/PlistBuddy -c "Print :$key" "$plist" >/dev/null 2>&1; then
/usr/libexec/PlistBuddy -c "Set :$key $value" "$plist"
else
/usr/libexec/PlistBuddy -c "Add :$key string $value" "$plist"
fi
}
SyncRunnerVersion() {
ReadPubspecVersion
local plist=""
if [[ -n "${TARGET_BUILD_DIR:-}" && -n "${INFOPLIST_PATH:-}" ]]; then
plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH"
fi
if [[ -z "$plist" || ! -f "$plist" ]]; then
plist="$TARGET_BUILD_DIR/$WRAPPER_NAME/Info.plist"
fi
if [[ ! -f "$plist" ]]; then
echo " └─ERROR: Runner Info.plist not found for version sync"
return 1
fi
echo " └─Syncing Runner version $FLUTTER_BUILD_NAME ($FLUTTER_BUILD_NUMBER)"
SetPlistString "$plist" CFBundleShortVersionString "$FLUTTER_BUILD_NAME"
SetPlistString "$plist" CFBundleVersion "$FLUTTER_BUILD_NUMBER"
}
BuildAppDebug() {
# Host tools (frontend_server, patched SDK, dartaotruntime) ship in
# host_release for both debug and release consumers — the frontend_server
@@ -325,11 +405,13 @@ BuildAppRelease() {
BuildApp() {
ReadPubspecVersion
local build_mode="$(echo "${FLUTTER_BUILD_MODE:-${CONFIGURATION}}" | tr "[:upper:]" "[:lower:]")"
echo "Compiling Flutter/App.Framework"
echo " └─version $FLUTTER_BUILD_NAME ($FLUTTER_BUILD_NUMBER)"
if [ -z "$FLUTTER_LOCAL_ENGINE" ]; then
echo " └─ERROR: FLUTTER_LOCAL_ENGINE not set!"
return 1;
@@ -364,6 +446,8 @@ else
case $1 in
"build")
BuildApp ;;
"sync_version")
SyncRunnerVersion ;;
# "embed_and_thin")
# "Not needed, used from flutter xcode_backend.sh script"
esac