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

Gazelle should support multiple package in the same directory #315

Closed
jayconrod opened this issue Mar 17, 2017 · 4 comments
Closed

Gazelle should support multiple package in the same directory #315

jayconrod opened this issue Mar 17, 2017 · 4 comments
Labels

Comments

@jayconrod
Copy link
Contributor

This will help migrate projects that follow the Blaze style.

A rough outline of rules to be followed. This will need to be refined.

  • Gazelle will read the BUILD file (if it exists) and the files in a directory.
  • For files with a package name that matches the directory name:
  • If a go_library exists with the name go_default_library, it will own these files.
  • If a go_library exists with the name of the directory, it will own these files.
  • If neither rule exists, one of the above rules will be created. Behavior will be controlled by a flag. go_default_library will be the default.
  • If both rules exist, Gazelle will report an error.
  • For files with other package names, add to a go_library rule with a matching name.
  • If test files are present, add them to a go_test rule, following the naming convention above.

NOTE: Gazelle cannot use go/build to do this, since that package assumes sources follow the Go conventions instead of the Blaze conventions.
NOTE: The import path for //foo/bar:bar will be go_prefix/foo/bar/bar.

@ashi009
Copy link
Contributor

ashi009 commented Mar 17, 2017

s/Blaze/Bazel/ ;)

@jayconrod
Copy link
Contributor Author

@ashi009 In this context, I actually meant Blaze :) Bazel is the open source version of Google's internal system called Blaze.

Internal Go projects follow their own set of conventions (Blaze conventions), which is different from the normal Go conventions. We want Gazelle to support both sets of conventions to make it easy to open source internal projects in the future.

@ashi009
Copy link
Contributor

ashi009 commented Mar 17, 2017 via email

@jayconrod
Copy link
Contributor Author

Closing old Gazelle issues. Migrated to bazel-contrib/bazel-gazelle#7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants