You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should associate prefixes with external repository names. These prefixes would be used transform import paths to Bazel labels for repositories that haven't been fetched and can't be indexed yet (see #12).
In the examples below, we would transform dependencies on github.com/example/project to @repo_with_custom_name//:go_default_library.
For go_repository, we can infer this from importpath or remote.
go_repository(
name = "repo_with_custom_name",
importpath = "github.com/example/project",
)
We may be able to do this for git_repository, too, in some cases.
git_repository(
name = "repo_with_custom_name",
remote = "https://github.com/example/project",
)
This wouldn't work with import path redirection. In particular, it wouldn't work with golang.org, gopkg.in, any fork, or private repositories. Gazelle should recognize directives in WORKSPACE to override the import path.
If Gazelle can't discover the repository by parsing WORKSPACE (i.e., if a repository is declared in a macro), we should be able to read standalone declarations that map the prefix to the repo name.
Gazelle now reads go_repository rules from WORKSPACE when starting
up. When externalResolver encounters an import path that is covered by
one of the declared external repositories, it will emit a label using
that repository's name. This allows custom repository names.
Fixesbazel-contrib#13
Gazelle now reads go_repository rules from WORKSPACE when starting
up. When externalResolver encounters an import path that is covered by
one of the declared external repositories, it will emit a label using
that repository's name. This allows custom repository names.
Fixes#13
(Migrated from bazel-contrib/rules_go#606)
We should associate prefixes with external repository names. These prefixes would be used transform import paths to Bazel labels for repositories that haven't been fetched and can't be indexed yet (see #12).
In the examples below, we would transform dependencies on
github.com/example/project
to@repo_with_custom_name//:go_default_library
.For
go_repository
, we can infer this fromimportpath
orremote
.We may be able to do this for
git_repository
, too, in some cases.This wouldn't work with import path redirection. In particular, it wouldn't work with golang.org, gopkg.in, any fork, or private repositories. Gazelle should recognize directives in WORKSPACE to override the import path.
If Gazelle can't discover the repository by parsing WORKSPACE (i.e., if a repository is declared in a macro), we should be able to read standalone declarations that map the prefix to the repo name.
The text was updated successfully, but these errors were encountered: