Skip to content

Commit

Permalink
[image_picker_ios] Adds Swift Package Manager compatibility (#6696)
Browse files Browse the repository at this point in the history
Relands #6617.

Was reverted in hopes of fixing flutter/flutter#148003, but ended up being fixed by #6694.
  • Loading branch information
vashworth authored May 9, 2024
1 parent 4799c49 commit 6c4482a
Show file tree
Hide file tree
Showing 27 changed files with 110 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.8.11

* Adds Swift Package Manager compatibility.

## 0.8.10+1

* Fixes a possible crash when calling a picker method UIGraphicsImageRenderer if imageToScale is nil.
Expand Down
2 changes: 0 additions & 2 deletions packages/image_picker/image_picker_ios/example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ target 'Runner' do
target 'RunnerTests' do
platform :ios, '12.0'
inherit! :search_paths
# Pods for testing
pod 'OCMock', '~> 3.8.1'
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
7865C5FD294157BC0010E17F /* icnsImage.icns in Resources */ = {isa = PBXBuildFile; fileRef = 7865C5FB294157BB0010E17F /* icnsImage.icns */; };
7865C5FF294252A60010E17F /* proRawImage.dng in Resources */ = {isa = PBXBuildFile; fileRef = 7865C5FE294252A60010E17F /* proRawImage.dng */; };
7865C600294252A60010E17F /* proRawImage.dng in Resources */ = {isa = PBXBuildFile; fileRef = 7865C5FE294252A60010E17F /* proRawImage.dng */; };
78CF8D862BC5E7070051231B /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 78CF8D852BC5E7070051231B /* OCMock */; };
86430DF9272D71E9002D9D6C /* gifImage.gif in Resources */ = {isa = PBXBuildFile; fileRef = 9FC8F0E8229FA49E00C8D58F /* gifImage.gif */; };
86E9A893272754860017E6E0 /* PickerSaveImageToPathOperationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86E9A892272754860017E6E0 /* PickerSaveImageToPathOperationTests.m */; };
86E9A894272754A30017E6E0 /* webpImage.webp in Resources */ = {isa = PBXBuildFile; fileRef = 86E9A88F272747B90017E6E0 /* webpImage.webp */; };
Expand Down Expand Up @@ -129,6 +130,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
78CF8D862BC5E7070051231B /* OCMock in Frameworks */,
3A72BAD3FAE6E0FA9D80826B /* libPods-RunnerTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -291,6 +293,9 @@
334733F82668136400DCC49E /* PBXTargetDependency */,
);
name = RunnerTests;
packageProductDependencies = (
78CF8D852BC5E7070051231B /* OCMock */,
);
productName = RunnerTests;
productReference = 334733F22668136400DCC49E /* RunnerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
Expand Down Expand Up @@ -342,7 +347,7 @@
isa = PBXProject;
attributes = {
DefaultBuildSystemTypeForWorkspace = Original;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "The Flutter Authors";
TargetAttributes = {
334733F12668136400DCC49E = {
Expand Down Expand Up @@ -374,6 +379,9 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
78CF8D842BC5E7070051231B /* XCRemoteSwiftPackageReference "ocmock" */,
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -879,6 +887,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
78CF8D842BC5E7070051231B /* XCRemoteSwiftPackageReference "ocmock" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/erikdoe/ocmock";
requirement = {
kind = revision;
revision = ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
78CF8D852BC5E7070051231B /* OCMock */ = {
isa = XCSwiftPackageProductDependency;
package = 78CF8D842BC5E7070051231B /* XCRemoteSwiftPackageReference "ocmock" */;
productName = OCMock;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"pins" : [
{
"identity" : "ocmock",
"kind" : "remoteSourceControl",
"location" : "https://github.com/erikdoe/ocmock",
"state" : {
"revision" : "ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a"
}
}
],
"version" : 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"pins" : [
{
"identity" : "ocmock",
"kind" : "remoteSourceControl",
"location" : "https://github.com/erikdoe/ocmock",
"state" : {
"revision" : "ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a"
}
}
],
"version" : 2
}
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Downloaded by pub (not CocoaPods).
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/image_picker_ios' }
s.documentation_url = 'https://pub.dev/packages/image_picker_ios'
s.source_files = 'Classes/**/*.{h,m}'
s.public_header_files = 'Classes/**/*.h'
s.module_map = 'Classes/ImagePickerPlugin.modulemap'
s.source_files = 'image_picker_ios/Sources/image_picker_ios/**/*.{h,m}'
s.public_header_files = 'image_picker_ios/Sources/image_picker_ios/**/*.h'
s.module_map = 'image_picker_ios/Sources/image_picker_ios/include/ImagePickerPlugin.modulemap'
s.dependency 'Flutter'
s.platform = :ios, '12.0'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.resource_bundles = {'image_picker_ios_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
s.resource_bundles = {'image_picker_ios_privacy' => ['image_picker_ios/Sources/image_picker_ios/Resources/PrivacyInfo.xcprivacy']}
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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: "image_picker_ios",
platforms: [
.iOS("12.0")
],
products: [
.library(name: "image-picker-ios", targets: ["image_picker_ios"])
],
dependencies: [],
targets: [
.target(
name: "image_picker_ios",
dependencies: [],
exclude: ["include/ImagePickerPlugin.modulemap"],
resources: [
.process("Resources")
],
cSettings: [
.headerSearchPath("include/image_picker_ios")
]
)
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module image_picker_ios {
umbrella header "image_picker_ios-umbrella.h"

export *
module * { export * }

explicit module Test {
header "../FLTImagePickerPlugin_Test.h"
header "../FLTImagePickerImageUtil.h"
header "../FLTImagePickerMetaDataUtil.h"
header "../FLTImagePickerPhotoAssetUtil.h"
header "../FLTPHPickerSaveImageToPathOperation.h"
}
}
4 changes: 2 additions & 2 deletions packages/image_picker/image_picker_ios/pigeons/messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import 'package:pigeon/pigeon.dart';
@ConfigurePigeon(PigeonOptions(
dartOut: 'lib/src/messages.g.dart',
dartTestOut: 'test/test_api.g.dart',
objcHeaderOut: 'ios/Classes/messages.g.h',
objcSourceOut: 'ios/Classes/messages.g.m',
objcHeaderOut: 'ios/image_picker_ios/Sources/image_picker_ios/messages.g.h',
objcSourceOut: 'ios/image_picker_ios/Sources/image_picker_ios/messages.g.m',
objcOptions: ObjcOptions(
prefix: 'FLT',
),
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker_ios/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: image_picker_ios
description: iOS implementation of the image_picker plugin.
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 0.8.10+1
version: 0.8.11

environment:
sdk: ^3.3.0
Expand Down

0 comments on commit 6c4482a

Please sign in to comment.