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 xcschemes.autogeneration_config #3027

Merged
merged 26 commits into from
May 29, 2024

Conversation

thiagohmcruz
Copy link
Contributor

@thiagohmcruz thiagohmcruz commented May 14, 2024

Resolves #3013

The proposal is to introduce a xcschemes.autogeneration_config macro to allow consumers to configure scheme auto-generation. I'm addressing my particular use case of wanting to exclude certain schemes based on patterns in their names but I'm open to discuss other configurations/exclusion patterns folks might want to add here.

In order to test this note how running (from examples/integration) bazel run //:xcodeproj-incremental-bazel-sim_arm64 generates a project that does not contain the undesired schemes UndesiredScheme_Swift and UnwantedScheme_Swift even though the respective targets do exist.

Copy link
Contributor

@luispadron luispadron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks useful, thanks! What other configuration options do you see in the future?

examples/integration/xcodeproj_targets.bzl Outdated Show resolved Hide resolved
tools/generators/xcschemes/src/Generator/Generator.swift Outdated Show resolved Hide resolved
tools/generators/xcschemes/src/Generator/Generator.swift Outdated Show resolved Hide resolved
xcodeproj/internal/xcodeproj_macro.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcschemes/xcschemes.bzl Outdated Show resolved Hide resolved
@thiagohmcruz
Copy link
Contributor Author

This looks useful, thanks! What other configuration options do you see in the future?

@luispadron I think other exclude_patterns could be useful but maybe we should add more as the need arises? We could exclude based on other scheme attributes too.

Besides that, scheme auto-generation might need other customizations in the future not related to exclusion patterns and for that we can add more attributes the macro. But again, instead of over engineering it now I'd rather improve this API as the need arises from consumers. Thoughts?

@thiagohmcruz thiagohmcruz force-pushed the thiago/scheme-autogeneration-config branch from 6a067dd to 0df79a3 Compare May 17, 2024 16:48
@thiagohmcruz
Copy link
Contributor Author

Trying to understand this CI failure. Have you ever seen this?

cannot load '@@bazel_skylib~//lib:modules.bzl': no such file

cc @brentleyjones

@brentleyjones
Copy link
Contributor

Looks like some issue with Bazel HEAD, which we will need to fix outside of this PR.

@thiagohmcruz thiagohmcruz force-pushed the thiago/scheme-autogeneration-config branch from 0df79a3 to a7de214 Compare May 21, 2024 17:17
@thiagohmcruz thiagohmcruz marked this pull request as ready for review May 21, 2024 20:11
@thiagohmcruz thiagohmcruz requested a review from a team as a code owner May 21, 2024 20:11
@thiagohmcruz thiagohmcruz requested review from brentleyjones and mattrobmattrob and removed request for brentleyjones and mattrobmattrob May 21, 2024 20:14
xcodeproj/internal/xcodeproj_macro.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcschemes/xcschemes.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcschemes/xcschemes.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcschemes/xcschemes_execution.bzl Outdated Show resolved Hide resolved
tools/generators/xcschemes/src/Generator/Generator.swift Outdated Show resolved Hide resolved
tools/generators/xcschemes/src/Generator/Generator.swift Outdated Show resolved Hide resolved
xcodeproj/internal/xcodeproj_macro.bzl Outdated Show resolved Hide resolved
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
@thiagohmcruz thiagohmcruz force-pushed the thiago/scheme-autogeneration-config branch from 93c56d9 to 8b6bc9b Compare May 27, 2024 21:27
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
tools/generators/xcschemes/src/Generator/Generator.swift Outdated Show resolved Hide resolved
xcodeproj/internal/xcodeproj_incremental_rule.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcschemes/xcschemes.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcschemes/xcschemes.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcschemes/xcschemes.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcschemes/xcschemes.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcschemes/xcschemes.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcodeproj_runner.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcodeproj_incremental_rule.bzl Outdated Show resolved Hide resolved
xcodeproj/internal/xcodeproj_incremental_rule.bzl Outdated Show resolved Hide resolved
Co-authored-by: Brentley Jones <github@brentleyjones.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
@thiagohmcruz thiagohmcruz force-pushed the thiago/scheme-autogeneration-config branch from a2f4aa3 to 7b00721 Compare May 29, 2024 17:04
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
Signed-off-by: Thiago Cruz <thiago@squareup.com>
@brentleyjones brentleyjones merged commit 00bf884 into main May 29, 2024
16 checks passed
@brentleyjones brentleyjones deleted the thiago/scheme-autogeneration-config branch May 29, 2024 17:33
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.

Feature Request: Configure if scheme should be created or not based on patterns
3 participants