Skip to content

Commit ea35fc6

Browse files
authored
[camera_avfoundation] Adds Swift Package Manager compatibility (flutter#7080)
Adds Swift Package Manager support to `camera_avfoundation`. This does not migrate the example app's Xcode project to use Swift Package Manager, that's tracked by flutter#148021. Fixes flutter#146902
1 parent 57d42e4 commit ea35fc6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+133
-33
lines changed

packages/camera/camera_avfoundation/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.9.17
2+
3+
* Adds Swift Package Manager compatibility.
4+
15
## 0.9.16+3
26

37
* Removes unused `maxVideoDuration` code.

packages/camera/camera_avfoundation/example/ios/Podfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ target 'Runner' do
3232

3333
target 'RunnerTests' do
3434
inherit! :search_paths
35-
# Pods for testing
36-
pod 'OCMock', '~> 3.8.1'
3735
end
3836
end
3937

packages/camera/camera_avfoundation/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
25C3919135C3D981E6F800D0 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1944D8072499F3B5E7653D44 /* libPods-RunnerTests.a */; };
1515
334733EA2668111C00DCC49E /* CameraOrientationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 03BB767226653ABE00CE5A93 /* CameraOrientationTests.m */; };
1616
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
17+
408D7A792C3C9CD000B71F9A /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 408D7A782C3C9CD000B71F9A /* OCMock */; };
1718
43ED1537282570DE00EB00DE /* AvailableCamerasTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 43ED1536282570DE00EB00DE /* AvailableCamerasTest.m */; };
1819
788A065A27B0E02900533D74 /* StreamingTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 788A065927B0E02900533D74 /* StreamingTest.m */; };
1920
7D5FCCD42AEF9D0200FB7108 /* CameraSettingsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D5FCCD32AEF9D0200FB7108 /* CameraSettingsTests.m */; };
@@ -106,6 +107,7 @@
106107
isa = PBXFrameworksBuildPhase;
107108
buildActionMask = 2147483647;
108109
files = (
110+
408D7A792C3C9CD000B71F9A /* OCMock in Frameworks */,
109111
25C3919135C3D981E6F800D0 /* libPods-RunnerTests.a in Frameworks */,
110112
);
111113
runOnlyForDeploymentPostprocessing = 0;
@@ -241,6 +243,9 @@
241243
03BB766E2665316900CE5A93 /* PBXTargetDependency */,
242244
);
243245
name = RunnerTests;
246+
packageProductDependencies = (
247+
408D7A782C3C9CD000B71F9A /* OCMock */,
248+
);
244249
productName = camera_exampleTests;
245250
productReference = 03BB76682665316900CE5A93 /* RunnerTests.xctest */;
246251
productType = "com.apple.product-type.bundle.unit-test";
@@ -295,6 +300,9 @@
295300
Base,
296301
);
297302
mainGroup = 97C146E51CF9000F007C117D;
303+
packageReferences = (
304+
408D7A772C3C9CD000B71F9A /* XCRemoteSwiftPackageReference "ocmock" */,
305+
);
298306
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
299307
projectDirPath = "";
300308
projectRoot = "";
@@ -733,6 +741,25 @@
733741
defaultConfigurationName = Release;
734742
};
735743
/* End XCConfigurationList section */
744+
745+
/* Begin XCRemoteSwiftPackageReference section */
746+
408D7A772C3C9CD000B71F9A /* XCRemoteSwiftPackageReference "ocmock" */ = {
747+
isa = XCRemoteSwiftPackageReference;
748+
repositoryURL = "https://github.com/erikdoe/ocmock";
749+
requirement = {
750+
kind = revision;
751+
revision = fe1661a3efed11831a6452f4b1a0c5e6ddc08c3d;
752+
};
753+
};
754+
/* End XCRemoteSwiftPackageReference section */
755+
756+
/* Begin XCSwiftPackageProductDependency section */
757+
408D7A782C3C9CD000B71F9A /* OCMock */ = {
758+
isa = XCSwiftPackageProductDependency;
759+
package = 408D7A772C3C9CD000B71F9A /* XCRemoteSwiftPackageReference "ocmock" */;
760+
productName = OCMock;
761+
};
762+
/* End XCSwiftPackageProductDependency section */
736763
};
737764
rootObject = 97C146E61CF9000F007C117D /* Project object */;
738765
}

packages/camera/camera_avfoundation/example/ios/RunnerTests/AvailableCamerasTest.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// found in the LICENSE file.
44

55
@import camera_avfoundation;
6+
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
67
@import camera_avfoundation.Test;
8+
#endif
79
@import XCTest;
810
@import AVFoundation;
911
#import <OCMock/OCMock.h>

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraCaptureSessionQueueRaceConditionTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// found in the LICENSE file.
44

55
@import camera_avfoundation;
6+
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
67
@import camera_avfoundation.Test;
8+
#endif
79
@import XCTest;
810

911
@interface CameraCaptureSessionQueueRaceConditionTests : XCTestCase

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraFocusTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// found in the LICENSE file.
44

55
@import camera_avfoundation;
6+
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
67
@import camera_avfoundation.Test;
8+
#endif
79
@import XCTest;
810
@import AVFoundation;
911
#import <OCMock/OCMock.h>

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraMethodChannelTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// found in the LICENSE file.
44

55
@import camera_avfoundation;
6+
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
67
@import camera_avfoundation.Test;
8+
#endif
79
@import XCTest;
810
@import AVFoundation;
911
#import <OCMock/OCMock.h>

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraOrientationTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// found in the LICENSE file.
44

55
@import camera_avfoundation;
6+
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
67
@import camera_avfoundation.Test;
8+
#endif
79
@import XCTest;
810
@import Flutter;
911

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraPermissionTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// found in the LICENSE file.
44

55
@import camera_avfoundation;
6+
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
67
@import camera_avfoundation.Test;
8+
#endif
79
@import AVFoundation;
810
@import XCTest;
911
#import <OCMock/OCMock.h>

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraPreviewPauseTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// found in the LICENSE file.
44

55
@import camera_avfoundation;
6+
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
67
@import camera_avfoundation.Test;
8+
#endif
79
@import XCTest;
810
@import AVFoundation;
911
#import <OCMock/OCMock.h>

0 commit comments

Comments
 (0)