Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/package_info_plus_tvos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 8 additions & 1 deletion packages/package_info_plus_tvos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

This file was deleted.

10 changes: 7 additions & 3 deletions packages/package_info_plus_tvos/example/tvos/Podfile
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand All @@ -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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<objects>
<viewController id="BYZ-38-t0r"
customClass="FlutterViewController"
customModule="Flutter" customModuleProvider="framework"
sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
Expand Down
21 changes: 21 additions & 0 deletions packages/package_info_plus_tvos/example/tvos/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@
-->
<key>FLTAssetsPath</key>
<string>flutter_assets</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneClassName</key>
<string>UIWindowScene</string>
<key>UISceneConfigurationName</key>
<string>flutter</string>
<key>UISceneDelegateClassName</key>
<string>FlutterSceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#import "GeneratedPluginRegistrant.h"
#import "MetalLibInterposer.h"
2 changes: 1 addition & 1 deletion packages/package_info_plus_tvos/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
32 changes: 32 additions & 0 deletions packages/package_info_plus_tvos/tvos/Package.swift
Original file line number Diff line number Diff line change
@@ -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"
),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading