-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Add .staticFramework to PBXProductType. #347
Conversation
755b5b9
to
3c99b1c
Compare
Danger run resulted in 1 message; to find out more, see the checks page. Generated by 🚫 dangerJS |
@@ -4,6 +4,7 @@ public enum PBXProductType: String, Decodable { | |||
case none = "" | |||
case application = "com.apple.product-type.application" | |||
case framework = "com.apple.product-type.framework" | |||
case staticFramework = "com.apple.product-type.framework.static" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding a comment explaining why this type and a reference to the project you mentioned on the PR description? I think we should clearly state that this is not a standard product type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bringing this up @ileitch. I left a comment on a minor thing. Once addressed, we are ready to go.
Hmm, that repo has been deprecated for 4 years... |
This won't actually work correctly as a static framework without also changing the object type correct? I think because of that this shouldn't be added since it would mislead consumers who actually want static frameworks since they'd also have to set custom settings |
Oh I must have misread? So this product type works (meaning it would set the setting I was talking about by default) but isn't documented? In that case I'm fully in support and we should file radars to make this public. Note static frameworks aren't supported by apple in general anywhere in their docs. |
Here's an open radar about the issue: https://openradar.appspot.com/9403816 For my purposes I only needed to parse the project and identify targets, members files. I can't comment on the viability of the build frameworks, though I'm guessing it must work to some extent since Realm is still using it? |
I've confirmed this does work, even on iOS, if you change the project.pbxproj to this type instead of the normal framework type. It correctly sets the object type to static |
@keith does that mean that the compiler is able to link that framework statically? Can that framework be copied to the application bundle and have access to the resources in it? |
The linker is able to link it statically yes. I didn’t try but I doubt it handles resources automatically, you likely have to add those to the necessary copy resources phase manually |
Still want me to add comment for this? So it looks like it's just an undocumented type rather than non-standard? |
Yes, I'd still add the comment @ileitch. After that, we can merge this PR. |
Danger has errored[!] Invalid
Generated by 🚫 Danger |
The realm-cocoa project contains a product type of
com.apple.product-type.framework.static
. It's a non-standard product type which appears to be created by https://github.com/kstenerud/iOS-Universal-Framework. Usually I wouldn't suggest to support non-standard types like this, but it's a small change and enables compatibility with a popular project.