Skip to content

jonny7/bazel-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Bazel with Go for Monorepos.

Instructions

  1. Install Bazel
brew install bazel
  1. Create a WORKSPACE file in the route of the project
  2. Create a BUILD file in the route
  3. Run Gazelle
bazel run //:gazelle  
  1. Update project dependencies (if needed)
bazel run //:gazelle --update-repos -from_file=go.mod
  1. Might need to chmod the shell file
sudo chmod 755 status.sh
  1. Run with stamp
bazel build --stamp --workspace_status_command=$(pwd)/status.sh //... 
  1. Run the binaries
bazel-bin/cmd/a/a_/a 
bazel-bin/cmd/b/b_/b
bazel-bin/cmd/c/c_/c
  1. Update a single binary and recheck the stamps

About

Building Go Monorepos with Bazel

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published