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

language/go: generate embedsrcs attributes from go:embed directives #997

Merged
merged 3 commits into from
Mar 8, 2021

Conversation

jayconrod
Copy link
Contributor

Also, add a dependency on golang.org/x/mod@v0.4.1 since we need to check whether file names are valid for embedding.

Fixes #989

Jay Conrod added 2 commits February 24, 2021 09:46
Needed by embedsrcs: files that will not be included in a module are
not embeddable.

* go get golang.org/x/mod@v0.4.1
* go mod tidy
* go mod vendor
* Manually update deps.bzl and directives in WORKSPACE
* go run ./internal/list_repository_tools_srcs.go -generate internal/go_repository_tools_srcs.bzl
* bazel run //:gazelle

For bazel-contrib#989
@jayconrod jayconrod requested a review from a team February 24, 2021 17:26
@jayconrod
Copy link
Contributor Author

This PR is a bit large, but it's broken into two commits for easier reviewing.

9095891 adds a new dependency; the commit message explains how.

bfc2878 adds the new functionality.

@sluongng
Copy link
Contributor

sluongng commented Mar 1, 2021

Any update on this PR? Should it be assigned to a reviewer?

Copy link
Contributor

@robfig robfig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! No comments on the implementation, other than embedResolver looks complicated enough that it might benefit from some unit tests. Nice work

cmd/gazelle/integration_test.go Show resolved Hide resolved
@jayconrod jayconrod merged commit 5d15f00 into bazel-contrib:master Mar 8, 2021
@jayconrod jayconrod deleted the embedsrcs branch March 8, 2021 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

language/go: generate embedsrcs attribute from //go:embed directive
3 participants