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

Feature Request: Ability to configure what generated file types get pulled into the project #3014

Closed
thiagohmcruz opened this issue Apr 16, 2024 · 6 comments · Fixed by #3017
Assignees
Labels
feature request New feature or request
Milestone

Comments

@thiagohmcruz
Copy link
Contributor

As a rules_ios user I've noticed that some generated files that are an implementation detail of rules_ios are being pulled into Xcode. I'd appreciate the ability to filter those out.

When generating a project, I noticed some performance issues while editing code in a big codebase with many rules_ios frameworks and filtering out unneeded file types has improved the experience for me.

As an example, run this from this repo's root:

cd examples/rules_ios
bazel run //:xcodeproj-incremental 

and note how you can cmd+shift+o and find *_vfs.yaml or *.extended.modulemap files:

Screenshot 2024-04-16 at 12 45 14 PM
Screenshot 2024-04-16 at 12 45 27 PM

We could introduce a global setting here that allows consumers to configure this (say by specifying which generated files .extension types are allowed/not allowed to be processed). That could be a feature consumers are supposed to set in their rc files or a setting specified at the xcodeproj macro level? For example:

xcodeproj(
  ...
  allowed_generated_file_extensions = [".h", ".m"],
  # or
  exclude_generated_file_extensions = [".yaml", ".modulemap"],
)

Thoughts? cc @brentleyjones.

@thiagohmcruz thiagohmcruz added the feature request New feature or request label Apr 16, 2024
@thiagohmcruz
Copy link
Contributor Author

Alternatively we can simply not process any generated file here.

@dnkoutso
Copy link

Perhaps a combination of both in which some generated files are automatically not processed and also ability to specify additional file types?

@thiagohmcruz
Copy link
Contributor Author

thiagohmcruz commented Apr 16, 2024

Perhaps a combination of both in which some generated files are automatically not processed and also ability to specify additional file types?

@dnkoutso We're considering to stop processing generated files and effectively stop over collecting here instead of trying to come up with a way to expose something configurable to users.

This is a lot simpler than what I suggested and we can ensure that generated source files continue to be collected elsewhere. We'll keep this issue updated!

@thiagohmcruz
Copy link
Contributor Author

For future reference, this branch illustrates my use case btw: https://github.com/MobileNativeFoundation/rules_xcodeproj/compare/thiago/generated-file-extensions

cd examples/rules_ios
bazel run //:xcodeproj-incremental

My intent is to continue to allow such a project to index *.pbobjc.m and *.pbobjc.h files since those are relevant to developers and they might want to cmd+shift+o these and inspect APIs and types. But, most other files rules_ios generates (including but not limited to some .h files) are implementation details and not necessary in Xcode.

@brentleyjones
Copy link
Contributor

I think #3017 addresses this.

@thiagohmcruz
Copy link
Contributor Author

I think #3017 addresses this.

It does, thank you!

brentleyjones added a commit that referenced this issue Apr 17, 2024
Resolves #3014.

We now only collect things via attributes. This aligns with how users
expect “input files” to work.

---------

Signed-off-by: Brentley Jones <github@brentleyjones.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants