Add build files for submodules

This commit is contained in:
Laramie Leavitt
2016-03-02 10:10:19 -08:00
parent 18b35c7ea9
commit d53f356dcd
4 changed files with 46 additions and 1 deletions

18
BUILD
View File

@ -28,4 +28,20 @@ go_binary(
deps = [ deps = [
"@bare//:bare", "@bare//:bare",
], ],
) )
go_binary(
name ="subbare",
srcs = [ "subbare.go" ],
deps = [
"//submodule/src:bare",
],
)
go_binary(
name ="subremote",
srcs = [ "subremote.go" ],
deps = [
"//submodule/src/remote",
],
)

10
subbare.go Normal file
View File

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

9
submodule/src/BUILD Normal file
View File

@ -0,0 +1,9 @@
load("@bazel_tools//tools/build_rules/go:def.bzl", "go_prefix", "go_library")
go_prefix("github.com/laramiel/bazel-example-golang-bare/")
go_library(
name = "bare",
srcs = [ "bare/bare.go" ],
visibility = ["//visibility:public"],
)

10
subremote.go Normal file
View File

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