Compare commits
2 Commits
lotr
...
8efe9263b1
Author | SHA1 | Date | |
---|---|---|---|
8efe9263b1 | |||
a8b370c7b9 |
43
.gitignore
vendored
43
.gitignore
vendored
@ -1,5 +1,38 @@
|
||||
bazel-bazel-*
|
||||
bazel-bin
|
||||
bazel-genfiles
|
||||
bazel-out
|
||||
bazel-testlogs
|
||||
# ---> Bazel
|
||||
# gitignore template for Bazel build system
|
||||
# website: https://bazel.build/
|
||||
|
||||
# Ignore all bazel-* symlinks. There is no full list since this can change
|
||||
# based on the name of the directory bazel is cloned into.
|
||||
/bazel-*
|
||||
|
||||
# Directories for the Bazel IntelliJ plugin containing the generated
|
||||
# IntelliJ project files and plugin configuration. Seperate directories are
|
||||
# for the IntelliJ, Android Studio and CLion versions of the plugin.
|
||||
/.ijwb/
|
||||
/.aswb/
|
||||
/.clwb/
|
||||
|
||||
# ---> Go
|
||||
# If you prefer the allow list template instead of the deny list, see community template:
|
||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||
#
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# Go workspace file
|
||||
go.work
|
||||
|
||||
|
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -4,9 +4,3 @@
|
||||
[submodule "submodule/src/remote"]
|
||||
path = submodule/src/remote
|
||||
url = git://github.com/laramiel/bazel-example-golang-remote
|
||||
[submodule "vendor/github.com/laramiel/bazel-example-golang-remote"]
|
||||
path = vendor/github.com/laramiel/bazel-example-golang-remote
|
||||
url = git://github.com/laramiel/bazel-example-golang-remote
|
||||
[submodule "vendor/github.com/laramiel/bazel-example-golang-bare"]
|
||||
path = vendor/github.com/laramiel/bazel-example-golang-bare
|
||||
url = git://github.com/laramiel/bazel-example-golang-bare
|
||||
|
54
README.md
54
README.md
@ -1,54 +1,2 @@
|
||||
# bazel-example-golang
|
||||
|
||||
An example project demonstrating bazel build rules for go with
|
||||
a local binary (go_binary) and a local library (go_library).
|
||||
|
||||
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
|
||||
|
||||
$ bazel run :remote
|
||||
$ bazel run :bare
|
||||
|
||||
$ git submodule update --init --recursive
|
||||
$ bazel run //submodule:bare
|
||||
$ bazel run //submodule:remote
|
||||
|
||||
$ bazel run //with_vendor:remote
|
||||
$ bazel run //with_vendor:bare
|
||||
|
||||
```
|
||||
|
||||
# Explanation
|
||||
|
||||
This repository works in conjunction with other git repositories to
|
||||
provide a demonstration of Bazel BUILD rules for golang.
|
||||
|
||||
* [bazel-example-golang](https://github.com/laramiel/bazel-example-golang)
|
||||
The main repository, demonstrating binary, local, and remote repository usage.
|
||||
|
||||
* [bazel-example-golang-remote](https://github.com/laramiel/bazel-example-golang-remote)
|
||||
An example remote repository which includes Bazel rules.
|
||||
|
||||
* [bazel-example-golang-bare](https://github.com/laramiel/bazel-example-golang-bare)
|
||||
An example remote repository without any Bazel rules.
|
||||
|
||||
|
||||
Each of the remote repositories is linked into `go_binary()` targets in several
|
||||
ways:
|
||||
|
||||
1. Using the WORKSPACE file to define `git_repository()` rules.
|
||||
This accounts for the `:remote` and `:bare` targets.
|
||||
|
||||
2. Using git submodules to import the repository source, and
|
||||
using those paths. This accounts for the `//submodule:bare`
|
||||
and `//submodule:remote` targets.
|
||||
|
||||
3. Using the VENDOR extension introduced in go1.6.
|
||||
# lotr
|
||||
|
||||
|
7
vendor/github.com/laramiel/BUILD
generated
vendored
7
vendor/github.com/laramiel/BUILD
generated
vendored
@ -1,7 +0,0 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "bare",
|
||||
srcs = ["bazel-example-golang-bare/bare.go"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
1
vendor/github.com/laramiel/bazel-example-golang-bare
generated
vendored
1
vendor/github.com/laramiel/bazel-example-golang-bare
generated
vendored
Submodule vendor/github.com/laramiel/bazel-example-golang-bare deleted from 3bd848fc12
1
vendor/github.com/laramiel/bazel-example-golang-remote
generated
vendored
1
vendor/github.com/laramiel/bazel-example-golang-remote
generated
vendored
Submodule vendor/github.com/laramiel/bazel-example-golang-remote deleted from 4a9199be6e
Reference in New Issue
Block a user