Skip to content

Swift Package Support for Grid and NS_ENUM Fix #3

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
21 changes: 0 additions & 21 deletions .github/workflows/build-test.yml

This file was deleted.

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

steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install
run: pod install
uses: actions/checkout@v4
- name: Build
run: xcodebuild build-for-testing -workspace grid-ios.xcworkspace -scheme grid-ios -destination 'platform=iOS Simulator,OS=latest,name=iPhone 14'
run: |
iphone_names=$(xcrun simctl list devices available --json | jq -r '.devices | to_entries[] | .value[] | select(.name | test("^iPhone [0-9]+")) | .name')
latest_iphone=$(echo "$iphone_names" | sort | tail -n 1)
echo "latest_iphone: $latest_iphone"
xcodebuild build -scheme Grid -destination "platform=iOS Simulator,OS=latest,name=$latest_iphone"

- name: Test
run: |
iphone_names=$(xcrun simctl list devices available --json | jq -r '.devices | to_entries[] | .value[] | select(.name | test("^iPhone [0-9]+")) | .name')
latest_iphone=$(echo "$iphone_names" | sort | tail -n 1)
echo "latest_iphone: $latest_iphone"
xcodebuild test -scheme Grid -destination "platform=iOS Simulator,OS=latest,name=$latest_iphone"

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ xcuserdata/
*.swp
Carthage/
build/
.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/).

---

# 1.0.8 (TBD)
# 2.0.0

* TBD
* SimpleFeatures (sf-ios) 5.0.0 (Breaking change for NS_ENUM symbol exposure to Swift)
* Updated to Swift Package Manager (SPM) since Cocoapods is deprecated.

## [1.0.7](https://github.com/ngageoint/grid-ios/releases/tag/1.0.7) (04-08-2024)

Expand Down
24 changes: 24 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"originHash" : "0a2343e561738888d0c374606b530f6803217a627a8961bb5e186cf7135f809a",
"pins" : [
{
"identity" : "color-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ngageoint/color-ios",
"state" : {
"branch" : "psolt/package",
"revision" : "37e9f7f9cea14ec1759f36c3981effee063a31f6"
}
},
{
"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
}
35 changes: 35 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// swift-tools-version: 5.10

import PackageDescription

let package = Package(
name: "Grid",
platforms: [.macOS(.v11), .iOS(.v13)],
products: [
.library(
name: "Grid",
targets: ["Grid"])
],
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/color-ios", branch: "psolt/package")
],
targets: [
.target(
name: "Grid",
dependencies: [
.product(name: "SimpleFeatures", package: "simple-features-ios"),
.product(name: "Color", package: "color-ios")
],
path: "grid-ios"
),
.testTarget(
name: "GridTests",
dependencies: [
"Grid"
],
path: "grid-iosTests"
)
]
)
12 changes: 0 additions & 12 deletions Podfile

This file was deleted.

43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,47 @@ View the latest [Appledoc](http://ngageoint.github.io/grid-ios/docs/api/)

```swift

import grid_ios
import Grid

```

### Build ###

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

Build this repository using Xcode and/or CocoaPods:
Build and Test (Uses UIKit, so we build with xcodebuild instead of SPM).

pod install

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

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

Run tests from Xcode or from command line:

xcodebuild test -workspace 'grid-ios.xcworkspace' -scheme grid-ios -destination 'platform=iOS Simulator,name=iPhone 15'
./build.sh

You can build and test if you open the Package.swift in Xcode.

### Include Library ###

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

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

pod 'grid-ios', '~> 1.0.7'
### Include Library ###

Use this library via SPM in your Package.swift:

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

Or as a tagged release:

pod 'grid-ios', :git => 'https://github.com/ngageoint/grid-ios.git', :branch => 'master'
pod 'grid-ios', :git => 'https://github.com/ngageoint/grid-ios.git', :tag => '1.0.7'
dependencies: [
.package(url: "https://github.com/ngageoint/grid-ios.git", from: "2.0.0"),
]

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

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

### Remote Dependencies ###

Expand Down
16 changes: 16 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

# Find iPhone Simulator
iphone_names=$(xcrun simctl list devices available --json | jq -r '.devices | to_entries[] | .value[] | select(.name | test("^iPhone [0-9]+")) | .name')
if [ -z "$iphone_names" ]; then echo "Error: No iPhone simulators found."; exit 1; fi

latest_iphone=$(echo "$iphone_names" | sort | tail -n 1)
echo "latest_iphone: $latest_iphone"

# Build
xcodebuild build -scheme Grid -destination "platform=iOS Simulator,OS=latest,name=$latest_iphone"

# Test
xcodebuild test -scheme Grid -destination "platform=iOS Simulator,OS=latest,name=$latest_iphone"
22 changes: 0 additions & 22 deletions grid-ios.podspec

This file was deleted.

Loading