From d53f356dcd9932b46ce017b88e75e18806824cfb Mon Sep 17 00:00:00 2001 From: Laramie Leavitt Date: Wed, 2 Mar 2016 10:10:19 -0800 Subject: [PATCH] Add build files for submodules --- BUILD | 18 +++++++++++++++++- subbare.go | 10 ++++++++++ submodule/src/BUILD | 9 +++++++++ subremote.go | 10 ++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 subbare.go create mode 100644 submodule/src/BUILD create mode 100644 subremote.go diff --git a/BUILD b/BUILD index 22b7ee8..fe176b4 100644 --- a/BUILD +++ b/BUILD @@ -28,4 +28,20 @@ go_binary( deps = [ "@bare//:bare", ], -) \ No newline at end of file +) + +go_binary( + name ="subbare", + srcs = [ "subbare.go" ], + deps = [ + "//submodule/src:bare", + ], +) + +go_binary( + name ="subremote", + srcs = [ "subremote.go" ], + deps = [ + "//submodule/src/remote", + ], +) diff --git a/subbare.go b/subbare.go new file mode 100644 index 0000000..155f6c4 --- /dev/null +++ b/subbare.go @@ -0,0 +1,10 @@ +package main + +import ( + "fmt" + "github.com/laramiel/bazel-example-golang-bare/bare" +) + +func main() { + fmt.Println("Hello", local.World()) +} diff --git a/submodule/src/BUILD b/submodule/src/BUILD new file mode 100644 index 0000000..037c537 --- /dev/null +++ b/submodule/src/BUILD @@ -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"], +) diff --git a/subremote.go b/subremote.go new file mode 100644 index 0000000..20230e1 --- /dev/null +++ b/subremote.go @@ -0,0 +1,10 @@ +package main + +import ( + "fmt" + "github.com/laramiel/bazel-example-golang-remote/remote" +) + +func main() { + fmt.Println("Hello", remote.World()) +}