-
Notifications
You must be signed in to change notification settings - Fork 75
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
Include BUILD
files in Xcode's Project navigator
#301
Include BUILD
files in Xcode's Project navigator
#301
Conversation
xcodeproj/internal/input_files.bzl
Outdated
transitive.append(inputs.srcs) | ||
transitive.append(inputs.non_arc_srcs) | ||
transitive.append(inputs.hdrs) | ||
new_srcs = [] |
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.
This is super verbose, I'm sure there's a nicer way to do this.
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.
Hmm, I guess this is why I just had them as File
.
I wonder if it would be better to have a second extra_file_paths
instead of changing the type of extra_files
? Then in xcodeproj.bzl
we append extra_file_paths
to the transformed extra_files
and call to_dto
on that?
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.
I don't feel strongly either way. I have a slight preference for keeping it as-is because I think this mapping is still simpler than having two ways to add extra files.
I was more asking if there's a more concise way to perform this mapping of a depset. Like inputs.srcs.map(file_path)
.
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.
The downside to this way is that we are cracking open the depset for each target, and if there are files that are duplicated in the inputs it's more efficient to only do it once later.
I'm fine with it like this though, since I'll be refactoring stuff later. Better to keep it localized for now.
As for your question:
transitive.extend([
file_path(file)
for file in inputs.srcs.to_list()
])
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.
Ah I didn't notice this syntax elsewhere, it's surprising to me because it's wrapped in square brackets already. e53f82f
6646444
to
c28e482
Compare
BUILD
files in Xcode's Project navigator
e53f82f
to
8cba5c0
Compare
(Trying to debug a CI issue, sorry for the noise.) |
Thanks for guiding me through this @brentleyjones! 🙌 |
Thanks for the contribution! |
Resolves #300