Skip to content

Commit

Permalink
Upgrade rules_go and Gazelle
Browse files Browse the repository at this point in the history
Co-Authored-By: Andrew Z Allen <[email protected]>
  • Loading branch information
kalbasit and achew22 committed Sep 9, 2018
1 parent 5f8f7fb commit 4d5928e
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ os:
- osx

env:
- V=0.10.0
- V=0.16.1

before_install:
- |
Expand Down
4 changes: 1 addition & 3 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_go//go:def.bzl", "gazelle", "go_prefix")

go_prefix("github.com/bazelbuild/bazel-watcher")
load("@bazel_gazelle//:def.bzl", "gazelle")

gazelle(
name = "gazelle",
Expand Down
66 changes: 51 additions & 15 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,63 @@
# See the License for the specific language governing permissions and
# limitations under the License.

git_repository(
http_archive(
name = "com_github_bazelbuild_bazel_integration_testing",
commit = "55a6a70dbcc2cc7699ee715746fb1452788f8d3c",
remote = "https://github.com/bazelbuild/bazel-integration-testing",
sha256 = "c1591d7cf7f209916d8a40b5f714788f4f915187444b8f1b46a55651d4bbd382",
strip_prefix = "bazel-integration-testing-44d8e9716f3415e92f5ddc0215a63fa39e46134d",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-integration-testing/archive/44d8e9716f3415e92f5ddc0215a63fa39e46134d.tar.gz",
"https://github.com/bazelbuild/bazel-integration-testing/archive/44d8e9716f3415e92f5ddc0215a63fa39e46134d.tar.gz",
],
)

load("@com_github_bazelbuild_bazel_integration_testing//tools:repositories.bzl", "bazel_binaries")

bazel_binaries()

rules_go_commit = "74d8ad8f9f59a1d9a7cf066d0980f9e394acccd7"
http_archive(
name = "bazel_skylib",
sha256 = "b5f6abe419da897b7901f90cbab08af958b97a8f3575b0d3dd062ac7ce78541f",
strip_prefix = "bazel-skylib-0.5.0",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/archive/0.5.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/archive/0.5.0.tar.gz",
],
)

# NOTE: URLs are mirrored by an asynchronous review process. They must
# be greppable for that to happen. It's OK to submit broken mirror
# URLs, so long as they're correctly formatted. Bazel's downloader
# has fast failover.

git_repository(
http_archive(
name = "io_bazel_rules_go",
commit = rules_go_commit,
remote = "https://github.com/bazelbuild/rules_go",
sha256 = "97cf62bdef33519412167fd1e4b0810a318a7c234f5f8dc4f53e2da86241c492",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/0.15.3/rules_go-0.15.3.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/0.15.3/rules_go-0.15.3.tar.gz",
],
)

http_archive(
name = "bazel_gazelle",
sha256 = "c0a5739d12c6d05b6c1ad56f2200cb0b57c5a70e03ebd2f7b87ce88cabf09c7b",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/0.14.0/bazel-gazelle-0.14.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/0.14.0/bazel-gazelle-0.14.0.tar.gz",
],
)

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains", "go_repository")
load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains()

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

gazelle_dependencies()

go_repository(
name = "com_github_fsnotify_fsnotify",
commit = "7d7316ed6e1ed2de075aab8dfc76de5d158d66e1",
Expand All @@ -60,15 +93,11 @@ go_repository(
importpath = "golang.org/x/sys",
)

go_repository(
name = "com_github_bazelbuild_rules_go",
commit = rules_go_commit,
importpath = "github.com/bazelbuild/rules_go",
)

# NOTE: this must match rules_go version located at
# https://github.com/bazelbuild/rules_go/blob/master/go/private/repositories.bzl
go_repository(
name = "com_github_golang_protobuf",
commit = "130e6b02ab059e7b717a096f397c5b60111cae74",
commit = "b4deda0973fb4c70b50d226b1af49f3da59f5265",
importpath = "github.com/golang/protobuf",
)

Expand All @@ -77,3 +106,10 @@ go_repository(
commit = "c55883f97322b4bcbf48f734e23d6ab3af1ea488",
importpath = "github.com/gorilla/websocket",
)

# NOTE: this must match rules_go version above, currently set to 0.15.3
go_repository(
name = "com_github_bazelbuild_rules_go",
commit = "0f0d007c89dc67a5a34490acafc5195b191f5045",
importpath = "github.com/bazelbuild/rules_go",
)
1 change: 0 additions & 1 deletion e2e/live_reload/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# gazelle:exclude live_reload_test.go

load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@com_github_bazelbuild_bazel_integration_testing//go:bazel_integration_test.bzl", "bazel_go_integration_test")

bazel_go_integration_test(
Expand Down
1 change: 0 additions & 1 deletion e2e/profiler/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# gazelle:exclude profiler_test.go

load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@com_github_bazelbuild_bazel_integration_testing//go:bazel_integration_test.bzl", "bazel_go_integration_test")

bazel_go_integration_test(
Expand Down
1 change: 0 additions & 1 deletion e2e/simple/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# gazelle:exclude simple_test.go

load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@com_github_bazelbuild_bazel_integration_testing//go:bazel_integration_test.bzl", "bazel_go_integration_test")

bazel_go_integration_test(
Expand Down
5 changes: 3 additions & 2 deletions ibazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_binary")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

go_binary(
name = "ibazel",
Expand Down Expand Up @@ -40,9 +40,9 @@ go_library(
deps = [
"//bazel:go_default_library",
"//ibazel/command:go_default_library",
"//ibazel/live_reload:go_default_library",
"//ibazel/output_runner:go_default_library",
"//ibazel/profiler:go_default_library",
"//ibazel/live_reload:go_default_library",
"//ibazel/workspace_finder:go_default_library",
"//third_party/bazel/master/src/main/protobuf:go_default_library",
"@com_github_fsnotify_fsnotify//:go_default_library",
Expand All @@ -61,6 +61,7 @@ go_test(
"//bazel:go_default_library",
"//bazel/testing:go_default_library",
"//ibazel/command:go_default_library",
"//ibazel/workspace_finder:go_default_library",
"//third_party/bazel/master/src/main/protobuf:go_default_library",
"@com_github_fsnotify_fsnotify//:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion ibazel/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"bytes"

"github.com/bazelbuild/bazel-watcher/third_party/bazel/master/src/main/protobuf"
blaze_query "github.com/bazelbuild/bazel-watcher/third_party/bazel/master/src/main/protobuf"
)

// Lifecycle is an object that listens to the lifecycle events of iBazel and
Expand Down
4 changes: 2 additions & 2 deletions ibazel/live_reload/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"events.go",
"server.go",
"events.go",
"server.go",
],
importpath = "github.com/bazelbuild/bazel-watcher/ibazel/live_reload",
visibility = ["//visibility:public"],
Expand Down
19 changes: 3 additions & 16 deletions ibazel/output_runner/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,19 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
srcs = [
"output_runner.go",
],
srcs = ["output_runner.go"],
importpath = "github.com/bazelbuild/bazel-watcher/ibazel/output_runner",
visibility = ["//ibazel:__subpackages__"],
deps = [
"//bazel:go_default_library",
"//third_party/bazel/master/src/main/protobuf:go_default_library",
"//ibazel/workspace_finder:go_default_library",
"//third_party/bazel/master/src/main/protobuf:go_default_library",
],
)

go_test(
name = "go_default_test",
srcs = [
"output_runner_test.go",
],
srcs = ["output_runner_test.go"],
data = ["output_runner_test.json"],
embed = [":go_default_library"],
importpath = "github.com/bazelbuild/bazel-watcher/ibazel",
deps = [
"//bazel:go_default_library",
"//bazel/testing:go_default_library",
"//ibazel/command:go_default_library",
"//third_party/bazel/master/src/main/protobuf:go_default_library",
"@com_github_fsnotify_fsnotify//:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
],
)
18 changes: 7 additions & 11 deletions ibazel/profiler/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_embed_data")
load("@io_bazel_rules_go//go:def.bzl", "go_embed_data", "go_library")

go_embed_data(
name = "js",
src = "profiler.js",
package = "profiler",
var = "js",
name = "js",
src = "profiler.js",
package = "profiler",
var = "js",
)

go_library(
name = "go_default_library",
srcs = [
"profiler.go",
":js", # keep
":js", # keep
],
importpath = "github.com/bazelbuild/bazel-watcher/ibazel/profiler",
visibility = ["//ibazel:__subpackages__"],
deps = [
"//third_party/bazel/master/src/main/protobuf:go_default_library",
"//bazel:go_default_library",
],
deps = ["//third_party/bazel/master/src/main/protobuf:go_default_library"],
)
10 changes: 2 additions & 8 deletions ibazel/workspace_finder/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = [
"workspace_finder.go",
],
srcs = ["workspace_finder.go"],
importpath = "github.com/bazelbuild/bazel-watcher/ibazel/workspace_finder",
visibility = ["//ibazel:__subpackages__"],
deps = [
"//third_party/bazel/master/src/main/protobuf:go_default_library",
"//bazel:go_default_library",
],
)
13 changes: 12 additions & 1 deletion third_party/bazel/master/src/main/protobuf/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@

package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_go//proto:go_proto_library.bzl", "go_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")

# Apache Version 2.0, January 2004
licenses(["notice"])

proto_library(
name = "build",
srcs = ["build.proto"],
)

go_proto_library(
name = "go_default_library",
importpath = "github.com/bazelbuild/bazel-watcher/third_party/bazel/master/src/main/protobuf",
proto = ":blaze_query_proto",
)

proto_library(
name = "blaze_query_proto",
srcs = ["build.proto"],
)

0 comments on commit 4d5928e

Please sign in to comment.