Skip to content
Merged
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 proj-ios.xcworkspace -scheme proj-ios -destination 'platform=iOS Simulator,OS=latest,name=iPhone 14'
run: swift build
- name: Test
run: swift test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Pods
xcuserdata/
*.swp
Carthage/
.build/
.swiftpm/
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Adheres to [Semantic Versioning](http://semver.org/).

---

## 2.0.4 (TBD)

* TBD
## 3.0.0
* Refactored to support Swift Package Manager because Cocoapods are deprecated
* Restructuring files to better align with SPM format and updating header includes
* Renamed framework Projections since dashes break resource bundle paths in SPM.

## [2.0.3](https://github.com/ngageoint/projections-ios/releases/tag/2.0.3) (04-09-2024)

Expand Down
Empty file removed Cartfile
Empty file.
Empty file removed Cartfile.resolved
Empty file.
24 changes: 24 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

/// Cocoapods to SPM Conversion Notes
/// * Using name: `proj-ios` causes issues with resource loading in Objective-C with [SWIFTPM_MODULE_BUNDLE pathForResource:resource ofType:type]; (The `-` become `_`)
/// * Moved `proj.db` into this package since it gets loaded here for actual usage, not in PROJ (Access to resources is limited in SPM vs cocoapods)
/// * Reorganized headers into include folder and resources into Resources
/// * Updated to use Module header imports with angled brackets for Objective-C framework imports
///

let package = Package(
name: "Projections",
platforms: [
.iOS(.v13), .macOS(.v12)
],
products: [
.library(
name: "Projections",
type: .static,
targets: ["Projections"]
)
],
dependencies: [
.package(url: "https://github.com/ngageoint/PROJ.git", from: "9.4.2"),
.package(url: "https://github.com/ngageoint/coordinate-reference-systems-ios.git", from: "2.0.0"),
],
targets: [
.target(
name: "Projections",
dependencies: [
.product(name: "proj", package: "PROJ"),
.product(name: "CoordinateReferenceSystems", package: "coordinate-reference-systems-ios"),
],
path: "proj-ios",
resources: [
.copy("Resources/proj.db"),
.copy("Resources/projections.ogc.plist"),
.copy("Resources/projections.none.plist"),
.copy("Resources/projections.epsg.plist")
]
),
.testTarget(
name: "proj-iosTests",
dependencies: [
"Projections",
],
path: "proj-iosTests",
exclude: [
"Info.plist",
]
),
.testTarget(
name: "proj-iosTests-swift",
dependencies: [
"Projections",
],
path: "proj-iosTests-swift"
),
]
)


11 changes: 0 additions & 11 deletions Podfile

This file was deleted.

63 changes: 27 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,58 +60,49 @@ CLLocationCoordinate2D inverseTransformed = [inverseTransform transform:transfor

### Build ###

[![Build & Test](https://github.com/ngageoint/projections-ios/workflows/Build%20&%20Test/badge.svg)](https://github.com/ngageoint/projections-ios/actions/workflows/build-test.yml)
[![Build](https://github.com/ngageoint/projections-ios/actions/workflows/build.yml/badge.svg)](https://github.com/ngageoint/projections-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
Build this repository SPM:

Open proj-ios.xcworkspace in Xcode or build from command line:
swift build

xcodebuild -workspace 'proj-ios.xcworkspace' -scheme proj-ios build
Run tests for SPM:

swift test

Open Package in Xcode:

Run tests from Xcode or from command line:

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

### Include Library ###

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

Include this repository by specifying it in a Podfile using a supported option.

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

pod 'proj-ios', '~> 2.0.3'

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

pod 'proj-ios', '~> 2.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/projections-ios.git", branch: "release/3.0.0"),
]

Or as a tagged release:

pod 'proj-ios', :git => 'https://github.com/ngageoint/projections-ios.git', :branch => 'master'
pod 'proj-ios', :git => 'https://github.com/ngageoint/projections-ios.git', :tag => '2.0.3'
dependencies: [
.package(url: "https://github.com/ngageoint/projections-ios.git", from: "3.0.0"),
]

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

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

### Swift ###

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

#import "proj-ios-Bridging-Header.h"
import projections

```swift

Expand Down
24 changes: 9 additions & 15 deletions docs/release.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@

Xcode Build:

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

Xcode Test:

xcodebuild test -workspace 'proj-ios.xcworkspace' -scheme proj-ios -destination 'platform=iOS Simulator,name=iPhone 15'
Swift Build & Test:

CocoaPods Local Lint:
swift build
swift test

pod lib lint proj-ios.podspec --use-libraries

CocoaPods GitHub Release Lint:

pod spec lint proj-ios.podspec --use-libraries
Xcode Build:

CocoaPods Deploy To Trunk:
open Package.swift
Command + B

pod trunk push proj-ios.podspec --use-libraries
Xcode Test:
open Package.swift
Command + U
26 changes: 0 additions & 26 deletions proj-ios.podspec

This file was deleted.

Loading