Update WORKSPACE / BUILD to work with bazel at HEAD.

Uses external rules_go github repository.
This commit is contained in:
Laramie Leavitt
2016-03-21 16:56:03 -07:00
parent f189432d24
commit dad6f57d6d
11 changed files with 39 additions and 42 deletions

7
BUILD
View File

@ -1,4 +1,4 @@
load("@bazel_tools//tools/build_rules/go:def.bzl", "go_prefix", "go_binary")
load("@io_bazel_rules_go//go:def.bzl", "go_prefix", "go_binary")
package(
default_visibility = ["//visibility:public"],
@ -9,11 +9,6 @@ go_prefix("github.com/laramiel/bazel-example-golang/")
go_binary(
name = "hello",
srcs = ["hello.go"],
)
go_binary(
name = "local",
srcs = ["local.go"],
deps = [
"//local",
],

View File

@ -8,6 +8,8 @@ This requires bazel release > `bazel-0.20`.
```
$ git clone https://github.com/laramiel/bazel-example-golang.git
$ cd bazel-example-golang
$ git submodule init
$ git submodule foreach git pull origin master
$ bazel run :hello

View File

@ -1,4 +1,10 @@
load("@bazel_tools//tools/build_rules/go:def.bzl", "go_repositories")
git_repository(
name = "io_bazel_rules_go",
remote = "https://github.com/bazelbuild/rules_go.git",
commit = "373feb6",
)
load("@io_bazel_rules_go//go:def.bzl", "go_repositories")
go_repositories()

View File

@ -2,8 +2,12 @@ package main
import (
"fmt"
"github.com/laramiel/bazel-example-golang/local/local"
)
func main() {
fmt.Println("Hello World")
fmt.Println("Hello ", local.World())
}

View File

@ -1,10 +0,0 @@
package main
import (
"fmt"
"github.com/laramiel/bazel-example-golang/local/local"
)
func main() {
fmt.Println("Hello ", local.World())
}

View File

@ -1,4 +1,4 @@
load("@bazel_tools//tools/build_rules/go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name ="local",

View File

@ -1,4 +1,4 @@
load("@bazel_tools//tools/build_rules/go:def.bzl", "go_prefix", "go_binary")
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
package(
default_visibility = ["//visibility:public"],

2
vendor/github.com/laramiel/BUILD generated vendored
View File

@ -1,4 +1,4 @@
load("@bazel_tools//tools/build_rules/go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "bare",

View File

@ -1,4 +1,4 @@
load("@bazel_tools//tools/build_rules/go:def.bzl", "go_prefix", "go_binary")
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
package(
default_visibility = ["//visibility:public"],