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

Commit

Permalink
Added support for Swift PM 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-muhra-cw committed Mar 1, 2021
1 parent c6d118f commit 16bbfa7
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.DS_Store
.build/
.swiftpm/
xcuserdata
project.xcworkspace
/build
Expand Down
8 changes: 7 additions & 1 deletion GCDWebUploader/GCDWebUploader.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ @implementation GCDWebUploader

- (instancetype)initWithUploadDirectory:(NSString*)path {
if ((self = [super init])) {
NSString* bundlePath = [[NSBundle bundleForClass:[GCDWebUploader class]] pathForResource:@"GCDWebUploader" ofType:@"bundle"];
#if SWIFT_PACKAGE
NSBundle* bundle = SWIFTPM_MODULE_BUNDLE;
#else
NSBundle* bundle = [NSBundle bundleForClass:[GCDWebUploader class]];
#endif

NSString* bundlePath = [bundle pathForResource:@"GCDWebUploader" ofType:@"bundle"];
if (bundlePath == nil) {
return nil;
}
Expand Down
47 changes: 47 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "GCDWebServers",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "GCDWebServers",
targets: ["GCDWebServers"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "GCDWebServers",
dependencies: [],
path: ".",
exclude: [
"Frameworks",
"iOS",
"Mac",
"Tests",
"tvOS",
"Package.swift",
"GCDWebServer.podspec",
"Run-Tests.sh",
"format-source.sh",
"README.md",
"LICENSE"
],
resources: [
.copy("GCDWebUploader/GCDWebUploader.bundle"),
],
cSettings:[
.headerSearchPath("GCDWebServer/Core"),
.headerSearchPath("GCDWebServer/Requests"),
.headerSearchPath("GCDWebServer/Responses"),
]),
]
)
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebDAVServer.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServer.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerConnection.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerDataRequest.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerDataResponse.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerErrorResponse.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerFileRequest.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerFileResponse.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerFunctions.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerHTTPStatusCodes.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerMultiPartFormRequest.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerRequest.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerResponse.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerStreamedResponse.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebServerURLEncodedFormRequest.h
1 change: 1 addition & 0 deletions include/GCDWebServers/GCDWebUploader.h

0 comments on commit 16bbfa7

Please sign in to comment.