Skip to content
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

[image_picker_ios] Adds Swift Package Manager compatibility to image_picker_ios #6617

Merged
merged 9 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker_ios/CHANGELOG.md
@@ -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
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
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 */;
}
@@ -0,0 +1,13 @@
{
"pins" : [
{
"identity" : "ocmock",
"kind" : "remoteSourceControl",
"location" : "https://github.com/erikdoe/ocmock",
"state" : {
"revision" : "ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a"
}
}
],
"version" : 2
}
@@ -0,0 +1,13 @@
{
"pins" : [
{
"identity" : "ocmock",
"kind" : "remoteSourceControl",
"location" : "https://github.com/erikdoe/ocmock",
"state" : {
"revision" : "ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a"
}
}
],
"version" : 2
}
Empty file.
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
@@ -0,0 +1,32 @@
// 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"),
.macOS("10.14"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No macOS for this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove it so there's less confusion, but just FYI this doesn't really do much. From my testing (I can't find any documentation on it), if a specific platform is left out of this list, SwiftPM will just assume the minimum version. It doesn't exclude it by platform or anything cool like that unfortunately - that could change, though

],
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")
]
)
]
)
@@ -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"
}
}
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
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