diff --git a/packages/package_info_plus_tvos/CHANGELOG.md b/packages/package_info_plus_tvos/CHANGELOG.md
index aaa539f..ca21b80 100644
--- a/packages/package_info_plus_tvos/CHANGELOG.md
+++ b/packages/package_info_plus_tvos/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 0.0.2
+
+* Add Swift Package Manager support: ships a `tvos/Package.swift`. flutter-tvos
+ links a plugin that has one through SwiftPM and leaves it out of the Podfile.
+ No API change.
+
## 0.0.1
Initial release — tvOS implementation of `package_info_plus` for
diff --git a/packages/package_info_plus_tvos/README.md b/packages/package_info_plus_tvos/README.md
index b24943d..519f7c4 100644
--- a/packages/package_info_plus_tvos/README.md
+++ b/packages/package_info_plus_tvos/README.md
@@ -10,7 +10,7 @@ for [flutter-tvos](https://github.com/fluttertv/flutter-tvos).
```yaml
dependencies:
package_info_plus: ^10.x
- package_info_plus_tvos: ^0.0.1
+ package_info_plus_tvos: ^0.0.2
```
## tvOS support
@@ -28,3 +28,10 @@ dependencies:
- None for core fields.
See `PORTING_REPORT.md` for the port detail and checklist.
+
+## Dependency management
+
+This package ships a `tvos/Package.swift`. `flutter-tvos` links any plugin
+that has one through **Swift Package Manager** and leaves it out of the
+Podfile, so the podspec is only read by tools that do not know about SwiftPM.
+No manual setup needed.
diff --git a/packages/package_info_plus_tvos/example/tvos/Flutter/AppFrameworkInfo.plist b/packages/package_info_plus_tvos/example/tvos/Flutter/AppFrameworkInfo.plist
deleted file mode 100644
index 391a902..0000000
--- a/packages/package_info_plus_tvos/example/tvos/Flutter/AppFrameworkInfo.plist
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- App
- CFBundleIdentifier
- io.flutter.flutter.app
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- App
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 1.0
- CFBundleSignature
- ????
- CFBundleVersion
- 1.0
-
-
diff --git a/packages/package_info_plus_tvos/example/tvos/Podfile b/packages/package_info_plus_tvos/example/tvos/Podfile
index d23e9e6..2e1ee47 100644
--- a/packages/package_info_plus_tvos/example/tvos/Podfile
+++ b/packages/package_info_plus_tvos/example/tvos/Podfile
@@ -1,7 +1,7 @@
# Flutter tvOS Podfile — auto-generated by flutter-tvos create.
# Reads .flutter-plugins-dependencies and adds local pods for each plugin.
-platform :tvos, '13.0'
+platform :tvos, '15.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -25,7 +25,11 @@ target 'Runner' do
plugin_name = plugin['name']
plugin_path = plugin['path']
tvos_dir = File.join(plugin_path, 'tvos')
- if File.directory?(tvos_dir) && File.exist?(File.join(tvos_dir, "#{plugin_name}.podspec"))
+ # Plugins that ship a Package.swift are resolved via Swift Package Manager
+ # (see flutter-tvos's generated FlutterGeneratedPluginSwiftPackage). Skip
+ # them here so they are never linked twice (SPM + CocoaPods).
+ has_spm = File.exist?(File.join(tvos_dir, 'Package.swift'))
+ if File.directory?(tvos_dir) && !has_spm && File.exist?(File.join(tvos_dir, "#{plugin_name}.podspec"))
pod plugin_name, :path => tvos_dir
end
end
@@ -35,7 +39,7 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
- config.build_settings['TVOS_DEPLOYMENT_TARGET'] = '13.0'
+ config.build_settings['TVOS_DEPLOYMENT_TARGET'] = '15.0'
end
end
end
diff --git a/packages/package_info_plus_tvos/example/tvos/Runner.xcodeproj/project.pbxproj b/packages/package_info_plus_tvos/example/tvos/Runner.xcodeproj/project.pbxproj
index 4818a84..2e77249 100644
--- a/packages/package_info_plus_tvos/example/tvos/Runner.xcodeproj/project.pbxproj
+++ b/packages/package_info_plus_tvos/example/tvos/Runner.xcodeproj/project.pbxproj
@@ -3,44 +3,27 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 54;
+ objectVersion = 60;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
- 3B3967161E833CAB004F5970 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAB004F5970 /* Flutter.framework */; };
- 7FF7FAAD368C10A666B5A90C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85D39DA67AD1E75A89676D2F /* Pods_Runner.framework */; };
- 9705A1C61CF904A100538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAB004F5970 /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
97C146FB1CF9000082B4168C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000082B4168C /* AppDelegate.swift */; };
97C1470A1CF9000082B4168D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000082B4168D /* Main.storyboard */; };
97C1470B1CF9000082B4168D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000082B4168E /* LaunchScreen.storyboard */; };
97C1470F1CF9000082B4168C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000082B4168C /* Assets.xcassets */; };
- AAA000000000000000000002 /* MetalLibInterposer.m in Sources */ = {isa = PBXBuildFile; fileRef = AAA000000000000000000001 /* MetalLibInterposer.m */; };
- AAA000000000000000000010 /* tvos_metallibs in Resources */ = {isa = PBXBuildFile; fileRef = AAA000000000000000000004 /* tvos_metallibs */; };
+ A7520CFEF34876166CE9DA38 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D1BD169D01CFFB544399692 /* Pods_Runner.framework */; };
+ AAF20000000000000000F00D /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = AAF30000000000000000F00D /* FlutterGeneratedPluginSwiftPackage */; };
/* End PBXBuildFile section */
-/* Begin PBXCopyFilesBuildPhase section */
- 3B06AD1E1E4923F5004D2608 /* Embed Frameworks */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "";
- dstSubfolderSpec = 10;
- files = (
- 9705A1C61CF904A100538489 /* Flutter.framework in Embed Frameworks */,
- );
- name = "Embed Frameworks";
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
- 223D5CDBABB88210979D6839 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
3B3967151E833CAB004F5970 /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
+ 4D1BD169D01CFFB544399692 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 52F068B04D03B88EDC30FEAF /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
- 85D39DA67AD1E75A89676D2F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
97C146EE1CF9000082B41680 /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FA1CF9000082B4168C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
@@ -48,12 +31,9 @@
97C146FE1CF9000082B4168C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
97C146FF1CF9000082B4168D /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; };
97C146FF1CF9000082B4168E /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
- A0BA384DEE2AD4569B4F7BE8 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
- AAA000000000000000000001 /* MetalLibInterposer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MetalLibInterposer.m; sourceTree = ""; };
+ 9E5C6859A82F307067ED5B61 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
AAA000000000000000000003 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
- AAA000000000000000000004 /* tvos_metallibs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = tvos_metallibs; sourceTree = ""; };
- AAA000000000000000000005 /* MetalLibInterposer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MetalLibInterposer.h; sourceTree = ""; };
- C8373200374C8F2A16E19F87 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
+ AAA2105EE2136FA6602379F9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -61,8 +41,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 3B3967161E833CAB004F5970 /* Flutter.framework in Frameworks */,
- 7FF7FAAD368C10A666B5A90C /* Pods_Runner.framework in Frameworks */,
+ AAF20000000000000000F00D /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
+ A7520CFEF34876166CE9DA38 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -76,7 +56,7 @@
97C146F01CF9000082B4168E /* Flutter */,
97C146F01CF9000082B4168F /* Frameworks */,
97C146EF1CF9000082B41690 /* Products */,
- EAA72DFF9A9EAF5CD05EC6C5 /* Pods */,
+ F9A0954678CF7A5C96D227FE /* Pods */,
);
sourceTree = "";
};
@@ -92,8 +72,6 @@
isa = PBXGroup;
children = (
97C146FA1CF9000082B4168C /* AppDelegate.swift */,
- AAA000000000000000000001 /* MetalLibInterposer.m */,
- AAA000000000000000000005 /* MetalLibInterposer.h */,
AAA000000000000000000003 /* Runner-Bridging-Header.h */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
@@ -101,7 +79,6 @@
97C146FE1CF9000082B4168C /* Info.plist */,
97C146FF1CF9000082B4168D /* Main.storyboard */,
97C146FF1CF9000082B4168E /* LaunchScreen.storyboard */,
- AAA000000000000000000004 /* tvos_metallibs */,
);
path = Runner;
sourceTree = "";
@@ -120,19 +97,18 @@
isa = PBXGroup;
children = (
3B3967151E833CAB004F5970 /* Flutter.framework */,
- 85D39DA67AD1E75A89676D2F /* Pods_Runner.framework */,
+ 4D1BD169D01CFFB544399692 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "";
};
- EAA72DFF9A9EAF5CD05EC6C5 /* Pods */ = {
+ F9A0954678CF7A5C96D227FE /* Pods */ = {
isa = PBXGroup;
children = (
- 223D5CDBABB88210979D6839 /* Pods-Runner.debug.xcconfig */,
- A0BA384DEE2AD4569B4F7BE8 /* Pods-Runner.release.xcconfig */,
- C8373200374C8F2A16E19F87 /* Pods-Runner.profile.xcconfig */,
+ 52F068B04D03B88EDC30FEAF /* Pods-Runner.debug.xcconfig */,
+ AAA2105EE2136FA6602379F9 /* Pods-Runner.release.xcconfig */,
+ 9E5C6859A82F307067ED5B61 /* Pods-Runner.profile.xcconfig */,
);
- name = Pods;
path = Pods;
sourceTree = "";
};
@@ -143,19 +119,22 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000082B4168C /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
- 49155909F3EF2A164ACDBC99 /* [CP] Check Pods Manifest.lock */,
+ 5C01A3C59A866235C35E2DB4 /* [CP] Check Pods Manifest.lock */,
97C146EA1CF9000082B4168C /* Sources */,
97C146EB1CF9000082B4168C /* Frameworks */,
97C146EC1CF9000082B4168C /* Resources */,
- 3B06AD1E1E4923F5004D2608 /* Embed Frameworks */,
+ AAF10000000000000000F00D /* Embed App.framework */,
9740EEB31CF901A200538489 /* Copy flutter_assets */,
- 0400FE01E494D11C87107DA0 /* [CP] Embed Pods Frameworks */,
+ 455A83978B9B5C300C647018 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
+ packageProductDependencies = (
+ AAF30000000000000000F00D /* FlutterGeneratedPluginSwiftPackage */,
+ );
productName = Runner;
productReference = 97C146EE1CF9000082B41680 /* Runner.app */;
productType = "com.apple.product-type.application";
@@ -184,6 +163,9 @@
Base,
);
mainGroup = 97C146E51CF9000082B4168C;
+ packageReferences = (
+ AAF40000000000000000F00D /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
+ );
productRefGroup = 97C146EF1CF9000082B41690 /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -201,14 +183,13 @@
97C1470F1CF9000082B4168C /* Assets.xcassets in Resources */,
97C1470A1CF9000082B4168D /* Main.storyboard in Resources */,
97C1470B1CF9000082B4168D /* LaunchScreen.storyboard in Resources */,
- AAA000000000000000000010 /* tvos_metallibs in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- 0400FE01E494D11C87107DA0 /* [CP] Embed Pods Frameworks */ = {
+ 455A83978B9B5C300C647018 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -225,7 +206,7 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
- 49155909F3EF2A164ACDBC99 /* [CP] Check Pods Manifest.lock */ = {
+ 5C01A3C59A866235C35E2DB4 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -264,6 +245,23 @@
shellPath = /bin/sh;
shellScript = "#!/bin/sh\n# Copy flutter_assets into the app bundle\nFLUTTER_ASSETS_SRC=\"${PROJECT_DIR}/Flutter/flutter_assets\"\nDEST=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/flutter_assets\"\nif [ -d \"${FLUTTER_ASSETS_SRC}\" ]; then\n echo \"Copying flutter_assets to app bundle...\"\n rsync -av --delete \"${FLUTTER_ASSETS_SRC}/\" \"${DEST}/\"\nelse\n echo \"warning: flutter_assets not found at ${FLUTTER_ASSETS_SRC}\"\nfi\n";
};
+ AAF10000000000000000F00D /* Embed App.framework */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(PROJECT_DIR)/Flutter/App.framework",
+ );
+ name = "Embed App.framework";
+ outputPaths = (
+ "$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME).app/Frameworks/App.framework",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "#!/bin/sh\n# Embed App.framework (AOT Dart snapshots) into the app bundle.\n# Present only for release/profile (AOT) builds; debug/JIT has no App.framework.\n# Runs for build, run, AND archive, so TestFlight/App Store builds get it too.\nAPP_FRAMEWORK_SRC=\"${PROJECT_DIR}/Flutter/App.framework\"\nDEST_FRAMEWORKS=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Frameworks\"\nif [ -d \"${APP_FRAMEWORK_SRC}\" ]; then\n echo \"Embedding App.framework...\"\n mkdir -p \"${DEST_FRAMEWORKS}\"\n rsync -av --delete \"${APP_FRAMEWORK_SRC}\" \"${DEST_FRAMEWORKS}/\"\n if [ \"${CODE_SIGNING_REQUIRED}\" != \"NO\" ] && [ -n \"${EXPANDED_CODE_SIGN_IDENTITY}\" ]; then\n echo \"Codesigning App.framework with ${EXPANDED_CODE_SIGN_IDENTITY}...\"\n codesign --force --sign \"${EXPANDED_CODE_SIGN_IDENTITY}\" --timestamp=none --generate-entitlement-der \"${DEST_FRAMEWORKS}/App.framework\"\n fi\nelse\n echo \"No App.framework to embed (debug/JIT build).\"\nfi\n";
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -273,7 +271,6 @@
files = (
97C146FB1CF9000082B4168C /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
- AAA000000000000000000002 /* MetalLibInterposer.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -327,7 +324,7 @@
SDKROOT = appletvos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
- TVOS_DEPLOYMENT_TARGET = 13.0;
+ TVOS_DEPLOYMENT_TARGET = 15.0;
VALIDATE_PRODUCT = YES;
};
name = Profile;
@@ -413,7 +410,7 @@
SDKROOT = appletvos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- TVOS_DEPLOYMENT_TARGET = 13.0;
+ TVOS_DEPLOYMENT_TARGET = 15.0;
};
name = Debug;
};
@@ -491,7 +488,7 @@
SDKROOT = appletvos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
- TVOS_DEPLOYMENT_TARGET = 13.0;
+ TVOS_DEPLOYMENT_TARGET = 15.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
@@ -547,6 +544,20 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+
+/* Begin XCLocalSwiftPackageReference section */
+ AAF40000000000000000F00D /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
+ isa = XCLocalSwiftPackageReference;
+ relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCLocalSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ AAF30000000000000000F00D /* FlutterGeneratedPluginSwiftPackage */ = {
+ isa = XCSwiftPackageProductDependency;
+ productName = FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000082B4168C /* Project object */;
}
diff --git a/packages/package_info_plus_tvos/example/tvos/Runner/AppDelegate.swift b/packages/package_info_plus_tvos/example/tvos/Runner/AppDelegate.swift
index e867cf0..c30b367 100644
--- a/packages/package_info_plus_tvos/example/tvos/Runner/AppDelegate.swift
+++ b/packages/package_info_plus_tvos/example/tvos/Runner/AppDelegate.swift
@@ -1,20 +1,16 @@
-import UIKit
import Flutter
+import UIKit
@main
-class AppDelegate: FlutterAppDelegate {
- override func application(
- _ application: UIApplication,
- didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
- ) -> Bool {
- let flutterViewController = FlutterViewController(project: nil, nibName: nil, bundle: nil)
- let window = UIWindow(frame: UIScreen.main.bounds)
- window.rootViewController = flutterViewController
- window.makeKeyAndVisible()
- self.window = window
-
- GeneratedPluginRegistrant.register(with: self)
+@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
+ override func application(
+ _ application: UIApplication,
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+ ) -> Bool {
+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)
+ }
- return super.application(application, didFinishLaunchingWithOptions: launchOptions)
- }
+ func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
+ GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
+ }
}
diff --git a/packages/package_info_plus_tvos/example/tvos/Runner/Base.lproj/Main.storyboard b/packages/package_info_plus_tvos/example/tvos/Runner/Base.lproj/Main.storyboard
index 4e805a1..d9cf11d 100644
--- a/packages/package_info_plus_tvos/example/tvos/Runner/Base.lproj/Main.storyboard
+++ b/packages/package_info_plus_tvos/example/tvos/Runner/Base.lproj/Main.storyboard
@@ -9,7 +9,6 @@
diff --git a/packages/package_info_plus_tvos/example/tvos/Runner/Info.plist b/packages/package_info_plus_tvos/example/tvos/Runner/Info.plist
index 7ddcb51..86b3135 100644
--- a/packages/package_info_plus_tvos/example/tvos/Runner/Info.plist
+++ b/packages/package_info_plus_tvos/example/tvos/Runner/Info.plist
@@ -32,6 +32,27 @@
-->
FLTAssetsPath
flutter_assets
+ UIApplicationSceneManifest
+
+ UIApplicationSupportsMultipleScenes
+
+ UISceneConfigurations
+
+ UIWindowSceneSessionRoleApplication
+
+
+ UISceneClassName
+ UIWindowScene
+ UISceneConfigurationName
+ flutter
+ UISceneDelegateClassName
+ FlutterSceneDelegate
+ UISceneStoryboardFile
+ Main
+
+
+
+
UIMainStoryboardFile
Main
UIRequiredDeviceCapabilities
diff --git a/packages/package_info_plus_tvos/example/tvos/Runner/MetalLibInterposer.h b/packages/package_info_plus_tvos/example/tvos/Runner/MetalLibInterposer.h
deleted file mode 100644
index c65f0d6..0000000
--- a/packages/package_info_plus_tvos/example/tvos/Runner/MetalLibInterposer.h
+++ /dev/null
@@ -1,13 +0,0 @@
-// MetalLibInterposer.h
-// Runtime swizzle to replace iOS-targeted Flutter Metal shaders with tvOS equivalents.
-
-#import
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface MetalLibInterposer : NSObject
-/// Install the Metal library interposer. Call this early in application:didFinishLaunching.
-+ (void)install;
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/packages/package_info_plus_tvos/example/tvos/Runner/MetalLibInterposer.m b/packages/package_info_plus_tvos/example/tvos/Runner/MetalLibInterposer.m
deleted file mode 100644
index 4629aec..0000000
--- a/packages/package_info_plus_tvos/example/tvos/Runner/MetalLibInterposer.m
+++ /dev/null
@@ -1,81 +0,0 @@
-// MetalLibInterposer.m
-// Runtime swizzle [MTLDevice newLibraryWithData:error:] so that the iOS-targeted
-// metallibs embedded in Flutter.framework are transparently replaced with
-// correctly-targeted tvOS metallib equivalents loaded from the app bundle.
-
-#import
-#import
-#import
-
-static NSDictionary *sOriginalSizeToName;
-static IMP sOriginalNewLibraryWithData;
-
-static id tvos_newLibraryWithData(id self, SEL _cmd,
- dispatch_data_t data,
- NSError **error) {
- size_t dataSize = dispatch_data_get_size(data);
- NSString *name = sOriginalSizeToName[@(dataSize)];
- if (name) {
- NSString *path = [[NSBundle mainBundle]
- pathForResource:name ofType:@"metallib"
- inDirectory:@"tvos_metallibs"];
- if (path) {
- NSData *tvosData = [NSData dataWithContentsOfFile:path];
- if (tvosData) {
- __block NSData *retained = tvosData;
- dispatch_data_t tvosDD = dispatch_data_create(
- retained.bytes, retained.length,
- dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0),
- ^{ (void)retained; });
-
- NSLog(@"[MetalLibInterposer] Replaced '%@' metallib: "
- @"iOS(%zu B) -> tvOS(%lu B)",
- name, dataSize, (unsigned long)tvosData.length);
-
- return ((id (*)(id, SEL, dispatch_data_t, NSError **))
- sOriginalNewLibraryWithData)(
- self, _cmd, tvosDD, error);
- }
- }
- NSLog(@"[MetalLibInterposer] WARNING: tvOS metallib '%@' not found in bundle!", name);
- }
- return ((id (*)(id, SEL, dispatch_data_t, NSError **))
- sOriginalNewLibraryWithData)(self, _cmd, data, error);
-}
-
-@interface MetalLibInterposer : NSObject
-@end
-
-@implementation MetalLibInterposer
-
-+ (void)load {
- sOriginalSizeToName = @{
- @8306 : @"compute",
- @251746: @"entity",
- @13794 : @"framebuffer_blend",
- @25567 : @"modern"
- };
-
- id device = MTLCreateSystemDefaultDevice();
- if (!device) {
- NSLog(@"[MetalLibInterposer] No Metal device — skipping.");
- return;
- }
-
- Class cls = [device class];
- SEL sel = @selector(newLibraryWithData:error:);
- Method m = class_getInstanceMethod(cls, sel);
- if (!m) {
- NSLog(@"[MetalLibInterposer] Could not find -newLibraryWithData:error: on %@",
- NSStringFromClass(cls));
- return;
- }
-
- sOriginalNewLibraryWithData =
- method_setImplementation(m, (IMP)tvos_newLibraryWithData);
-
- NSLog(@"[MetalLibInterposer] Installed on %@ — will replace 4 metallibs at runtime.",
- NSStringFromClass(cls));
-}
-
-@end
diff --git a/packages/package_info_plus_tvos/example/tvos/Runner/Runner-Bridging-Header.h b/packages/package_info_plus_tvos/example/tvos/Runner/Runner-Bridging-Header.h
index 60105aa..308a2a5 100644
--- a/packages/package_info_plus_tvos/example/tvos/Runner/Runner-Bridging-Header.h
+++ b/packages/package_info_plus_tvos/example/tvos/Runner/Runner-Bridging-Header.h
@@ -1,2 +1 @@
#import "GeneratedPluginRegistrant.h"
-#import "MetalLibInterposer.h"
diff --git a/packages/package_info_plus_tvos/pubspec.yaml b/packages/package_info_plus_tvos/pubspec.yaml
index e435538..9cde101 100644
--- a/packages/package_info_plus_tvos/pubspec.yaml
+++ b/packages/package_info_plus_tvos/pubspec.yaml
@@ -1,6 +1,6 @@
name: package_info_plus_tvos
description: "tvOS (Apple TV) implementation of the package_info_plus Flutter plugin, provided by flutter-tvos."
-version: 0.0.1
+version: 0.0.2
homepage: https://fluttertv.dev
repository: https://github.com/fluttertv/plugins/tree/main/packages/package_info_plus_tvos
issue_tracker: https://github.com/fluttertv/plugins/issues
diff --git a/packages/package_info_plus_tvos/tvos/Package.swift b/packages/package_info_plus_tvos/tvos/Package.swift
new file mode 100644
index 0000000..44242ed
--- /dev/null
+++ b/packages/package_info_plus_tvos/tvos/Package.swift
@@ -0,0 +1,32 @@
+// swift-tools-version: 5.9
+// Lets the package be consumed via Swift Package Manager. The target reuses
+// the same `Classes/` sources the CocoaPods podspec compiles, so both
+// dependency managers stay in sync from a single source tree.
+import PackageDescription
+
+let package = Package(
+ name: "package_info_plus_tvos",
+ platforms: [
+ .tvOS(.v13),
+ ],
+ products: [
+ .library(name: "package-info-plus-tvos", targets: ["package_info_plus_tvos"]),
+ ],
+ dependencies: [
+ // Lets the target import Flutter. flutter-tvos generates a FlutterFramework
+ // package (binary target wrapping Flutter.xcframework) as a sibling of this
+ // package under the app's ephemeral SwiftPM packages, so `../FlutterFramework`
+ // resolves at build time.
+ .package(name: "FlutterFramework", path: "../FlutterFramework"),
+ ],
+ targets: [
+ .target(
+ name: "package_info_plus_tvos",
+ dependencies: [
+ .product(name: "FlutterFramework", package: "FlutterFramework"),
+ ],
+ path: "Classes",
+ publicHeadersPath: "include/package_info_plus"
+ ),
+ ]
+)
diff --git a/packages/package_info_plus_tvos/tvos/package_info_plus_tvos.podspec b/packages/package_info_plus_tvos/tvos/package_info_plus_tvos.podspec
index 503627f..56c4904 100644
--- a/packages/package_info_plus_tvos/tvos/package_info_plus_tvos.podspec
+++ b/packages/package_info_plus_tvos/tvos/package_info_plus_tvos.podspec
@@ -6,7 +6,7 @@
#
Pod::Spec.new do |s|
s.name = 'package_info_plus_tvos'
- s.version = '0.0.1'
+ s.version = '0.0.2'
s.summary = 'tvOS implementation of package_info_plus.'
s.description = <<-DESC
tvOS implementation of package_info_plus, the federated platform