Closed narlei closed 7 months ago
The issue is that //:MySampleSource
was merged into //:MySampleApp
, so there is no library target to put in the scheme.
We have a couple options:
xcschemes.top_level_anchor_target
into xcschemes.top_level_build_target
when //:MySampleApp
is focusedI like the second option, since it works in both focused and unfocused cases, and you don't have to concern yourself with target merging.
Description
We can't declare a library that is directly dependent on the top_level_target AND the transitive dependencies on the
xcschemes.scheme.run.build_targets.xcschemes.top_level_anchor_target.library_targets
To understand the problem, this is my graph:
I'm using:
The error:
If I don't declare the
//:MySampleSource
on thelibrary_targets
it will work, creating the project. On Xcode it will show the sources (when focusing on//:MySampleSource
). But the library//:MySampleSource
will not show on the Targets list:The other way to make it work is moving all dependencies to the
ios_application
deps:From:
To:
Then it will create the project and show all the libraries on the Targets list:
The problem only happens when I have dependencies of a dependency on the libraries list, the direct dependency is not found on the list.
Reproduction steps
You can find the example to reproduce on: https://github.com/narlei/bazel_sample/tree/bug/application_direct_dependency
We're creating an
ios_application
with a dependency onMySampleSource
:The
MySampleSource
contains the app dependenciesLibraryACore, LibraryAInterface
:My scheme:
The error:
The rules_xcodeproj isn't finding the
MySampleSource
on the target lists.Expected behavior
I want to add all dependencies of my top_level that I want to create the scheme manually.
rules_xcodeproj version
1.16.0
Xcode version
15.0.0
Bazel version
6.4.0
rules_apple version
3.1.1
rules_swift version
1.13.0
Additional information
No response