Skip to content

Commit

Permalink
[quick_actions] Add Swift Package Manager support (#6682)
Browse files Browse the repository at this point in the history
Adds SPM support. Does not include any package changes, to maintain compatibility with `stable`.

Also adds a missing `import` in a test; it looks like it was probabl/y compiling before due to bleed-through from the Cocoapod dependency, and switching to SPM broke it. The test references a UIKit type, so should definitely have been importing it.

Fixes flutter/flutter#146915
  • Loading branch information
stuartmorgan committed May 10, 2024
1 parent 75930f8 commit f1ca81a
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/quick_actions/quick_actions_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 1.1.0

* Adds Swift Package Manager compatibility.
* Updates minimum iOS version to 12.0 and minimum Flutter version to 3.16.6.

## 1.0.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import UIKit

@testable import quick_actions_ios

final class MockShortcutItemProvider: ShortcutItemProviding {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Downloaded by pub (not CocoaPods).
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/quick_actions' }
s.documentation_url = 'https://pub.dev/packages/quick_actions'
s.swift_version = '5.0'
s.source_files = 'Classes/**/*.swift'
s.source_files = 'quick_actions_ios/Sources/quick_actions_ios/*.swift'
s.xcconfig = {
'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift',
'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift',
}
s.dependency 'Flutter'
s.platform = :ios, '12.0'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.resource_bundles = {'quick_actions_ios_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
s.resource_bundles = {'quick_actions_ios_privacy' => ['quick_actions_ios/Sources/quick_actions_ios/Resources/PrivacyInfo.xcprivacy']}
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// 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: "quick_actions_ios",
platforms: [
.iOS("12.0")
],
products: [
.library(name: "quick-actions-ios", targets: ["quick_actions_ios"])
],
dependencies: [],
targets: [
.target(
name: "quick_actions_ios",
dependencies: [],
resources: [
.process("Resources")
]
)
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:pigeon/pigeon.dart';

@ConfigurePigeon(PigeonOptions(
dartOut: 'lib/messages.g.dart',
swiftOut: 'ios/Classes/messages.g.swift',
swiftOut: 'ios/quick_actions_ios/Sources/quick_actions_ios/messages.g.swift',
copyrightHeader: 'pigeons/copyright.txt',
))

Expand Down
2 changes: 1 addition & 1 deletion packages/quick_actions/quick_actions_ios/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: quick_actions_ios
description: An implementation for the iOS platform of the Flutter `quick_actions` plugin.
repository: https://github.com/flutter/packages/tree/main/packages/quick_actions/quick_actions_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 1.0.10
version: 1.1.0

environment:
sdk: ^3.2.3
Expand Down

0 comments on commit f1ca81a

Please sign in to comment.