Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigation : SPM #68

Closed
shalehaha opened this issue Jun 26, 2020 · 3 comments
Closed

Investigation : SPM #68

shalehaha opened this issue Jun 26, 2020 · 3 comments
Assignees
Labels

Comments

@shalehaha
Copy link
Contributor

shalehaha commented Jun 26, 2020

Constraint:

  1. Technically, one repo can only define one package.swift. You can define a package in a sub folder, but there is no way for another project to include it. If you define a package in a sub folder and reclaim the same module in the root package, it works, but when you open the project from the root package, xcdoe won't show the source code in the sub folder.
  2. Couldn't run test that relies on Bundle
  3. Doesn't support resources (until swift 5.3), https://github.com/apple/swift-evolution/blob/master/proposals/0271-package-manager-resources.md
  4. Doesn't platform specific sources (until swift 5.3), https://github.com/apple/swift-evolution/blob/master/proposals/0273-swiftpm-conditional-target-dependencies.md
@shalehaha shalehaha self-assigned this Jun 26, 2020
@shalehaha
Copy link
Contributor Author

shalehaha commented Jul 6, 2020

Static vs dynamic:
https://github.com/renaudjenny/Swift-Package-Manager-Static-Dynamic-Xcode-Bug

In a nutshell: since Xcode 11.4, it seems that your project will only use .static libraries, and if your library is present twice or more in your project (2 different targets that use the same library, for example an iOS app target and its Today Widget). You can lead to a duplication of static library. I suspect it was the case before Xcode 11.4, but no complains whatsoever... Since I applied the trick in this tutorial, my app shrunk a little in size, maybe due to the fact that my App and its Widget use the exact same code and not a duplicated one.

An easy fix is to force the library to be .dynamic, but it requires either to ask the library maintainer to update his Package.swift definition, or fork the library yourself to do so. For me, it's not a solution 🤔.

@shalehaha
Copy link
Contributor Author

apple/swift-nio#1257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants