GCDWebServer icon indicating copy to clipboard operation
GCDWebServer copied to clipboard

Add full Swift Package manager support

Open nostradani opened this issue 4 years ago • 22 comments

This PR should include everything to fully support SPM. That includes:

  • Public headers for the module (realised using symbolic links)
  • Deals with GCDWebUploader.bundle
  • Other build methods should not be affected (Xcode, Cocoapods)

nostradani avatar Oct 21 '20 09:10 nostradani

Please merge this :)

trapper- avatar Nov 18 '20 06:11 trapper-

I squashed the commits into a single one. Should now be more concise.

nostradani avatar Nov 18 '20 09:11 nostradani

@swisspol If you need any input or so, just let me know

nostradani avatar Nov 19 '20 08:11 nostradani

This relates to the issue: https://github.com/swisspol/GCDWebServer/issues/499 It would be great if this can move forward.

vicegax avatar Jan 08 '21 10:01 vicegax

Some resources still cause workspace warnings in Xcode 12:

Package Loading Group
found 5 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
SourcePackages/checkouts/GCDWebServer/GCDWebServer.podspec
SourcePackages/checkouts/GCDWebServer/Run-Tests.sh
SourcePackages/checkouts/GCDWebServer/format-source.sh
SourcePackages/checkouts/GCDWebServer/README.md
SourcePackages/checkouts/GCDWebServer/LICENSE

Maybe add copy rules for them for the target in package manifest?

clementbarry avatar Jan 20 '21 08:01 clementbarry

@clementbarry I added them to the excludes since they are not needed for the targets itself. This should resolve the warnings

nostradani avatar Jan 20 '21 08:01 nostradani

Swift compiler throws "Cannot find type 'GCDWebUploader' in scope" error when trying to use GCDWebUploader. Maybe the Package needs another headerSearchPath for it?

clementbarry avatar Feb 27 '21 08:02 clementbarry

@clementbarry Alright, I added a symlink to the missing header. Now all public headers should be present.

nostradani avatar Mar 01 '21 19:03 nostradani

Anything preventing this to be merged and released?

Truck3r avatar May 20 '21 07:05 Truck3r

Hi! I see this error when I try to add it as a Swift Package from your repo:

https://github.com/nostradani/GCDWebServer has no Package.swift manifest for version 3.5.4 in https://github.com/nostradani/GCDWebServer

danielnord avatar Jun 16 '21 11:06 danielnord

Hi! I see this error when I try to add it as a Swift Package from your repo:

https://github.com/nostradani/GCDWebServer has no Package.swift manifest for version 3.5.4 in https://github.com/nostradani/GCDWebServer

This is because version 3.5.4 of GCDWebServer (the git tag) doesn't yet have the Package.swift. Instead of version 3.5.4 you would need to specify the branch for now

nostradani avatar Jun 17 '21 12:06 nostradani

Can this be merged? :D

SamCosta1 avatar Jun 27 '21 11:06 SamCosta1

Noticed there's not any PRs been merged in a while, is it only one person with permission to merge them?

SamCosta1 avatar Jun 30 '21 16:06 SamCosta1

I would love this to be merged as well. But don't forget to update the Getting Started part of the README.md file to include the instructions for using SPM so the documentation stays good.

joaorgsampaio avatar Jul 20 '21 21:07 joaorgsampaio

Highly interested in seeing this merged. Don't have the access to update this PR without making another PR on @nostradani's repo but here are my suggested updates to the README:

GCDWebServer is also available via Swift Package Manager (SPM). To add it to your project, add this line to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/swisspol/GCDWebServer", from: "3.5.4")
]

Or add it to your xcodeproj through the Xcode UI

JacobHearst avatar Aug 11 '21 12:08 JacobHearst

I updated my PR and added instructions to the README.md

nostradani avatar Aug 12 '21 01:08 nostradani

@swisspol Can we get this merged?

JacobHearst avatar Aug 12 '21 17:08 JacobHearst

I had issues with the package name and had to rename it. Somehow SPM uses the last part of the repository URL for its name and behaves strangely if the package name doesn't match. But it should work fine now.

nostradani avatar Aug 12 '21 22:08 nostradani

Why the name in your repo is GCDWebServers not GCDWebServer. It seems using GCDWebServer not working

I had issues with the package name and had to rename it. Somehow SPM uses the last part of the repository URL for its name and behaves strangely if the package name doesn't match. But it should work fine now.

danleechina avatar Dec 11 '21 15:12 danleechina

Hey Guys, Is there any option to use this package in modern Swift 5 app? My project is for iOS, target 15.0 . XCode 13.2 . Swift 5 . I add dependencies using SPM.

Is there any workaround to add this package today without this pull request accepted?

Gelembjuk avatar Jan 09 '22 08:01 Gelembjuk

@Gelembjuk This isn't ideal but I've forked the repo with the changes to make this project a swift package. You can find it here: https://github.com/JacobHearst/GCDWebServer

JacobHearst avatar Jan 10 '22 16:01 JacobHearst

So, is this project deprecated? Should we switch to the fork?

simonox avatar Jan 19 '22 09:01 simonox