-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Wrong Package names with Package.resolved JSON version 2 #179
Comments
@mono0926 are you already working on support for this? |
Not yet, and not planned, sorry. |
We can use rename Configuration. rename:
appcenter-sdk-apple: AppCenter |
@ykws Yes, I know. That's the way what we currently do. But it's pretty hard to rename all your dependencies and find the correct naming for each of this dependencies. |
@AF-cgi Good! I think too, however it is impossible to rename automatically, because of the breaking change that the source of the origin package name was lost. I think we can only manually renaming as mention above configuration. |
Just an idea, We may be able to pick up the name from |
That's a good idea and I implemented it in my fork. However there are caveats to this: since Package.swift is not a JSON where we can rely on standardized parsing, we might encounter problems with some Packages. As an example from my own Swift Package, I don't like repeating myself in Swift and since the Package Definition is written in Swift, I defined my Package Name as a String variable. That's perfectly valid, but breaks any attempts I took when trying to parse the name in a globally valid way. What I did in the end is a 3-step process to get the best name possible from the new version of Package.resolved:
Let me know if you see room for improvement since this is my first draft and all the parsing made me dizzy at times (trying a lot of Regex before landing on my solution). Edge cases I encountered are also added as Unit Tests, so you can play around in the parser with confidence. |
A more robust way of parsing the Package.swift would be to run |
With the new Package.resolved JSON version 2 (#174), which Apple introduce with Xcode 13.3 and Swift 5.6, I miss the correct package names. The possibility to improve the names is the rename-feature of your tool. Do you have any idea if there is a better way, to get the correct package names?
An example:
Each package name is lowercase. Most package names ends with
-sdk
,-iOS-sdk
or-apple
.The text was updated successfully, but these errors were encountered: