Replace the deprecated CoreServices UTI calls (UTTypeCreatePreferredIdentifierForTag / UTTypeCopyPreferredTagWithClass) in GCDWebServerGetMimeTypeForExtension with the modern [UTType typeWithFilenameExtension:].preferredMIMEType, removing the -Wdeprecated-declarations pragma. Behavior is unchanged: known extensions map to the same MIME type, unknown ones fall back to the default. The UniformTypeIdentifiers framework (macOS 11+ / iOS 14+ / tvOS 14+, within the project's deployment targets) is now linked in all three build systems: Xcode (OTHER_LDFLAGS), CocoaPods (Core subspec frameworks), and SwiftPM (linkedFramework). Verified: Run-Tests.sh, swift build, and pod lib lint all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
57 lines
1.6 KiB
Swift
57 lines
1.6 KiB
Swift
// swift-tools-version:5.9
|
|
import PackageDescription
|
|
|
|
let package = Package(
|
|
name: "GCDWebServer",
|
|
platforms: [
|
|
.iOS(.v16),
|
|
.tvOS(.v16),
|
|
.macOS(.v12),
|
|
],
|
|
products: [
|
|
.library(name: "GCDWebServer", targets: ["GCDWebServer"]),
|
|
.library(name: "GCDWebUploader", targets: ["GCDWebUploader"]),
|
|
.library(name: "GCDWebDAVServer", targets: ["GCDWebDAVServer"]),
|
|
],
|
|
targets: [
|
|
.target(
|
|
name: "GCDWebServer",
|
|
path: "GCDWebServer",
|
|
// Public headers are exposed via symlinks in include/ so that GCDWebServerPrivate.h stays private.
|
|
publicHeadersPath: "include",
|
|
cSettings: [
|
|
// Source files import sibling headers across these subdirectories with quoted #imports.
|
|
.headerSearchPath("Core"),
|
|
.headerSearchPath("Requests"),
|
|
.headerSearchPath("Responses"),
|
|
],
|
|
linkerSettings: [
|
|
.linkedLibrary("z"),
|
|
.linkedFramework("UniformTypeIdentifiers"),
|
|
.linkedFramework("CoreServices", .when(platforms: [.iOS, .tvOS])),
|
|
.linkedFramework("CFNetwork", .when(platforms: [.iOS, .tvOS])),
|
|
.linkedFramework("SystemConfiguration", .when(platforms: [.macOS])),
|
|
]
|
|
),
|
|
.target(
|
|
name: "GCDWebUploader",
|
|
dependencies: ["GCDWebServer"],
|
|
path: "GCDWebUploader",
|
|
exclude: [".DS_Store"],
|
|
resources: [
|
|
.copy("GCDWebUploader.bundle"),
|
|
],
|
|
publicHeadersPath: "include"
|
|
),
|
|
.target(
|
|
name: "GCDWebDAVServer",
|
|
dependencies: ["GCDWebServer"],
|
|
path: "GCDWebDAVServer",
|
|
publicHeadersPath: ".",
|
|
linkerSettings: [
|
|
.linkedLibrary("xml2"),
|
|
]
|
|
),
|
|
]
|
|
)
|