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

Add .staticFramework to PBXProductType. #347

Merged
merged 2 commits into from
May 3, 2019

Conversation

ileitch
Copy link
Contributor

@ileitch ileitch commented Nov 10, 2018

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.

@ghost
Copy link

ghost commented Nov 10, 2018

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"
Copy link
Contributor

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.

Copy link
Contributor

@pepicrft pepicrft left a 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.

@yonaskolb
Copy link
Collaborator

Hmm, that repo has been deprecated for 4 years...

@keith
Copy link
Contributor

keith commented Nov 13, 2018

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

@pepicrft
Copy link
Contributor

pepicrft commented Nov 13, 2018

This won't actually work correctly as a static framework without also changing the object type correct?

I think so because is not a product type supported by Xcode. I wonder why Realm uses that one.
Let's wait to see @ileitch's thoughts on this but I agree with your misleading point @keith

@keith
Copy link
Contributor

keith commented Nov 13, 2018

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.

@ileitch
Copy link
Contributor Author

ileitch commented Nov 13, 2018

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?

@keith
Copy link
Contributor

keith commented Nov 15, 2018

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

pepicrft
pepicrft previously approved these changes Nov 16, 2018
@pepicrft
Copy link
Contributor

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?

@keith
Copy link
Contributor

keith commented Nov 17, 2018

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

@ileitch
Copy link
Contributor Author

ileitch commented Nov 22, 2018

Still want me to add comment for this? So it looks like it's just an undocumented type rather than non-standard?

@pepicrft
Copy link
Contributor

Yes, I'd still add the comment @ileitch. After that, we can merge this PR.

@pepicrft pepicrft merged commit 0b6aade into tuist:master May 3, 2019
@tuistbot
Copy link

tuistbot commented May 3, 2019

Danger has errored

[!] Invalid Dangerfile file: Error running SwiftFormat:
Error: �[0mdyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /usr/local/bin/swiftformat
Reason: image not found�[0m. Updating the Danger gem might fix the issue. Your Danger version: 5.15.0, latest Danger version: 6.0.6

 #  from Dangerfile:12
 #  -------------------------------------------
 #  swiftformat.additional_args = "--config .swiftformat"
 >  swiftformat.check_format(fail_on_error: true)
 #  swiftlint.lint_files(fail_on_error: true)
 #  -------------------------------------------

Generated by 🚫 Danger

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

Successfully merging this pull request may close these issues.

5 participants