-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[video_player_avfoundation] Adds Swift Package Manager compatibility #6675
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 all commits
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.6.0 | ||
|
|
||
| * Adds Swift Package Manager compatibility. | ||
|
|
||
| ## 2.5.7 | ||
|
|
||
| * Adds frame availability checks on iOS. | ||
|
|
||
| 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" | ||
|
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. Comment from previous PR by @stuartmorgan:
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
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. I'm a little surprised the compilation doesn't scope the search to just the module. Maybe it's the way we have to make all the headers public to make our unit tests work? We could consider using a different naming convention for Obj-C out from Pigeon in our repo to give them unique names to avoid this, but relative paths are fine too. |
||
|
|
||
| #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.6.0 | ||
|
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. Comment from previous PR by @stuartmorgan:
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 it to a minor bump |
||
|
|
||
| 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.
Comment from previous PR by @stuartmorgan:
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