-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[video_player_avfoundation] Adds Swift Package Manager compatibility #6634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
e9a4fe1
2cc1aa0
df171d2
356a233
d7274e5
074b22a
c2b86e1
094440d
9ec97b1
6bdd3a7
f867bbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 2.5.8 | ||
|
|
||
| * Adds Swift Package Manager compatibility. | ||
|
|
||
| ## 2.5.7 | ||
|
|
||
| * Adds frame availability checks on iOS. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,14 +14,14 @@ Downloaded by pub (not CocoaPods). | |
| s.author = { 'Flutter Dev Team' => '[email protected]' } | ||
| s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/video_player/video_player_avfoundation' } | ||
| s.documentation_url = 'https://pub.dev/packages/video_player' | ||
| s.source_files = 'Classes/*' | ||
| s.ios.source_files = 'Classes/ios/*' | ||
| s.osx.source_files = 'Classes/macos/*' | ||
| s.public_header_files = 'Classes/**/*.h' | ||
| s.source_files = 'video_player_avfoundation/Sources/video_player_avfoundation/**/*.{h,m}' | ||
| s.ios.source_files = 'video_player_avfoundation/Sources/video_player_avfoundation_ios/*' | ||
| s.osx.source_files = 'video_player_avfoundation/Sources/video_player_avfoundation_macos/*' | ||
| s.public_header_files = 'video_player_avfoundation/Sources/video_player_avfoundation/include/**/*.h' | ||
| s.ios.dependency 'Flutter' | ||
| s.osx.dependency 'FlutterMacOS' | ||
| s.ios.deployment_target = '12.0' | ||
| s.osx.deployment_target = '10.14' | ||
| s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } | ||
| s.resource_bundles = {'video_player_avfoundation_privacy' => ['Resources/PrivacyInfo.xcprivacy']} | ||
| s.resource_bundles = {'video_player_avfoundation_privacy' => ['video_player_avfoundation/Sources/video_player_avfoundation/Resources/PrivacyInfo.xcprivacy']} | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // swift-tools-version: 5.9 | ||
|
|
||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import PackageDescription | ||
|
|
||
| let package = Package( | ||
| name: "video_player_avfoundation", | ||
| platforms: [ | ||
| .iOS("12.0"), | ||
| .macOS("10.14"), | ||
| ], | ||
| products: [ | ||
| .library(name: "video-player-avfoundation", targets: ["video_player_avfoundation"]) | ||
| ], | ||
| dependencies: [], | ||
| targets: [ | ||
| .target( | ||
| name: "video_player_avfoundation", | ||
| dependencies: [ | ||
| .target(name: "video_player_avfoundation_ios", condition: .when(platforms: [.iOS])), | ||
| .target(name: "video_player_avfoundation_macos", condition: .when(platforms: [.macOS])), | ||
| ], | ||
| resources: [ | ||
| .process("Resources") | ||
| ], | ||
| cSettings: [ | ||
| .headerSearchPath("include/video_player_avfoundation") | ||
| ] | ||
| ), | ||
| .target( | ||
| name: "video_player_avfoundation_ios", | ||
| cSettings: [ | ||
| .headerSearchPath("../video_player_avfoundation/include/video_player_avfoundation") | ||
| ] | ||
| ), | ||
| .target( | ||
| name: "video_player_avfoundation_macos", | ||
| cSettings: [ | ||
| .headerSearchPath("../video_player_avfoundation/include/video_player_avfoundation") | ||
| ] | ||
| ), | ||
| ] | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,9 +8,9 @@ | |
| #import <AVFoundation/AVFoundation.h> | ||
| #import <GLKit/GLKit.h> | ||
|
|
||
| #import "AVAssetTrackUtils.h" | ||
| #import "FVPDisplayLink.h" | ||
| #import "messages.g.h" | ||
| #import "./include/video_player_avfoundation/AVAssetTrackUtils.h" | ||
| #import "./include/video_player_avfoundation/FVPDisplayLink.h" | ||
| #import "./include/video_player_avfoundation/messages.g.h" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we know why include paths aren't taking care of this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So for most of the headers, include paths is sufficient. However, So I decided to change all of them to relative paths to keep it uniform |
||
|
|
||
| #if !__has_feature(objc_arc) | ||
| #error Code Requires ARC. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| // Autogenerated from Pigeon (v18.0.0), do not edit directly. | ||
| // See also: https://pub.dev/packages/pigeon | ||
|
|
||
| #import "messages.g.h" | ||
| #import "./include/video_player_avfoundation/messages.g.h" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed this manually. This will get overwritten by pigeon until flutter/flutter#147587 is fixed. |
||
|
|
||
| #if TARGET_OS_OSX | ||
| #import <FlutterMacOS/FlutterMacOS.h> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| /* Begin PBXBuildFile section */ | ||
| 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; | ||
| 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; | ||
| 78CF8D742BC5CEA80051231B /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 78CF8D732BC5CEA80051231B /* OCMock */; }; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: pbxproj file does not contain Swift Package Manager migration changes so that it will continue to build with stable. Migration will happen on the fly. |
||
| 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; | ||
| 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; | ||
| 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; | ||
|
|
@@ -99,6 +100,7 @@ | |
| isa = PBXFrameworksBuildPhase; | ||
| buildActionMask = 2147483647; | ||
| files = ( | ||
| 78CF8D742BC5CEA80051231B /* OCMock in Frameworks */, | ||
| D182ECB59C06DBC7E2D5D913 /* libPods-RunnerTests.a in Frameworks */, | ||
| ); | ||
| runOnlyForDeploymentPostprocessing = 0; | ||
|
|
@@ -260,6 +262,9 @@ | |
| F7151F4026603ECA0028CB91 /* PBXTargetDependency */, | ||
| ); | ||
| name = RunnerTests; | ||
| packageProductDependencies = ( | ||
| 78CF8D732BC5CEA80051231B /* OCMock */, | ||
| ); | ||
| productName = RunnerTests; | ||
| productReference = F7151F3A26603ECA0028CB91 /* RunnerTests.xctest */; | ||
| productType = "com.apple.product-type.bundle.unit-test"; | ||
|
|
@@ -297,6 +302,9 @@ | |
| Base, | ||
| ); | ||
| mainGroup = 97C146E51CF9000F007C117D; | ||
| packageReferences = ( | ||
| 78CF8D722BC5CEA80051231B /* XCRemoteSwiftPackageReference "ocmock" */, | ||
| ); | ||
| productRefGroup = 97C146EF1CF9000F007C117D /* Products */; | ||
| projectDirPath = ""; | ||
| projectRoot = ""; | ||
|
|
@@ -758,6 +766,25 @@ | |
| defaultConfigurationName = Release; | ||
| }; | ||
| /* End XCConfigurationList section */ | ||
|
|
||
| /* Begin XCRemoteSwiftPackageReference section */ | ||
| 78CF8D722BC5CEA80051231B /* XCRemoteSwiftPackageReference "ocmock" */ = { | ||
| isa = XCRemoteSwiftPackageReference; | ||
| repositoryURL = "https://github.com/erikdoe/ocmock"; | ||
| requirement = { | ||
| kind = revision; | ||
| revision = ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a; | ||
| }; | ||
| }; | ||
| /* End XCRemoteSwiftPackageReference section */ | ||
|
|
||
| /* Begin XCSwiftPackageProductDependency section */ | ||
| 78CF8D732BC5CEA80051231B /* OCMock */ = { | ||
| isa = XCSwiftPackageProductDependency; | ||
| package = 78CF8D722BC5CEA80051231B /* XCRemoteSwiftPackageReference "ocmock" */; | ||
| productName = OCMock; | ||
| }; | ||
| /* End XCSwiftPackageProductDependency section */ | ||
| }; | ||
| rootObject = 97C146E61CF9000F007C117D /* Project object */; | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |
| import Cocoa | ||
| import FlutterMacOS | ||
|
|
||
| @NSApplicationMain | ||
| @main | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| class AppDelegate: FlutterAppDelegate { | ||
| override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { | ||
| return true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ name: video_player_avfoundation | |
| description: iOS and macOS implementation of the video_player plugin. | ||
| repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_avfoundation | ||
| issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 | ||
| version: 2.5.7 | ||
| version: 2.5.8 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional: I would probably make this a minor bump, since it's more of a new feature than a fix. |
||
|
|
||
| environment: | ||
| sdk: ^3.2.3 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, so SPM doesn't allow source filtering without making separate targets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, it doesn't allow you to conditionalize by platform very much, only target dependencies, CSettings, CXXSettings, SwiftSettings, and LinkerSettings.
Sources can only be nil or an array of strings