Skip to content

Commit 735338e

Browse files
committed
Adds Swift Package Manager support (TIFF tests are slow - big image files)
* Updates github workflows for SPM * Removes cocoapods and carthage
1 parent 11dad0b commit 735338e

File tree

85 files changed

+209
-1221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+209
-1221
lines changed

.github/workflows/build-test.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313

1414
steps:
1515
- name: Checkout Repository
16-
uses: actions/checkout@v3
17-
- name: Install
18-
run: pod install
16+
uses: actions/checkout@v4
1917
- name: Build
20-
run: xcodebuild build-for-testing -workspace tiff-ios.xcworkspace -scheme tiff-ios -destination 'platform=iOS Simulator,OS=latest,name=iPhone 14'
18+
run: swift build
19+
- name: Test
20+
run: swift test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ Pods
55
xcuserdata/
66
*.swp
77
Carthage/
8+
.build/
9+
.swiftpm/

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Adheres to [Semantic Versioning](http://semver.org/).
44

55
---
66

7-
## 4.0.3 (TBD)
7+
## 5.0.0 (6-5-2025)
88

9-
* TBD
9+
* Swift Package Manager Support
10+
* Updated bundle resource loading for the test image files
11+
* Cocoapods and carthage removed
1012

1113
## [4.0.2](https://github.com/ngageoint/tiff-ios/releases/tag/4.0.2) (11-06-2023)
1214

Cartfile

Whitespace-only changes.

Cartfile.resolved

Whitespace-only changes.

Package.swift

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// swift-tools-version: 5.10
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "TIFF",
7+
platforms: [
8+
.iOS(.v13), .macOS(.v12)
9+
],
10+
products: [
11+
.library(
12+
name: "TIFF",
13+
targets: ["TIFF"])
14+
],
15+
dependencies: [
16+
],
17+
targets: [
18+
.target(
19+
name: "TIFF",
20+
dependencies: [
21+
],
22+
path: "tiff-ios"
23+
),
24+
.testTarget(
25+
name: "TiffTests",
26+
dependencies: [
27+
"TIFF"
28+
],
29+
path: "tiff-iosTests",
30+
resources: [
31+
.copy("Resources/deflate.tiff"),
32+
.copy("Resources/float32.tiff"),
33+
.copy("Resources/float64.tiff"),
34+
.copy("Resources/initial.tiff"),
35+
.copy("Resources/int32.tiff"),
36+
.copy("Resources/interleave.tiff"),
37+
.copy("Resources/lzw_predictor_floating.tiff"),
38+
.copy("Resources/lzw_predictor.tiff"),
39+
.copy("Resources/lzw.tiff"),
40+
.copy("Resources/overviews.tiff"),
41+
.copy("Resources/packbits.tiff"),
42+
.copy("Resources/quad-jpeg.tif"),
43+
.copy("Resources/rgb.tiff"),
44+
.copy("Resources/small.tiff"),
45+
.copy("Resources/stripped.tiff"),
46+
.copy("Resources/tiled.tiff"),
47+
.copy("Resources/tiledplanar.tiff"),
48+
.copy("Resources/tiledplanarlzw.tiff"),
49+
.copy("Resources/uint32.tiff")
50+
]
51+
),
52+
.testTarget(
53+
name: "TiffTestsSwift",
54+
dependencies: [
55+
"TIFF"
56+
],
57+
path: "tiff-iosTests-swift",
58+
resources: [
59+
]
60+
)
61+
62+
]
63+
)

Podfile

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ View the latest [Appledoc](http://ngageoint.github.io/tiff-ios/docs/api/)
2020
#### Read ####
2121

2222
```objectivec
23+
@import TIFF;
2324

2425
// NSData *data = ...;
2526
// NSString *file = ...;
@@ -79,42 +80,48 @@ NSData *data = [TIFFWriter writeTiffToDataWithImage:tiffImage];
7980

8081
### Build ###
8182

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

84-
Build this repository using Xcode and/or CocoaPods:
85+
Build this repository using Swift Package Manager:
8586

86-
pod install
87-
88-
Open tiff-ios.xcworkspace in Xcode or build from command line:
89-
90-
xcodebuild -workspace 'tiff-ios.xcworkspace' -scheme tiff-ios build
87+
swift build
9188

9289
Run tests from Xcode or from command line:
9390

94-
xcodebuild test -workspace 'tiff-ios.xcworkspace' -scheme tiff-ios -destination 'platform=iOS Simulator,name=iPhone 15'
91+
swift test
9592

96-
### Include Library ###
93+
Open the Swift Package in Xcode from command line:
9794

98-
Include this repository by specifying it in a Podfile using a supported option.
95+
open Package.swift
9996

100-
Pull from [CocoaPods](https://cocoapods.org/pods/tiff-ios):
97+
### Include Library ###
10198

102-
pod 'tiff-ios', '~> 4.0.2'
99+
Use this library via SPM in your Package.swift:
103100

104-
Pull from GitHub:
101+
dependencies: [
102+
.package(url: "https://github.com/ngageoint/tiff-ios.git", branch: "release/5.0.0"),
103+
]
104+
105+
Or as a tagged release:
105106

106-
pod 'tiff-ios', :git => 'https://github.com/ngageoint/tiff-ios.git', :branch => 'master'
107-
pod 'tiff-ios', :git => 'https://github.com/ngageoint/tiff-ios.git', :tag => '4.0.2'
107+
dependencies: [
108+
.package(url: "https://github.com/ngageoint/tiff-ios.git", from: "5.0.0"),
109+
]
108110

109-
Include as local project:
111+
Reference it in your Package.swift target:
110112

111-
pod 'tiff-ios', :path => '../tiff-ios'
113+
.target(
114+
name: "MyApp",
115+
dependencies: [
116+
.product(name: "TIFF", package: "tiff-ios"),
117+
],
118+
),
112119

113120
### Swift ###
114121

115-
To use from Swift, import the tiff-ios bridging header from the Swift project's bridging header
122+
To use from Swift:
116123

117-
#import "tiff-ios-Bridging-Header.h"
124+
import TIFF
118125

119126
#### Read ####
120127

tiff-ios.podspec

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)