Skip to content

Commit 79afc74

Browse files
committed
WIP - MVP for Swift Package Integration
1 parent da5f939 commit 79afc74

35 files changed

+171
-57
lines changed

.gitignore

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

CHANGELOG.md

Lines changed: 5 additions & 3 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.2.6 (TBD)
8-
9-
* TBD
7+
## (TBD) Experimental SPM Package
8+
* Added Swift Package support and is using Modules which breaks Cocoapods.
9+
* TODO: Decomission Cocoapods if PROJ can be built as an XCFramework to use with SPM. Remove all Cocoapods related files, Xcode project, and workspace.
10+
* This is a proof of concept to showcase how to get the sf-ios dependency to build and test along with another dependency.
11+
* Since Cocoapods is being decommissioned, we should move entirely to SPM after PROJ dependency can be incorporated.
1012

1113
## [4.2.5](https://github.com/ngageoint/simple-features-geojson-ios/releases/tag/4.2.5) (04-08-2024)
1214

Package.resolved

Lines changed: 15 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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// swift-tools-version:5.10
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "SimpleFeaturesGeoJSON",
6+
platforms: [.macOS(.v11), .iOS(.v12), .tvOS(.v12)],
7+
products: [
8+
.library(
9+
name: "SimpleFeaturesGeoJSON",
10+
targets: ["SimpleFeaturesGeoJSON"]),
11+
],
12+
dependencies: [
13+
14+
.package(url: "https://github.com/ngageoint/simple-features-ios", branch: "psolt/v5-NS_ENUM_Package"), // FIXME: Update to published release
15+
// .package(name: "simple-features-ios", path: "../simple-features-ios"), // Testing locally against (psolt/v5-NS_ENUM_Package)
16+
],
17+
targets: [
18+
.target(
19+
name: "SimpleFeaturesGeoJSON", // Use full name without hyphens to prevent SPM test resource bug
20+
dependencies: [
21+
.product(name: "sf-ios", package: "simple-features-ios")
22+
],
23+
path: "sf-geojson-ios",
24+
25+
exclude: [
26+
"sf_geojson_ios.swift",
27+
],
28+
publicHeadersPath: "",
29+
cSettings: [
30+
.headerSearchPath("")
31+
]
32+
),
33+
.testTarget(
34+
name: "SimpleFeaturesGeoJSONTests", // Use full name without hyphens to prevent SPM test resource bug
35+
dependencies: ["SimpleFeaturesGeoJSON"],
36+
path: "sf-geojson-iosTests",
37+
exclude: [
38+
"SFGSwiftReadmeTest.swift"
39+
],
40+
resources: [ // In Objective-C, the tests fail to load resource using SWIFTPM_MODULE_BUNDLE macro with hyphens for target/testTarget names, so we'll use full names.
41+
.copy("fc-points.geojson"),
42+
.copy("fc-points-altitude.geojson"),
43+
.copy("gc.geojson"),
44+
.copy("gc-multiple.geojson")
45+
]
46+
),
47+
]
48+
)

sf-geojson-ios.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
04E8E48B22F4A82E001696A2 /* fc-points-altitude.geojson in Resources */ = {isa = PBXBuildFile; fileRef = 04E8E48722F4A82E001696A2 /* fc-points-altitude.geojson */; };
6060
04E8E4BC22FDE120001696A2 /* SFGOrderedDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 04E8E4BA22FDE11F001696A2 /* SFGOrderedDictionary.h */; };
6161
04E8E4BD22FDE120001696A2 /* SFGOrderedDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E8E4BB22FDE120001696A2 /* SFGOrderedDictionary.m */; };
62-
B4B9C5C590F6D09B45DC2BDB /* libPods-sf-geojson-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F9A70C9172FC5893F17C0FB6 /* libPods-sf-geojson-ios.a */; };
63-
B5D94958E350F092F31540ED /* libPods-sf-geojson-iosTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 499642A447440D35F38311C9 /* libPods-sf-geojson-iosTests.a */; };
62+
19CA8DC1E0F6DD02A166EECF /* Pods_sf_geojson_ios.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D9676D0972E30B6F0D85391 /* Pods_sf_geojson_ios.framework */; };
63+
E977A23C063C68FF4D8A0757 /* Pods_sf_geojson_iosTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7B675B6F0B5C22FA30FEAB /* Pods_sf_geojson_iosTests.framework */; };
6464
/* End PBXBuildFile section */
6565

6666
/* Begin PBXContainerItemProxy section */
@@ -143,19 +143,19 @@
143143
04E8E4BA22FDE11F001696A2 /* SFGOrderedDictionary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SFGOrderedDictionary.h; sourceTree = "<group>"; };
144144
04E8E4BB22FDE120001696A2 /* SFGOrderedDictionary.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SFGOrderedDictionary.m; sourceTree = "<group>"; };
145145
192D9E5452A64EB6A7955A5A /* Pods-sf-geojson-ios.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-sf-geojson-ios.release.xcconfig"; path = "Pods/Target Support Files/Pods-sf-geojson-ios/Pods-sf-geojson-ios.release.xcconfig"; sourceTree = "<group>"; };
146+
1D9676D0972E30B6F0D85391 /* Pods_sf_geojson_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_sf_geojson_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; };
146147
457018C9103A514A78925D9E /* Pods-sf-geojson-ios.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-sf-geojson-ios.debug.xcconfig"; path = "Pods/Target Support Files/Pods-sf-geojson-ios/Pods-sf-geojson-ios.debug.xcconfig"; sourceTree = "<group>"; };
147-
499642A447440D35F38311C9 /* libPods-sf-geojson-iosTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-sf-geojson-iosTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
148148
6179C77188B4A0E8D4DEDBEB /* Pods-sf-geojson-iosTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-sf-geojson-iosTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-sf-geojson-iosTests/Pods-sf-geojson-iosTests.debug.xcconfig"; sourceTree = "<group>"; };
149149
B17E59AE80997CC09DD740D6 /* Pods-sf-geojson-iosTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-sf-geojson-iosTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-sf-geojson-iosTests/Pods-sf-geojson-iosTests.release.xcconfig"; sourceTree = "<group>"; };
150-
F9A70C9172FC5893F17C0FB6 /* libPods-sf-geojson-ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-sf-geojson-ios.a"; sourceTree = BUILT_PRODUCTS_DIR; };
150+
BC7B675B6F0B5C22FA30FEAB /* Pods_sf_geojson_iosTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_sf_geojson_iosTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
151151
/* End PBXFileReference section */
152152

153153
/* Begin PBXFrameworksBuildPhase section */
154154
042FC6471B963FE500549A4B /* Frameworks */ = {
155155
isa = PBXFrameworksBuildPhase;
156156
buildActionMask = 2147483647;
157157
files = (
158-
B4B9C5C590F6D09B45DC2BDB /* libPods-sf-geojson-ios.a in Frameworks */,
158+
19CA8DC1E0F6DD02A166EECF /* Pods_sf_geojson_ios.framework in Frameworks */,
159159
);
160160
runOnlyForDeploymentPostprocessing = 0;
161161
};
@@ -164,7 +164,7 @@
164164
buildActionMask = 2147483647;
165165
files = (
166166
042FC6571B963FE500549A4B /* sf_geojson_ios.framework in Frameworks */,
167-
B5D94958E350F092F31540ED /* libPods-sf-geojson-iosTests.a in Frameworks */,
167+
E977A23C063C68FF4D8A0757 /* Pods_sf_geojson_iosTests.framework in Frameworks */,
168168
);
169169
runOnlyForDeploymentPostprocessing = 0;
170170
};
@@ -290,8 +290,8 @@
290290
63206AE083C9F99B2058A9EE /* Frameworks */ = {
291291
isa = PBXGroup;
292292
children = (
293-
499642A447440D35F38311C9 /* libPods-sf-geojson-iosTests.a */,
294-
F9A70C9172FC5893F17C0FB6 /* libPods-sf-geojson-ios.a */,
293+
1D9676D0972E30B6F0D85391 /* Pods_sf_geojson_ios.framework */,
294+
BC7B675B6F0B5C22FA30FEAB /* Pods_sf_geojson_iosTests.framework */,
295295
);
296296
name = Frameworks;
297297
sourceTree = "<group>";

sf-geojson-ios/SFGGeoJSONObject.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
//
88

99
#import <Foundation/Foundation.h>
10-
#import "SFGeometry.h"
10+
11+
@import sf_ios;
1112

1213
/**
1314
* Type key

sf-geojson-ios/SFGGeometry.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
// Copyright © 2019 NGA. All rights reserved.
77
//
88

9+
@import sf_ios;
10+
911
#import "SFGGeoJSONObject.h"
10-
#import "SFGeometry.h"
12+
//#import "SFGeometry.h"
1113
#import "SFGGeometryTypes.h"
1214

1315
/**

sf-geojson-ios/SFGGeometryCollection.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
//
88

99
#import "SFGGeometry.h"
10-
#import "SFGeometryCollection.h"
10+
//#import "SFGeometryCollection.h"
11+
12+
@import sf_ios;
1113

1214
/**
1315
* Geometries key

sf-geojson-ios/SFGGeometryTypes.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
// Copyright © 2021 NGA. All rights reserved.
77
//
88

9-
#import "SFGeometryTypes.h"
9+
//#import "SFGeometryTypes.h"
10+
11+
@import sf_ios;
1012

1113
/**
1214
* Geometry Type enumeration

sf-geojson-ios/SFGLineString.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
//
88

99
#import "SFGPoint.h"
10-
#import "SFLineString.h"
10+
//#import "SFLineString.h"
11+
@import sf_ios;
1112

1213
/**
1314
* Line String

0 commit comments

Comments
 (0)