Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 4805905

Browse files
Support SwiftPM 5.3
1 parent b342480 commit 4805905

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
.build/
3+
.swiftpm/
34
xcuserdata
45
project.xcworkspace
56
/build

GCDWebUploader/GCDWebUploader.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ @implementation GCDWebUploader
6666

6767
- (instancetype)initWithUploadDirectory:(NSString*)path {
6868
if ((self = [super init])) {
69-
NSString* bundlePath = [[NSBundle bundleForClass:[GCDWebUploader class]] pathForResource:@"GCDWebUploader" ofType:@"bundle"];
69+
#if SWIFT_PACKAGE
70+
NSBundle* bundle = SWIFTPM_MODULE_BUNDLE;
71+
#else
72+
NSBundle* bundle = [NSBundle bundleForClass:[GCDWebUploader class]];
73+
#endif
74+
75+
NSString* bundlePath = [bundle pathForResource:@"GCDWebUploader" ofType:@"bundle"];
7076
if (bundlePath == nil) {
7177
return nil;
7278
}

Package.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.2
1+
// swift-tools-version:5.3
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
@@ -24,13 +24,15 @@ let package = Package(
2424
path: ".",
2525
exclude: [
2626
"Frameworks",
27-
"GCDWebUploader",
2827
"iOS",
2928
"Mac",
3029
"Tests",
3130
"tvOS",
3231
"Package.swift"
3332
],
33+
resources: [
34+
.copy("GCDWebUploader/GCDWebUploader.bundle"),
35+
],
3436
cSettings:[
3537
.headerSearchPath("GCDWebServer/Core"),
3638
.headerSearchPath("GCDWebServer/Requests"),

0 commit comments

Comments
 (0)