Skip to content

Conversation

@longsview
Copy link
Contributor

@longsview longsview commented Nov 5, 2024

Added support for language and region. This can be done through the auto scheme generation using autogeneration_config:

xcodeproj(
        …
        scheme_autogeneration_config = xcschemes.autogeneration_config(
             test = xcschemes.autogeneration.test(
                 test_options = xcschemes.test_options(
                     app_language = "en",
                     app_region = "US",
                 )
             )
        ),
        …
)

or by providing an options struct in a custom scheme:

xcschemes.scheme(
        …
        test = xcschemes.test(
            …
            test_options = xcschemes.test_options(
                app_language = "en",
                app_region = "US",
            ),
            …
        ),
        …
)

These configurations will add the appropriate tags to the <TestAction> tag.

Corresponding settings in Xcode:

@brentleyjones brentleyjones changed the title Added optional key/value pairs to be used in the TestAction tag Add support for App Language and App Region scheme test action options Nov 12, 2024
@longsview longsview marked this pull request as ready for review November 12, 2024 16:19
@longsview longsview requested a review from a team as a code owner November 12, 2024 16:20
@longsview longsview force-pushed the longsview/add-test-action-attributes-to-xcschemes branch from 62b5468 to 8601d94 Compare November 12, 2024 16:57
longsview and others added 24 commits November 12, 2024 08:57
…in the TestAction tag in xcscheme files

Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
…rguments.swift

Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Signed-off-by: longsview <[email protected]>
@longsview longsview force-pushed the longsview/add-test-action-attributes-to-xcschemes branch from 8601d94 to 6a85ca0 Compare November 12, 2024 16:57
Signed-off-by: longsview <[email protected]>
Signed-off-by: longsview <[email protected]>
@longsview longsview requested a review from a team as a code owner November 12, 2024 19:59
Signed-off-by: longsview <[email protected]>
Signed-off-by: longsview <[email protected]>
Signed-off-by: longsview <[email protected]>
Signed-off-by: longsview <[email protected]>
@brentleyjones brentleyjones merged commit 5ec1745 into MobileNativeFoundation:main Nov 13, 2024
2 checks passed
@longsview longsview deleted the longsview/add-test-action-attributes-to-xcschemes branch November 13, 2024 20:28
diagnostics = None,
env = "inherit",
env_include_defaults = True,
test_options = None,
Copy link

@rasberik rasberik Nov 14, 2024

Choose a reason for hiding this comment

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

Sorry for message on the PR instead of creating issue, Im getting this failure on 2.9.0, and suspecting this is the cause (not this line specifically)

Error in add_all: expected value of type 'sequence or depset' for values, got 'NoneType'

	File "/bazel-output-base/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~2.9.0/xcodeproj/internal/xcodeproj_incremental_rule.bzl", line 708, column 53, in _xcodeproj_incremental_impl
		(xcschemes, xcschememanagement) = _write_schemes(
	File "/bazel-output-base/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~2.9.0/xcodeproj/internal/xcodeproj_incremental_rule.bzl", line 540, column 67, in _write_schemes
		autogeneration_config_file = _write_autogeneration_config_file(
	File "/bazel-output-base/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~2.9.0/xcodeproj/internal/xcodeproj_incremental_rule.bzl", line 222, column 17, in _write_autogeneration_config_file
		args.add_all(config.get("test_options"))

Copy link
Contributor

Choose a reason for hiding this comment

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

karim-alweheshy pushed a commit to karim-alweheshy/rules_xcodeproj that referenced this pull request Mar 6, 2025
…tions (MobileNativeFoundation#3105)

Added support for `language` and `region`. This can be done through the
auto scheme generation using `autogeneration_config`:

```
xcodeproj(
        …
        scheme_autogeneration_config = xcschemes.autogeneration_config(
             test = xcschemes.autogeneration.test(
                 test_options = xcschemes.test_options(
                     app_language = "en",
                     app_region = "US",
                 )
             )
        ),
        …
)
```

or by providing an options struct in a custom scheme:

```
xcschemes.scheme(
        …
        test = xcschemes.test(
            …
            test_options = xcschemes.test_options(
                app_language = "en",
                app_region = "US",
            ),
            …
        ),
        …
)
```

These configurations will add the appropriate tags to the `<TestAction>`
tag.

Corresponding settings in Xcode:
<img width="500"
src="https://github.com/user-attachments/assets/9bef3d96-99bf-4b20-92a0-2b8548766783">

---------

Signed-off-by: longsview <[email protected]>
Signed-off-by: Brentley Jones <[email protected]>
Signed-off-by: Nicholas Long <[email protected]>
Co-authored-by: Brentley Jones <[email protected]>
Co-authored-by: Chuck Grindel <[email protected]>
Signed-off-by: Karim Alweheshy <[email protected]>
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.

4 participants