Skip to content

Swift Package Support and NS_ENUM Fix #8

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 0 additions & 25 deletions .github/workflows/build-test.yml

This file was deleted.

12 changes: 4 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Utilities
run: |
brew install automake
brew install libtool
- name: Install
run: pod install
uses: actions/checkout@v4
- name: Build
run: xcodebuild build-for-testing -workspace sf-proj-ios.xcworkspace -scheme sf-proj-ios -destination 'platform=iOS Simulator,OS=latest,name=iPhone 14'
run: swift build
- name: Test
run: swift test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Pods
xcuserdata/
*.swp
Carthage/
.build/
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ Adheres to [Semantic Versioning](http://semver.org/).

---

## 6.0.4 (TBD)
## 7.0.0 (5-7-2025)

* TBD
* Swift Package Manager support
* sf-ios 5.0.0 (Breaking change for NS_ENUM symbol exposure to Swift)

## [6.0.3](https://github.com/ngageoint/simple-features-proj-ios/releases/tag/6.0.3) (04-09-2024)

Expand Down
Empty file removed Cartfile
Empty file.
Empty file removed Cartfile.resolved
Empty file.
42 changes: 42 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"originHash" : "35b9dd92a10bb66c1c7849915b5a67aa69cef5ec90397a488890b2a1ea84afed",
"pins" : [
{
"identity" : "coordinate-reference-systems-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ngageoint/coordinate-reference-systems-ios.git",
"state" : {
"branch" : "psolt/package",
"revision" : "94b2358cdc0e78a231398cccb51b2c816d77094b"
}
},
{
"identity" : "proj",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ngageoint/PROJ.git",
"state" : {
"branch" : "9.4.0_release_spm",
"revision" : "66106ff17c4bee88f24e6b130cea54d0de5d8170"
}
},
{
"identity" : "projections-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ngageoint/projections-ios",
"state" : {
"branch" : "psolt/package",
"revision" : "523cf293b7ff118fc8bab82f8d89e6f2cb518617"
}
},
{
"identity" : "simple-features-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ngageoint/simple-features-ios",
"state" : {
"branch" : "psolt/v5-NS_ENUM_Package",
"revision" : "0050585703585a94bca5c8530a6c45de10c0293c"
}
}
],
"version" : 3
}
54 changes: 54 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// swift-tools-version: 5.10

import PackageDescription

let package = Package(
name: "SimpleFeaturesProjections",
platforms: [
.iOS(.v13), .macOS(.v12)
],
products: [
.library(
name: "SimpleFeaturesProjections",
targets: ["SimpleFeaturesProjections"])
],
dependencies: [
.package(url: "https://github.com/ngageoint/simple-features-ios", branch: "psolt/v5-NS_ENUM_Package"),
// FIXME: Update to published release (5.0.0 version)
.package(url: "https://github.com/ngageoint/projections-ios", branch: "psolt/package")
],
targets: [
.target(
name: "SimpleFeaturesProjections",
dependencies: [
.product(name: "SimpleFeatures", package: "simple-features-ios"),
.product(name: "Projections", package: "projections-ios")
],
path: "sf-proj-ios"
),
.testTarget(
name: "SimpleFeaturesProjectionsTests",
dependencies: [
"SimpleFeaturesProjections",
"TestUtils"
],
path: "sf-proj-iosTests"
),
.testTarget(
name: "SimpleFeaturesProjectionsTestsSwift",
dependencies: [
"SimpleFeaturesProjections",
"TestUtils"
],
path: "sf-proj-iosTests-swift"
),
.target(
name: "TestUtils",
dependencies: [
"SimpleFeaturesProjections"
],
path: "TestUtils",
publicHeadersPath: ""
)
]
)
11 changes: 0 additions & 11 deletions Podfile

This file was deleted.

60 changes: 25 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,58 +42,48 @@ SFGeometry *transformed = [transform transformGeometry:geometry];

### Build ###

[![Build & Test](https://github.com/ngageoint/simple-features-proj-ios/workflows/Build%20&%20Test/badge.svg)](https://github.com/ngageoint/simple-features-proj-ios/actions/workflows/build-test.yml)
[![Build](https://github.com/ngageoint/simple-features-proj-ios/workflows/Build/badge.svg)](https://github.com/ngageoint/simple-features-proj-ios/actions/workflows/build.yml)

**IMPORTANT** -
Be sure your Mac has the `autoconf`, `automake`, and `glibtoolize` utilities. These are required to build
the [PROJ](https://github.com/ngageoint/PROJ) dependency. Without them, `pod install` will fail. The easiest way to get these is to [`brew install`](https://brew.sh/) them:
```
brew install automake
brew install libtool
```

Build this repository using Xcode and/or CocoaPods:

pod repo update
pod install

Open sf-proj-ios.xcworkspace in Xcode or build from command line:
Build this repository using Swift Package Manager:

xcodebuild -workspace 'sf-proj-ios.xcworkspace' -scheme sf-proj-ios build
swift build

Run tests from Xcode or from command line:

xcodebuild test -workspace 'sf-proj-ios.xcworkspace' -scheme sf-proj-ios -destination 'platform=iOS Simulator,name=iPhone 15'
swift test

### Include Library ###

See the [above note](https://github.com/ngageoint/simple-features-proj-ios#build) about `automake` and `glibtoolize`.

Include this repository by specifying it in a Podfile using a supported option.
Open the Swift Package in Xcode from command line:

Pull from [CocoaPods](https://cocoapods.org/pods/sf-proj-ios):
open Package.swift

pod 'sf-proj-ios', '~> 6.0.3'

If you use `use_modular_headers!` in your Podfile, disable modular headers for the [PROJ](https://github.com/ngageoint/PROJ) dependency:
### Include Library ###

pod 'sf-proj-ios', '~> 6.0.3'
pod 'PROJ', :modular_headers => false
Use this library via SPM in your Package.swift:

Pull from GitHub:
dependencies: [
.package(url: "https://github.com/ngageoint/simple-features-proj-ios.git", branch: "release/7.0.0"),
]

Or as a tagged release:

pod 'sf-proj-ios', :git => 'https://github.com/ngageoint/simple-features-proj-ios.git', :branch => 'master'
pod 'sf-proj-ios', :git => 'https://github.com/ngageoint/simple-features-proj-ios.git', :tag => '6.0.3'
dependencies: [
.package(url: "https://github.com/ngageoint/simple-features-proj-ios.git", from: "7.0.0"),
]

Include as local project:
Reference it in your Package.swift target:

pod 'sf-proj-ios', :path => '../simple-features-proj-ios'
.target(
name: "projections",
dependencies: [
.product(name: "SimpleFeaturesProjections", package: "simple-features-proj-ios"),
],
),

### Swift ###

To use from Swift, import the sf-proj-ios bridging header from the Swift project's bridging header
To use from Swift:

#import "sf-proj-ios-Bridging-Header.h"
import SimpleFeaturesProjections

#### Transform ####

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2015 NGA. All rights reserved.
//

#import "SFPolygon.h"
#import <SimpleFeatures/SimpleFeatures.h>

@interface SFPTestUtils : NSObject

Expand Down
File renamed without changes.
22 changes: 0 additions & 22 deletions sf-proj-ios.podspec

This file was deleted.

Loading