Skip to content

Commit 48beaf0

Browse files
[geolocator_apple] Add swift package manager compatibility (#1630)
* chore: added swift package manager compatibility * chore: bump pubspec version * chore: added ephemeral to gitignore
1 parent d00760e commit 48beaf0

File tree

78 files changed

+190
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+190
-158
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ unlinked.ds
5858
unlinked_spec.ds
5959
flutter_export_environment.sh
6060
**/.flutter-plugins-dependencies
61+
**/Flutter/ephemeral/
6162

6263
# Android related
6364
gradle-wrapper.jar
@@ -95,6 +96,8 @@ GeneratedPluginRegistrant.java
9596
**/ios/ServiceDefinitions.json
9697
**/ios/Runner/GeneratedPluginRegistrant.*
9798
**/ios/Flutter/Flutter.podspec
99+
**/.build/
100+
**/.swiftpm/
98101

99102
# Firebase related
100103
.firebase/

geolocator_apple/CHANGELOG.md

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

37
* Removed deprecated `-[UIApplication openURL:]` dead code.
File renamed without changes.

geolocator_apple/ios/geolocator_apple.podspec renamed to geolocator_apple/darwin/geolocator_apple.podspec

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,24 @@
55
Pod::Spec.new do |s|
66
s.name = 'geolocator_apple'
77
s.version = '1.2.0'
8-
s.summary = 'Geolocation iOS plugin for Flutter.'
8+
s.summary = 'Geolocation iOS & macOS plugin for Flutter.'
99
s.description = <<-DESC
1010
Geolocation iOS plugin for Flutter. This plugin provides the Apple implementation for the geolocator plugin.
1111
DESC
1212
s.homepage = 'http://github.com/baseflow/flutter-geolocator'
1313
s.license = { :type => 'MIT', :file => '../LICENSE' }
1414
s.author = { 'Baseflow' => '[email protected]' }
1515
s.source = { :http => 'https://github.com/baseflow/flutter-geolocator/tree/master/' }
16-
s.source_files = 'Classes/**/*.{h,m}'
17-
s.public_header_files = 'Classes/**/*.h'
18-
s.module_map = 'Classes/GeolocatorPlugin.modulemap'
19-
s.dependency 'Flutter'
20-
s.platform = :ios, '11.0'
16+
s.source_files = 'geolocator_apple/Sources/geolocator_apple/**/*.{h,m}'
17+
s.public_header_files = 'geolocator_apple/Sources/geolocator_apple/include/**/*.h'
18+
s.module_map = 'geolocator_apple/Sources/geolocator_apple/include/GeolocatorPlugin.modulemap'
19+
20+
s.ios.dependency 'Flutter'
21+
s.osx.dependency 'FlutterMacOS'
22+
s.ios.deployment_target = '11.0'
23+
s.osx.deployment_target = '10.11'
2124

2225
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
2326
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386'}
24-
s.resource_bundles = {'geolocator_apple_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
27+
s.resource_bundles = {'geolocator_apple_privacy' => ['geolocator_apple/Sources/geolocator_apple/PrivacyInfo.xcprivacy']}
2528
end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "geolocator_apple",
8+
platforms: [
9+
.iOS("11.0"),
10+
.macOS("10.11")
11+
],
12+
products: [
13+
.library(name: "geolocator-apple", targets: ["geolocator_apple"])
14+
],
15+
dependencies: [],
16+
targets: [
17+
.target(
18+
name: "geolocator_apple",
19+
dependencies: [],
20+
resources: [
21+
.process("PrivacyInfo.xcprivacy")
22+
],
23+
publicHeadersPath: "include/geolocator_apple",
24+
cSettings: [
25+
.headerSearchPath("include/geolocator_apple")
26+
]
27+
)
28+
]
29+
)

geolocator_apple/ios/Classes/Constants/ErrorCodes.m renamed to geolocator_apple/darwin/geolocator_apple/Sources/geolocator_apple/Constants/ErrorCodes.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by Maurits van Beusekom on 24/06/2020.
66
//
77

8-
#import "ErrorCodes.h"
8+
#import "../include/geolocator_apple/Constants/ErrorCodes.h"
99

1010
NSString * const GeolocatorErrorLocationUpdateFailure = @"LOCATION_UPDATE_FAILURE";
1111
NSString * const GeolocatorErrorLocationServicesDisabled = @"LOCATION_SERVICES_DISABLED";

geolocator_apple/ios/Classes/GeolocatorPlugin.m renamed to geolocator_apple/darwin/geolocator_apple/Sources/geolocator_apple/GeolocatorPlugin.m

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#import <CoreLocation/CoreLocation.h>
2-
#import "GeolocatorPlugin.h"
3-
#import "GeolocatorPlugin_Test.h"
4-
#import "Constants/ErrorCodes.h"
5-
#import "Handlers/GeolocationHandler.h"
6-
#import "Handlers/PermissionHandler.h"
7-
#import "Handlers/PositionStreamHandler.h"
8-
#import "Utils/ActivityTypeMapper.h"
9-
#import "Utils/AuthorizationStatusMapper.h"
10-
#import "Utils/LocationAccuracyMapper.h"
11-
#import "Utils/LocationDistanceMapper.h"
12-
#import "Utils/LocationMapper.h"
13-
#import "Utils/PermissionUtils.h"
14-
#import "Handlers/LocationAccuracyHandler.h"
15-
#import "Handlers/LocationServiceStreamHandler.h"
2+
#import "./include/geolocator_apple/GeolocatorPlugin.h"
3+
#import "./include/geolocator_apple/GeolocatorPlugin_Test.h"
4+
#import "./include/geolocator_apple/Constants/ErrorCodes.h"
5+
#import "./include/geolocator_apple/Handlers/GeolocationHandler.h"
6+
#import "./include/geolocator_apple/Handlers/PermissionHandler.h"
7+
#import "./include/geolocator_apple/Handlers/PositionStreamHandler.h"
8+
#import "./include/geolocator_apple/Utils/ActivityTypeMapper.h"
9+
#import "./include/geolocator_apple/Utils/AuthorizationStatusMapper.h"
10+
#import "./include/geolocator_apple/Utils/LocationAccuracyMapper.h"
11+
#import "./include/geolocator_apple/Utils/LocationDistanceMapper.h"
12+
#import "./include/geolocator_apple/Utils/LocationMapper.h"
13+
#import "./include/geolocator_apple/Utils/PermissionUtils.h"
14+
#import "./include/geolocator_apple/Handlers/LocationAccuracyHandler.h"
15+
#import "./include/geolocator_apple/Handlers/LocationServiceStreamHandler.h"
1616

1717
@interface GeolocatorPlugin ()
1818

geolocator_apple/ios/Classes/Handlers/GeolocationHandler.m renamed to geolocator_apple/darwin/geolocator_apple/Sources/geolocator_apple/Handlers/GeolocationHandler.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// Created by Maurits van Beusekom on 20/06/2020.
66
//
77

8-
#import "GeolocationHandler.h"
9-
#import "GeolocationHandler_Test.h"
10-
#import "../Constants/ErrorCodes.h"
8+
#import "../include/geolocator_apple/Handlers/GeolocationHandler.h"
9+
#import "../include/geolocator_apple/Handlers/GeolocationHandler_Test.h"
10+
#import "../include/geolocator_apple/Constants/ErrorCodes.h"
1111

1212
double const kMaxLocationLifeTimeInSeconds = 5.0;
1313

geolocator_apple/ios/Classes/Handlers/LocationAccuracyHandler.m renamed to geolocator_apple/darwin/geolocator_apple/Sources/geolocator_apple/Handlers/LocationAccuracyHandler.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#import <Foundation/Foundation.h>
99
#import <CoreLocation/CoreLocation.h>
10-
#import "LocationAccuracyHandler.h"
11-
#import "ErrorCodes.h"
10+
#import "../include/geolocator_apple/Handlers/LocationAccuracyHandler.h"
11+
#import "../include/geolocator_apple/Constants/ErrorCodes.h"
1212

1313
@interface LocationAccuracyHandler()
1414
@property (strong, nonatomic) CLLocationManager *locationManager;

geolocator_apple/ios/Classes/Handlers/LocationServiceStreamHandler.m renamed to geolocator_apple/darwin/geolocator_apple/Sources/geolocator_apple/Handlers/LocationServiceStreamHandler.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#import <Foundation/Foundation.h>
99
#import <CoreLocation/CoreLocation.h>
10-
#import "LocationServiceStreamHandler.h"
11-
#import "../Utils/ServiceStatus.h"
10+
#import "../include/geolocator_apple/Handlers/LocationServiceStreamHandler.h"
11+
#import "../include/geolocator_apple/Utils/ServiceStatus.h"
1212

1313
@interface LocationServiceStreamHandler()
1414
@property (strong, nonatomic) CLLocationManager *locationManager;

0 commit comments

Comments
 (0)