Skip to content

Commit

Permalink
[image_picker_ios] Re-adds Swift Package Manager compatibility (flutt…
Browse files Browse the repository at this point in the history
…er#6833)

Adds Swift Package Manager compatibility to `image_picker_ios`.

The previous attempt, flutter#6617, was partially reverted due to flutter/flutter#148307. This reland uses the new approach proposed in flutter/flutter#148572: the Swift Package Manager package does not have a `.modulemap`. As a result, the plugin no longer has a `.Test` submodule if using Swift Package Manager.

Fixes flutter/flutter#146919.
  • Loading branch information
loic-sharma authored May 31, 2024
1 parent d8e8e8c commit 6872c3b
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 1 deletion.
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.12

* Re-adds Swift Package Manager compatibility.

## 0.8.11+2

* Temporarily remove Swift Package Manager compatibility to resolve issues with Cocoapods builds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#import "ImagePickerTestImages.h"

@import image_picker_ios;
#if __has_include(<image_picker_ios/image_picker_ios-umbrella.h>)
@import image_picker_ios.Test;
#endif
@import UniformTypeIdentifiers;
@import XCTest;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#import "ImagePickerTestImages.h"

@import image_picker_ios;
#if __has_include(<image_picker_ios/image_picker_ios-umbrella.h>)
@import image_picker_ios.Test;
#endif
@import XCTest;

// Corner colors of test image scaled to 3x2. Format is "R G B A".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#import "ImagePickerTestImages.h"

@import image_picker_ios;
#if __has_include(<image_picker_ios/image_picker_ios-umbrella.h>)
@import image_picker_ios.Test;
#endif
@import XCTest;

@interface MetaDataUtilTests : XCTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#import "ImagePickerTestImages.h"

@import image_picker_ios;
#if __has_include(<image_picker_ios/image_picker_ios-umbrella.h>)
@import image_picker_ios.Test;
#endif
@import XCTest;

@interface PhotoAssetUtilTests : XCTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#import <OCMock/OCMock.h>

@import image_picker_ios;
#if __has_include(<image_picker_ios/image_picker_ios-umbrella.h>)
@import image_picker_ios.Test;
#endif
@import UniformTypeIdentifiers;
@import XCTest;

Expand Down
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/image_picker_ios-umbrella.h", "include/ImagePickerPlugin.modulemap"],
resources: [
.process("Resources")
],
cSettings: [
.headerSearchPath("include/image_picker_ios")
]
)
]
)
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.11+2
version: 0.8.12

environment:
sdk: ^3.3.0
Expand Down

0 comments on commit 6872c3b

Please sign in to comment.