Skip to content

Commit 75930f8

Browse files
[url_launcher] Add Swift Package Manager support (flutter#6677)
Adds SPM support for both iOS and macOS. Also opportunistically updates the unit tests for macOS to match the changes made in flutter/packages#4959 since I noticed that they were failing when running locally. This will prevent issues when we update CI in the future. Fixes flutter#146916
1 parent a489d49 commit 75930f8

File tree

19 files changed

+86
-11
lines changed

19 files changed

+86
-11
lines changed

packages/url_launcher/url_launcher_ios/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.3.0
2+
3+
* Adds Swift Package Manager compatibility.
4+
15
## 6.2.5
26

37
* Adds explicit imports for UIKit.

packages/url_launcher/url_launcher_ios/ios/url_launcher_ios.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ A Flutter plugin for making the underlying platform (Android or iOS) launch a UR
1414
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_ios' }
1515
s.documentation_url = 'https://pub.dev/packages/url_launcher'
1616
s.swift_version = '5.0'
17-
s.source_files = 'Classes/**/*.swift'
17+
s.source_files = 'url_launcher_ios/Sources/**/*.swift'
1818
s.xcconfig = {
1919
'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift',
2020
'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift',
2121
}
2222
s.dependency 'Flutter'
2323
s.platform = :ios, '12.0'
2424
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
25-
s.resource_bundles = {'url_launcher_ios_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
25+
s.resource_bundles = {'url_launcher_ios_privacy' => ['url_launcher_ios/Sources/url_launcher_ios/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+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
// Copyright 2013 The Flutter Authors. All rights reserved.
5+
// Use of this source code is governed by a BSD-style license that can be
6+
// found in the LICENSE file.
7+
8+
import PackageDescription
9+
10+
let package = Package(
11+
name: "url_launcher_ios",
12+
platforms: [
13+
.iOS("12.0")
14+
],
15+
products: [
16+
.library(name: "url-launcher-ios", targets: ["url_launcher_ios"])
17+
],
18+
dependencies: [],
19+
targets: [
20+
.target(
21+
name: "url_launcher_ios",
22+
dependencies: [],
23+
resources: [
24+
.process("Resources")
25+
]
26+
)
27+
]
28+
)

packages/url_launcher/url_launcher_ios/pigeons/messages.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'package:pigeon/pigeon.dart';
66

77
@ConfigurePigeon(PigeonOptions(
88
dartOut: 'lib/src/messages.g.dart',
9-
swiftOut: 'ios/Classes/messages.g.swift',
9+
swiftOut: 'ios/url_launcher_ios/Sources/url_launcher_ios/messages.g.swift',
1010
copyrightHeader: 'pigeons/copyright.txt',
1111
))
1212

packages/url_launcher/url_launcher_ios/pubspec.yaml

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

77
environment:
88
sdk: ^3.2.3

0 commit comments

Comments
 (0)