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

feat: Support multiple dependency index files and document the format #1149

Open
AttilaTheFun opened this issue Jul 7, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@AttilaTheFun
Copy link
Contributor

Per our discussion on Slack, I'd like to be able to support multiple swift_deps_index files and document the required format.

The use case is for consumers with multiple Bazel repositories, some of which do not have Swift packages. I would like to be able to supply additional indices which map module names to Bazel targets which would not otherwise be known to the Swift gazelle plugin.

Initially this could just be allowing multiple data dependencies and allowing the -swift_dependency_index flag to be passed multiple times:

gazelle(
    name = "update_build_files",
    data = [
        "@swift_deps_info//:swift_deps_index",
        "@my_swift_deps_info//:my_swift_deps_index",
    ],
    extra_args = [
        "-swift_dependency_index=$(location @swift_deps_info//:swift_deps_index)",
        "-swift_dependency_index=$(location @my_swift_deps_info//:my_swift_deps_info)",
    ],
    gazelle = ":gazelle_bin",
)

These would be overlaid on top of each other, so the last value for any given dependency would "win".f

In the future we could also possibly upstream support for user-provided resolution indices into gazelle itself, since this seems like a natural extension of the # gazelle:resolve directive.

I started a discussion around the possible gazelle integration here:
https://bazelbuild.slack.com/archives/C01HMGN77Q8/p1720377154969709

@cgrindel cgrindel added the enhancement New feature or request label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants