Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(draft) (feat) Migrate to SPM (Swift Package Manager) #131

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions CapacitorCommunityBackgroundGeolocation.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
require 'json'

Pod::Spec.new do |s|
s.name = 'CapacitorCommunityBackgroundGeolocation'
s.version = '0.0.1'
s.summary = 'Capacitor plugin which lets you receive geolocation updates even while the app is backgrounded.'
s.license = 'MIT'
s.homepage = 'https://github.com/capacitor-community/background-geolocation'
s.author = 'James Diacono'
s.source = { :git => 'https://github.com/capacitor-community/background-geolocation', :tag => s.version.to_s }
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '12.0'
s.dependency 'Capacitor'
end
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = 'CapacitorCommunityBackgroundGeolocation'
s.version = package['version']
s.summary = package['description']
s.license = package['license']
s.homepage = package['repository']['url']
s.author = package['author']
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '14.0'
s.dependency 'Capacitor'
s.swift_version = '5.1'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to specify a Swift version?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably yes (but not sure) due to the new SPM structure.

end
28 changes: 28 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
name: "CapacitorCommunityBackgroundGeolocation",
platforms: [.iOS(.v14)],
products: [
.library(
name: "CapacitorCommunityBackgroundGeolocation",
targets: ["BackgroundGeolocationPlugin"])
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
],
targets: [
.target(
name: "BackgroundGeolocationPlugin",
dependencies: [
.product(name: "Capacitor", package: "capacitor-swift-pm"),
.product(name: "Cordova", package: "capacitor-swift-pm")
],
path: "ios/Sources/BackgroundGeolocationPlugin"),
.testTarget(
fabiomartino marked this conversation as resolved.
Show resolved Hide resolved
name: "BackgroundGeolocationPluginTests",
dependencies: ["BackgroundGeolocationPlugin"],
path: "ios/Tests/BackgroundGeolocationPluginTests")
]
)
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ Configration specific to Android can be made in `strings.xml`:

## Changelog

### v1.2.21
- Migrate iOS from cocoapods to SPM (Swift Package Manager).

### v1.2.20
- Fix for Capacitor@v7.

### v1.2.19
- Fix a bug preventing the foreground service starting on Android.

Expand Down
8 changes: 8 additions & 0 deletions ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
.build
/Packages
xcuserdata/
DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
fabiomartino marked this conversation as resolved.
Show resolved Hide resolved
Loading