Replies: 5 comments 1 reply
-
I may be mistaken here, but I thought SwiftPM itself needed the manifest file to be located in the root directory. I presume it does, but does a package configured as you say work with SwiftPM? Do you have an example package configured this way so I can test it without needing to make one? |
Beta Was this translation helpful? Give feedback.
-
This is what I was asking for. Thank you. What I was asking was whether the approach you're using here is compatible with SwiftPM, meaning can I use this package from another project? If not, even if it works inside your app, it won't be useful in the index. I'll check and get back to you. |
Beta Was this translation helpful? Give feedback.
-
I just took a quick look at your package and I see that it currently has the Package.swift manifest in the root, presumably moved there to satisfy our requirement for it to be in the root. My apologies, I thought you were referring to a package you could not get into the index because of this requirement. So, instead. I moved the Package.swift manifest in my test package and was unable to import it in either an Xcode project or a Package project. The error is fairly clear: I didn’t think that rule was a SPI-specific rule and as far as I can tell I was correct. SwiftPM does not support packages that do not have their manifest in the root of the project. |
Beta Was this translation helpful? Give feedback.
-
Tracking a potential improvement to SwiftPM documentation to clarify this here: swiftlang/swift-org-website#756 |
Beta Was this translation helpful? Give feedback.
-
@daveverwer I deleted my last reply because I found a much better work around for my issue.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The problem
When working on any package, my usual set up is mono-repository with:
/MyPackage
)/MySampleApp
)When these sit next to each other in each their own folder, it will not satisfy SPI's requirement:
When I move the
Package.swift
to sit at the repository root however, I have to jump through annoying hoops to make that package importable into the example project that also sits in that same mono-repo, because of this warning in Xcode:Proposed solution
The solution is simply to have 2 sibling folders in the monorepo
/MySampleApp
and/MyPackage
and then if we can just let SPI know via.spi.yml
it would solve a lot of my problems.Eg.
Beta Was this translation helpful? Give feedback.
All reactions