Add Go tools in bazel (#608)

* add atlassian bazel tools

* Add bazel entrypoints for native go stuff

* gazelle
This commit is contained in:
Preston Van Loon 2018-10-02 22:04:36 -04:00 committed by GitHub
parent 8bcddf5fdc
commit 763d0d6bdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 58 additions and 4 deletions

View File

@ -1,7 +1,33 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@com_github_atlassian_bazel_tools//gometalinter:def.bzl", "gometalinter")
load("@com_github_atlassian_bazel_tools//goimports:def.bzl", "goimports")
load("@io_kubernetes_build//defs:run_in_workspace.bzl", "workspace_binary")
prefix = "github.com/prysmaticlabs/prysm"
# gazelle:prefix github.com/prysmaticlabs/prysm
gazelle(
name = "gazelle",
prefix = "github.com/prysmaticlabs/prysm",
prefix = prefix,
)
gometalinter(
name = "gometalinter",
config = "//:.gometalinter.json",
paths = [
"./...",
],
prefix = prefix,
)
goimports(
name = "goimports",
display_diffs = True,
write = False,
prefix = prefix,
)
workspace_binary(
name = "golint",
cmd = "@com_github_golang_lint//golint",
)

View File

@ -12,6 +12,12 @@ http_archive(
sha256 = "c0a5739d12c6d05b6c1ad56f2200cb0b57c5a70e03ebd2f7b87ce88cabf09c7b",
)
http_archive(
name = "com_github_atlassian_bazel_tools",
strip_prefix = "bazel-tools-6fef37f33dfa0189be9df4d3d60e6291bfe71177",
urls = ["https://github.com/atlassian/bazel-tools/archive/6fef37f33dfa0189be9df4d3d60e6291bfe71177.zip"],
)
git_repository(
name = "io_bazel_rules_docker",
commit = "7401cb256222615c497c0dee5a4de5724a4f4cc7", # 2018-06-22
@ -61,6 +67,10 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
gazelle_dependencies()
load("@com_github_atlassian_bazel_tools//gometalinter:deps.bzl", "gometalinter_dependencies")
gometalinter_dependencies()
load(
"@io_bazel_rules_docker//go:image.bzl",
_go_image_repos = "repositories",
@ -68,6 +78,12 @@ load(
_go_image_repos()
git_repository(
name = "io_kubernetes_build",
commit = "4ce715fbe67d8fbed05ec2bb47a148e754100a4b",
remote = "https://github.com/kubernetes/repo-infra.git",
)
git_repository(
name = "com_github_jmhodges_bazel_gomock",
commit = "5b73edb74e569ff404b3beffc809d6d9f205e0e4",
@ -594,6 +610,18 @@ go_repository(
importpath = "golang.org/x/sync",
)
go_repository(
name = "com_github_golang_lint",
commit = "06c8688daad7faa9da5a0c2f163a3d14aac986ca",
importpath = "github.com/golang/lint",
)
go_repository(
name = "org_golang_x_lint",
commit = "06c8688daad7faa9da5a0c2f163a3d14aac986ca",
importpath = "golang.org/x/lint",
)
go_repository(
name = "com_github_aristanetworks_goarista",
commit = "ff33da284e760fcdb03c33d37a719e5ed30ba844",

View File

@ -10,7 +10,7 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
gethTypes "github.com/ethereum/go-ethereum/core/types"
"github.com/prysmaticlabs/prysm/beacon-chain/params"

View File

@ -7,7 +7,7 @@ import (
"math/big"
"strings"
"github.com/ethereum/go-ethereum"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
gethTypes "github.com/ethereum/go-ethereum/core/types"
"github.com/prysmaticlabs/prysm/beacon-chain/types"

View File

@ -7,7 +7,7 @@ import (
"strings"
"testing"
"github.com/ethereum/go-ethereum"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
gethTypes "github.com/ethereum/go-ethereum/core/types"
"github.com/prysmaticlabs/prysm/shared/event"