If a file is owned by multiple targets but only one target is added to the project, the file will not be included in the project, as it will only be associated with one of the targets.
You can reproduce this on an example project like this:
Edit the examples/integration/xcodeproj_targets.bzl file as previously instructed.
Run the command bazel run --config=cache //:xcodeproj-incremental-bazel-sim_arm64.
Open the project.
Note that the Lib/README.md file is not included in the project.
Expected behavior
A file should be included in the project if at least one associated target in the project.
If this is difficult to achieve, will be nice to have a warning for this case.
rules_xcodeproj version
a6640cabc5dd30492dffe0c5fb3da9b114796dba
Xcode version
15.2
Bazel version
7.1
rules_apple version
No response
rules_swift version
No response
Additional information
It seems to be related to how the owned_extra_files value is created in xcodeproj/internal/xcodeproj_macro.bzl.
However, the problem is that the xcodeproj rule expects attr.label_keyed_string_dict and we need something like labed_keyed_list_dict, which doesn't exist in Bazel.
Description
If a file is owned by multiple targets but only one target is added to the project, the file will not be included in the project, as it will only be associated with one of the targets. You can reproduce this on an example project like this:
(
examples/integration/xcodeproj_targets.bzl
)Reproduction steps
examples/integration/xcodeproj_targets.bzl
file as previously instructed.bazel run --config=cache //:xcodeproj-incremental-bazel-sim_arm64
.Expected behavior
A file should be included in the project if at least one associated target in the project. If this is difficult to achieve, will be nice to have a warning for this case.
rules_xcodeproj version
a6640cabc5dd30492dffe0c5fb3da9b114796dba
Xcode version
15.2
Bazel version
7.1
rules_apple version
No response
rules_swift version
No response
Additional information
It seems to be related to how the
owned_extra_files
value is created inxcodeproj/internal/xcodeproj_macro.bzl
. However, the problem is that the xcodeproj rule expectsattr.label_keyed_string_dict
and we need something likelabed_keyed_list_dict
, which doesn't exist in Bazel.