fix(tvos): eliminate runtime and project build warnings (#2228)

This commit is contained in:
Jan Haider
2026-09-03 14:41:16 +02:00
committed by GitHub
parent d112ade601
commit 2087dff32d
7 changed files with 28 additions and 18 deletions
+2 -2
View File
@@ -751,8 +751,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "75556a968a4a1ebc42fbb8c31942c2418d4326e1"
resolved-ref: "75556a968a4a1ebc42fbb8c31942c2418d4326e1"
ref: "a27208e641790029ac54d825b97508575caee1a7"
resolved-ref: "a27208e641790029ac54d825b97508575caee1a7"
url: "https://github.com/edde746/media_controls"
source: git
version: "0.3.0"
+1 -1
View File
@@ -38,7 +38,7 @@ dependencies:
os_media_controls:
git:
url: https://github.com/edde746/media_controls
ref: 75556a968a4a1ebc42fbb8c31942c2418d4326e1
ref: a27208e641790029ac54d825b97508575caee1a7
rate_limiter: ^1.0.0
wakelock_plus:
path: packages/wakelock_plus
+6 -3
View File
@@ -506,6 +506,7 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -559,6 +560,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -595,6 +597,7 @@
};
E2B5A6D75C9F4D1B9E8C7A63 /* Sync Version */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -864,7 +867,7 @@
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner";
TVOS_DEPLOYMENT_TARGET = 15.0;
TVOS_DEPLOYMENT_TARGET = 17.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
@@ -1098,7 +1101,7 @@
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner";
TVOS_DEPLOYMENT_TARGET = 15.0;
TVOS_DEPLOYMENT_TARGET = 17.0;
VALIDATE_PRODUCT = YES;
};
name = Profile;
@@ -1117,7 +1120,7 @@
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner";
TVOS_DEPLOYMENT_TARGET = 15.0;
TVOS_DEPLOYMENT_TARGET = 17.0;
};
name = Debug;
};
+2 -3
View File
@@ -118,13 +118,12 @@ import wakelock_plus
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// Set the long-form profile before activation so Dolby capabilities are
// available before playback.
// Configure the long-form profile before playback. The media controls
// plugin claims the session when playback actually starts.
do {
let session = AVAudioSession.sharedInstance()
try session.setCategory(
.playback, mode: .default, policy: .longFormAudio, options: [])
try session.setActive(true)
} catch {
print("Failed to configure long-form audio session: \(error)")
do {
+15 -4
View File
@@ -61,18 +61,23 @@ class WireTopShelfTest < Minitest::Test
runner_tests,
runner_configuration.name,
expected_team,
"#{expected_bundle}.RunnerTests"
"#{expected_bundle}.RunnerTests",
'17.0'
)
assert_generated_configuration(
top_shelf,
runner_configuration.name,
expected_team,
"#{expected_bundle}.TopShelfExtension"
"#{expected_bundle}.TopShelfExtension",
'15.0'
)
end
assert_equal 1, project.targets.count { |candidate| candidate.name == 'RunnerTests' }
assert_equal 1, project.targets.count { |candidate| candidate.name == 'TopShelfExtension' }
assert_always_out_of_date(runner, 'Run Script')
assert_always_out_of_date(runner, 'Thin Binary')
assert_always_out_of_date(top_shelf, 'Sync Version')
end
private
@@ -91,7 +96,13 @@ class WireTopShelfTest < Minitest::Test
assert status.success?, output
end
def assert_generated_configuration(target, name, expected_team, expected_bundle)
def assert_always_out_of_date(target, phase_name)
phase = target.shell_script_build_phases.find { |candidate| candidate.name == phase_name }
refute_nil phase, "#{target.name} has no #{phase_name} build phase"
assert_equal '1', phase.always_out_of_date
end
def assert_generated_configuration(target, name, expected_team, expected_bundle, deployment_target)
configuration = target.build_configurations.find { |candidate| candidate.name == name }
refute_nil configuration, "#{target.name} has no #{name} configuration"
@@ -102,6 +113,6 @@ class WireTopShelfTest < Minitest::Test
assert_nil settings['DEVELOPMENT_TEAM']
end
assert_equal expected_bundle, settings['PRODUCT_BUNDLE_IDENTIFIER']
assert_equal '15.0', settings['TVOS_DEPLOYMENT_TARGET']
assert_equal deployment_target, settings['TVOS_DEPLOYMENT_TARGET']
end
end
+2 -1
View File
@@ -60,6 +60,7 @@ def ensure_shell_script(target, name, script)
phase.shell_path = '/bin/sh'
phase.shell_script = script
phase.always_out_of_date = '1'
phase
end
@@ -130,7 +131,7 @@ test_target.build_configurations.each do |config|
settings['SWIFT_VERSION'] = '5.0'
settings['TARGETED_DEVICE_FAMILY'] = '3'
settings['TEST_HOST'] = '$(BUILT_PRODUCTS_DIR)/Runner.app/Runner'
settings['TVOS_DEPLOYMENT_TARGET'] = '15.0'
settings['TVOS_DEPLOYMENT_TARGET'] = '17.0'
end
event_delivery_ref = ensure_file(runner_group, 'TvosEventDeliveryCoordinator.swift')
-4
View File
@@ -473,8 +473,6 @@ BuildAppDebug() {
-o "$OUTDIR/App.framework/App" -
fi
strip "$OUTDIR/App.framework/App"
echo " └─copy frameworks"
CopyAppFrameworkInfoPlist "$OUTDIR/App.framework/Info.plist" "$tvos_deployment_target"
@@ -631,8 +629,6 @@ BuildAppRelease() {
-o "$OUTDIR/App.framework/App" \
"$OUTDIR/snapshot_assembly.o"
strip "$OUTDIR/App.framework/App"
CopyAppFrameworkInfoPlist "$OUTDIR/App.framework/Info.plist" "$tvos_deployment_target"
echo " └─copy frameworks"