-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will be needed shortly for a wrapper tool in an upcoming PR. It's a good example anyway. - In WORKSPACE, add dependency on bazel_gazelle. - Add deps.bzl with a go_dependencies macro, tracking dependenices from this workspace. Empty for now. - Add go.mod, go.sum tracking Go dependencies. Empty for now. - Add root BUILD file, declaring a Gazelle target. - Run gazelle. This cleans up go/BUILD and perl/BUILD.
- Loading branch information
Showing
7 changed files
with
57 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
load("@bazel_gazelle//:def.bzl", "gazelle") | ||
|
||
gazelle(name = "gazelle") | ||
|
||
# gazelle:exclude java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
deps.bzl contains macros that declare dependencies for each langauge | ||
that needs them. | ||
""" | ||
|
||
def go_dependencies(): | ||
"""Declares Go dependencies needed by this workspace. | ||
Managed with 'bazel run //:gazelle -- update-repos -from-file=go.mod. | ||
Keep in sync with go.mod. | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/EngFlow/example | ||
|
||
go 1.21.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_binary") | ||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") | ||
|
||
go_binary( | ||
name = "go", | ||
srcs = ["main.go"], | ||
embed = [":go_lib"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
go_library( | ||
name = "go_lib", | ||
srcs = ["main.go"], | ||
importpath = "github.com/EngFlow/example/go", | ||
visibility = ["//visibility:private"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters