Skip to content

Commit 8de142d

Browse files
[path_provider] Add Swift Package Manager support (#6680)
Adds SPM support for iOS and macOS. No Xcode project changes are included, to maintain compatibility with `stable`. Fixes flutter/flutter#146913
1 parent 4595c41 commit 8de142d

File tree

8 files changed

+35
-5
lines changed

8 files changed

+35
-5
lines changed

packages/path_provider/path_provider_foundation/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## NEXT
1+
## 2.4.0
22

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

56
## 2.3.2

packages/path_provider/path_provider_foundation/darwin/path_provider_foundation.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
1212
s.license = { :type => 'BSD', :file => '../LICENSE' }
1313
s.author = { 'Flutter Dev Team' => '[email protected]' }
1414
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_foundation' }
15-
s.source_files = 'Classes/**/*'
15+
s.source_files = 'path_provider_foundation/Sources/path_provider_foundation/**/*.swift'
1616
s.ios.dependency 'Flutter'
1717
s.osx.dependency 'FlutterMacOS'
1818
s.ios.deployment_target = '12.0'
@@ -22,5 +22,5 @@ Pod::Spec.new do |s|
2222
'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift',
2323
}
2424
s.swift_version = '5.0'
25-
s.resource_bundles = {'path_provider_foundation_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
25+
s.resource_bundles = {'path_provider_foundation_privacy' => ['path_provider_foundation/Sources/path_provider_foundation/Resources/PrivacyInfo.xcprivacy']}
2626
end
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// swift-tools-version: 5.9
2+
3+
// Copyright 2013 The Flutter Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style license that can be
5+
// found in the LICENSE file.
6+
7+
import PackageDescription
8+
9+
let package = Package(
10+
name: "path_provider_foundation",
11+
platforms: [
12+
.iOS("12.0"),
13+
.macOS("10.14"),
14+
],
15+
products: [
16+
.library(name: "path-provider-foundation", targets: ["path_provider_foundation"])
17+
],
18+
dependencies: [],
19+
targets: [
20+
.target(
21+
name: "path_provider_foundation",
22+
dependencies: [],
23+
resources: [
24+
.process("Resources")
25+
]
26+
)
27+
]
28+
)

packages/path_provider/path_provider_foundation/pigeons/messages.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import 'package:pigeon/pigeon.dart';
55

66
@ConfigurePigeon(PigeonOptions(
77
input: 'pigeons/messages.dart',
8-
swiftOut: 'macos/Classes/messages.g.swift',
8+
swiftOut:
9+
'darwin/path_provider_foundation/Sources/path_provider_foundation/messages.g.swift',
910
dartOut: 'lib/messages.g.dart',
1011
dartTestOut: 'test/messages_test.g.dart',
1112
copyrightHeader: 'pigeons/copyright.txt',

packages/path_provider/path_provider_foundation/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: path_provider_foundation
22
description: iOS and macOS implementation of the path_provider plugin
33
repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_foundation
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22
5-
version: 2.3.2
5+
version: 2.4.0
66

77
environment:
88
sdk: ^3.2.3

0 commit comments

Comments
 (0)