Skip to content

Commit 3c29396

Browse files
authored
Merge pull request #7 from GEOSwift/feature/swift-pm
Add support for Swift PM
2 parents 39ebf11 + ac65210 commit 3c29396

File tree

12 files changed

+125
-32
lines changed

12 files changed

+125
-32
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ Carthage/Build
3030
# Swift Package Manager
3131

3232
.build/
33+
.swiftpm/

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.2.0
2+
3+
* [#7](https://github.com/GEOSwift/GEOSwiftMapKit/pull/7) Swift PM Support
4+
* Add support for Swift PM on iOS, tvOS, and macOS (Fixes
5+
[#4](https://github.com/GEOSwift/GEOSwiftMapKit/issues/4))
6+
17
## 1.1.0
28

39
* Relaxed GEOSwift dependency requirement for CocoaPods

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "GEOSwift/GEOSwift" ~> 5.0
1+
github "GEOSwift/GEOSwift" ~> 6.0

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "GEOSwift/GEOSwift" "5.2.0"
2-
github "GEOSwift/geos" "4.0.3"
1+
github "GEOSwift/GEOSwift" "6.0.0"
2+
github "GEOSwift/geos" "4.1.0"

GEOSwiftMapKit.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = 'GEOSwiftMapKit'
3-
s.version = '1.1.0'
4-
s.swift_version = '5.0'
3+
s.version = '1.2.0'
4+
s.swift_version = '5.1'
55
s.cocoapods_version = '>= 1.4.0'
66
s.summary = 'MapKit support for GEOSwift'
77
s.description = <<~DESC
@@ -22,5 +22,5 @@ Pod::Spec.new do |s|
2222
}
2323
s.source_files = 'GEOSwiftMapKit/*.{swift,h}'
2424
s.macos.exclude_files = 'GEOSwiftMapKit/GEOSwift+MapKitQuickLook.swift'
25-
s.dependency 'GEOSwift', '~> 5.0'
25+
s.dependency 'GEOSwift', '~> 6.0'
2626
end

GEOSwiftMapKit.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
493F2D3D22DC4A3C00BE38EA /* multilinestring.png in Resources */ = {isa = PBXBuildFile; fileRef = 493F2D3B22DC4A3C00BE38EA /* multilinestring.png */; };
1818
493F2D4022DC4A3C00BE38EA /* multipolygon.png in Resources */ = {isa = PBXBuildFile; fileRef = 493F2D3C22DC4A3C00BE38EA /* multipolygon.png */; };
1919
493F2D4422DC4BEB00BE38EA /* envelope.png in Resources */ = {isa = PBXBuildFile; fileRef = 493F2D4322DC4BEB00BE38EA /* envelope.png */; };
20+
49A3DE2C2378E6520031B8CD /* QuickLookTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49CF3D7222D10BDB0076F6E5 /* QuickLookTests.swift */; };
21+
49A3DE2D2378E6550031B8CD /* QuickLookTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49CF3D7222D10BDB0076F6E5 /* QuickLookTests.swift */; };
22+
49A3DE2E2378E65A0031B8CD /* GEOSwift+MapKitQuickLook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B1182F22C96BC100E638D7 /* GEOSwift+MapKitQuickLook.swift */; };
23+
49A3DE2F2378E65B0031B8CD /* GEOSwift+MapKitQuickLook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B1182F22C96BC100E638D7 /* GEOSwift+MapKitQuickLook.swift */; };
2024
49B1182C22C96B4E00E638D7 /* GEOSwift+MapKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B1182B22C96B4E00E638D7 /* GEOSwift+MapKit.swift */; };
2125
49B1182D22C96B4E00E638D7 /* GEOSwift+MapKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B1182B22C96B4E00E638D7 /* GEOSwift+MapKit.swift */; };
2226
49B1182E22C96B4E00E638D7 /* GEOSwift+MapKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B1182B22C96B4E00E638D7 /* GEOSwift+MapKit.swift */; };
@@ -628,6 +632,7 @@
628632
isa = PBXSourcesBuildPhase;
629633
buildActionMask = 2147483647;
630634
files = (
635+
49A3DE2E2378E65A0031B8CD /* GEOSwift+MapKitQuickLook.swift in Sources */,
631636
49B1182D22C96B4E00E638D7 /* GEOSwift+MapKit.swift in Sources */,
632637
);
633638
runOnlyForDeploymentPostprocessing = 0;
@@ -637,6 +642,7 @@
637642
buildActionMask = 2147483647;
638643
files = (
639644
49CF3D7022D10BC10076F6E5 /* MapKit+Equatable.swift in Sources */,
645+
49A3DE2C2378E6520031B8CD /* QuickLookTests.swift in Sources */,
640646
49CF3D7822D10BDB0076F6E5 /* GEOSwift+MapKitTests.swift in Sources */,
641647
);
642648
runOnlyForDeploymentPostprocessing = 0;
@@ -645,6 +651,7 @@
645651
isa = PBXSourcesBuildPhase;
646652
buildActionMask = 2147483647;
647653
files = (
654+
49A3DE2F2378E65B0031B8CD /* GEOSwift+MapKitQuickLook.swift in Sources */,
648655
49B1182E22C96B4E00E638D7 /* GEOSwift+MapKit.swift in Sources */,
649656
);
650657
runOnlyForDeploymentPostprocessing = 0;
@@ -654,6 +661,7 @@
654661
buildActionMask = 2147483647;
655662
files = (
656663
49CF3D7122D10BC10076F6E5 /* MapKit+Equatable.swift in Sources */,
664+
49A3DE2D2378E6550031B8CD /* QuickLookTests.swift in Sources */,
657665
49CF3D7922D10BDB0076F6E5 /* GEOSwift+MapKitTests.swift in Sources */,
658666
);
659667
runOnlyForDeploymentPostprocessing = 0;

GEOSwiftMapKit/GEOSwift+MapKitQuickLook.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if os(iOS)
2+
13
import UIKit
24
import MapKit
35
import GEOSwift
@@ -178,3 +180,5 @@ private extension MKMapView {
178180
return snapshotImage
179181
}
180182
}
183+
184+
#endif

GEOSwiftMapKit/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.1.0</string>
18+
<string>1.2.0</string>
1919
<key>CFBundleVersion</key>
2020
<string>1</string>
2121
</dict>

GEOSwiftMapKitTests/QuickLookTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Exclude these tests when running in Swift PM because it doesn't support bundle resources yet
2+
#if !SWIFT_PACKAGE && os(iOS)
3+
14
import XCTest
25
import MapKit
36
import GEOSwift
@@ -156,3 +159,5 @@ final class QuickLookTests: XCTestCase {
156159
}
157160
}
158161
}
162+
163+
#endif

Package.resolved

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// swift-tools-version:5.1
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "GEOSwiftMapKit",
6+
products: [
7+
.library(name: "GEOSwiftMapKit", targets: ["GEOSwiftMapKit"])
8+
],
9+
dependencies: [
10+
.package(url: "https://github.com/GEOSwift/GEOSwift.git", from: "6.0.0")
11+
],
12+
targets: [
13+
.target(
14+
name: "GEOSwiftMapKit",
15+
dependencies: ["GEOSwift"],
16+
path: "./GEOSwiftMapKit/"
17+
),
18+
.testTarget(
19+
name: "GEOSwiftMapKitTests",
20+
dependencies: ["GEOSwiftMapKit"],
21+
path: "./GEOSwiftMapKitTests/"
22+
)
23+
]
24+
)

README.md

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Cocoapods Compatible](https://img.shields.io/cocoapods/v/GEOSwiftMapKit)](https://cocoapods.org/pods/GEOSwiftMapKit)
44
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen)](https://github.com/Carthage/Carthage)
5+
[![SwiftPM Compatible](https://img.shields.io/badge/SwiftPM-compatible-4BC51D.svg?style=flat)](https://swift.org/package-manager/)
56
[![Supported Platforms](https://img.shields.io/cocoapods/p/GEOSwiftMapKit)](https://github.com/GEOSwift/GEOSwiftMapKit)
67
[![Build Status](https://img.shields.io/travis/GEOSwift/GEOSwiftMapKit/master)](https://travis-ci.org/GEOSwift/GEOSwiftMapKit)
78
[![Code Coverage](https://img.shields.io/codecov/c/github/GEOSwift/GEOSwiftMapKit/master)](https://codecov.io/gh/GEOSwift/GEOSwiftMapKit)
@@ -10,41 +11,47 @@ See [GEOSwift](https://github.com/GEOSwift/GEOSwift) for full details
1011

1112
## Requirements
1213

13-
* iOS 8.0+, tvOS 9.2+, macOS 10.9+
14-
* Xcode 10.2
15-
* Swift 5.0
14+
* iOS 8.0+, tvOS 9.2+, macOS 10.9+ (CocoaPods, Carthage, Swift PM)
15+
* Swift 5.1
16+
17+
> GEOS is licensed under LGPL 2.1 and its compatibility with static linking is
18+
at least controversial. Use of geos without dynamic linking is discouraged.
1619

1720
## Installation
1821

1922
### CocoaPods
2023

21-
1. Install autotools: `$ brew install autoconf automake libtool`
22-
2. Update your `Podfile` to include:
23-
24-
```
25-
use_frameworks!
26-
pod 'GEOSwiftMapKit'
27-
```
24+
1. Update your `Podfile` to include:
2825

29-
3. Run `$ pod install`
26+
use_frameworks!
27+
pod 'GEOSwiftMapKit'
3028

31-
> GEOS is a configure/install project licensed under LGPL 2.1: it is difficult to build for iOS and its compatibility with static linking is at least controversial. Use of GEOSwift without dynamic-framework-based CocoaPods and with a project targeting iOS 7, even if possible, is advised against.
29+
2. Run `$ pod install`
3230

3331
### Carthage
3432

35-
1. Install autotools: `$ brew install autoconf automake libtool`
36-
2. Add the following to your Cartfile:
33+
1. Add the following to your Cartfile:
3734

38-
```
39-
github "GEOSwift/GEOSwiftMapKit" ~> 1.1.0
40-
```
35+
github "GEOSwift/GEOSwiftMapKit" ~> 1.2.0
4136

42-
3. Finish updating your project by following the [typical Carthage
37+
2. Finish updating your project by following the [typical Carthage
4338
workflow](https://github.com/Carthage/Carthage#quick-start).
4439

40+
### Swift Package Manager
41+
42+
1. Update the top-level dependencies in your `Package.swift` to include:
43+
44+
.package(url: "https://github.com/GEOSwift/GEOSwiftMapKit.git", from: "1.2.0")
45+
46+
2. Update the target dependencies in your `Package.swift` to include
47+
48+
"GEOSwiftMapKit"
49+
4550
### Playground
4651

47-
Explore more, interactively, in the playground. It can be found inside `GEOSwiftMapKit` workspace. Open the workspace in Xcode, build the `GEOSwiftMapKit` framework and open the playground file.
52+
Explore more, interactively, in the playground. It can be found inside
53+
`GEOSwiftMapKit` workspace. Open the workspace in Xcode, build the
54+
`GEOSwiftMapKit` framework and open the playground file.
4855

4956
![Playground](/README-images/playground.png)
5057

@@ -53,12 +60,15 @@ Explore more, interactively, in the playground. It can be found inside `GEOSwift
5360
To make a contribution:
5461

5562
* Fork the repo
56-
* Start from the `develop` branch and create a branch with a name that describes your contribution
63+
* Start from the `develop` branch and create a branch with a name that describes
64+
your contribution
5765
* Run `$ carthage update`
58-
* Sign in to travis-ci.org (if you've never signed in before, CI won't run to verify your pull request)
66+
* Sign in to travis-ci.org (if you've never signed in before, CI won't run to
67+
verify your pull request)
5968
* Push your branch and create a pull request to develop
6069
* One of the maintainers will review your code and may request changes
61-
* If your pull request is accepted, one of the maintainers should update the changelog before merging it
70+
* If your pull request is accepted, one of the maintainers should update the
71+
changelog before merging it
6272

6373
## Maintainer
6474

@@ -67,9 +77,19 @@ To make a contribution:
6777
## Past Maintainers
6878

6979
* Virgilio Favero Neto ([@vfn](https://github.com/vfn))
70-
* Andrea Cremaschi ([@andreacremaschi](https://twitter.com/andreacremaschi)) (original author)
80+
* Andrea Cremaschi ([@andreacremaschi](https://twitter.com/andreacremaschi))
81+
(original author)
7182

7283
## License
7384

74-
* GEOSwift was released by Andrea Cremaschi ([@andreacremaschi](https://twitter.com/andreacremaschi)) under a MIT license. See LICENSE for more information.
75-
* [GEOS](http://trac.osgeo.org/geos/) stands for Geometry Engine - Open Source, and is a C++ library, ported from the [Java Topology Suite](http://sourceforge.net/projects/jts-topo-suite/). GEOS implements the OpenGIS [Simple Features for SQL](http://www.opengeospatial.org/standards/sfs) spatial predicate functions and spatial operators. GEOS, now an OSGeo project, was initially developed and maintained by [Refractions Research](http://www.refractions.net/) of Victoria, Canada.
85+
* GEOSwift was released by Andrea Cremaschi
86+
([@andreacremaschi](https://twitter.com/andreacremaschi)) under a MIT license.
87+
See LICENSE for more information.
88+
* [GEOS](http://trac.osgeo.org/geos/) stands for Geometry Engine - Open Source,
89+
and is a C++ library, ported from the
90+
[Java Topology Suite](http://sourceforge.net/projects/jts-topo-suite/). GEOS
91+
implements the OpenGIS
92+
[Simple Features for SQL](http://www.opengeospatial.org/standards/sfs) spatial
93+
predicate functions and spatial operators. GEOS, now an OSGeo project, was
94+
initially developed and maintained by
95+
[Refractions Research](http://www.refractions.net/) of Victoria, Canada.

0 commit comments

Comments
 (0)