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
Ensuring the correct platform SDK dependencies path is set #419
Conversation
Resolves tuist#417 - Updating SDK dependency paths to be based on the developer directory and the platform SDK root path Test Plan: - generate the fixture `fixtures/ios_app_with_sdk` via `tuist generate` - Verify the linked system frameworks and libraries have the correct path set based on the platform
Generated by π« Danger |
Codecov Report
@@ Coverage Diff @@
## master #419 +/- ##
==========================================
+ Coverage 92.24% 92.27% +0.02%
==========================================
Files 293 293
Lines 15267 15318 +51
==========================================
+ Hits 14083 14134 +51
Misses 1184 1184
Continue to review full report at Codecov.
|
status: SDKStatus) throws { | ||
let sdk = AbsolutePath("/\(name)") | ||
|
||
guard let sdkExtension = sdk.extension, |
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.
Instead of throwing here, I'd add a new linting rule that verifies that the extension is supported. That way developers can see all the validation issues at once and fix them before running tuist generate
again.
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.
That means then that this Error.unsupported
should be reported as a bug because we should never reach this point if the extension is not supported.
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.
Moving this to a lint rule would be much better - I did attempt that in the previous PR, sadly was unable to as the graph is created before any linting is done.
One idea is to always construct an SDKNode
even if an invalid name is passed in (e.g. Foo
without the extension, or Foo.bar
not a .framework
and .tbd
) and only work out the paths and type later in the pipeline - that way we're able to lint the names. Can play around with this see if it works.
Another is possibly to be more explicit to avoid user error in the first place (will be a breaking change - but maybe ok if we feel its a better choice).
dependencies: [
.sdk(name: "CloudKit", type: .framework),
.sdk(name: "ARKit", type: .framework, status: .optional),
.sdk(name: "libc++", type: .tbd),
]
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.
Another is possibly to be more explicit to avoid user error in the first place (will be a breaking change - but maybe ok if we feel its a better choice).
I like this one π, even though it's a breaking change.
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 be ok for that being a follow up PR to reduce the scope of changes in this one?
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.
Yes!
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.
Added #422
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.
Only a minor thing. Good job @kwridan
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.
πΏ Nice work & Solution
Resolves #417
Short description π
When the project doesn't have the
SDKROOT
setting set at the project level,.sdkRoot
based paths always assume they are for macOS!Solution π¦
Implementation π©βπ»π¨βπ»
Test Plan π
fixtures/ios_app_with_sdk
viatuist generate