Add Swift Package Manager support

Add Package.swift with three products: GCDWebServer (core),
GCDWebUploader, and GCDWebDAVServer.

Public headers live across Core/Requests/Responses subdirectories, which
SPM cannot expose directly. To support SPM without moving any files
(keeping the Xcode project and CocoaPods builds intact), public headers
are surfaced through symlinks in include/ directories with a hand-written
umbrella-directory module map; the private GCDWebServerPrivate.h is left
unlinked so it stays out of the public module.

GCDWebUploader.bundle is shipped as a .copy resource and located at
runtime via SWIFTPM_MODULE_BUNDLE under a #if SWIFT_PACKAGE branch.

Verified: swift build (all targets), Swift module imports, Xcode
framework build, and the XCTest suite all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 15:55:49 +07:00
parent b38a78a34a
commit 1f96a271cb
21 changed files with 103 additions and 1 deletions

View File

@ -67,6 +67,12 @@ github "swisspol/GCDWebServer" ~> 3.2.5
Then run `$ carthage update` and add the generated frameworks to your Xcode projects (see [Carthage instructions](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application)).
You can also use [Swift Package Manager](https://www.swift.org/package-manager/). Add GCDWebServer as a dependency in your `Package.swift`:
```swift
.package(url: "https://github.com/swisspol/GCDWebServer.git", from: "3.5.4")
```
Then add the product(s) you need to your target's dependencies: `"GCDWebServer"` for the core server, `"GCDWebUploader"` for the web uploader, and/or `"GCDWebDAVServer"` for the WebDAV server. In Xcode, use File > Add Package Dependencies and enter the repository URL.
Help & Support
==============