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 Nov 18, 2020
1 parent c6d118f commit ad60adf
Show file tree
Hide file tree
Showing 18 changed files with 66 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
42 changes: 42 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// 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"
],
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

0 comments on commit ad60adf

Please sign in to comment.