GCDWebServer icon indicating copy to clipboard operation
GCDWebServer copied to clipboard

Swift Package support

Open lurui1029 opened this issue 5 years ago • 5 comments

More apps and projects are using Swift now and they prefer Swift Package as the default package manager.

Objective-C libraries make sense to support Swift Package.

lurui1029 avatar Jul 30 '20 02:07 lurui1029

Here is a simple example of package file for objc packages:

MyObjcLib
├–Package.swift
└–Sources
  └–MyObjcLib
     ├–include
     | └–[public header files {.h}]
     └–[source files & folders {.m, etc.}]
// swift-tools-version:5.3

import PackageDescription

let package = Package(
    name: "MyObjcLib",
    products: [
        .library(
            name: "MyObjcLib",
            targets: ["MyObjcLib"]
        ),
    ],
    targets: [
        .target(
            name: "MyObjcLib",
            publicHeadersPath: "include"
        ),
    ]
)

More complex one can be found here: https://github.com/pinterest/PINCache/blob/master/Package.swift

maximkrouk avatar Oct 06 '20 12:10 maximkrouk

We are having compatibility issues with Carthage on the latest version of Xcode, so this enhancement is more important than ever. It would be great if this could be solved and I'm happy to help if needed. There is a PR already addressing the issue: https://github.com/swisspol/GCDWebServer/pull/516

vicegax avatar Jan 08 '21 10:01 vicegax

GCD SPM GIT Branch: swift-package-manager is working

nilsnilsnils avatar May 06 '21 10:05 nilsnilsnils

Thanks @nilsnilsnils Your branch is working perfectly

andrewreeman avatar Sep 10 '21 11:09 andrewreeman

Hello, Can you please describe me how can i use alternative repository to import "GCDWebServer" in my app? I clonned the repo SlaunchaMan/GCDWebServer to local folder, did checkout to the branch swift-package-manager . Than i clicked to add local package to my iOS app. The package is displayed as imported. But when i try to do import GCDWebServer i see error No such module 'GCDWebServer'

What is wrong? How can i start using this package in my xcode 13.2 , swift 5, ios target 15.0 app?

Gelembjuk avatar Jan 09 '22 08:01 Gelembjuk