wtool

command
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

README

Basic workspace tool wtool

Setup

For local use, in $GOPATH/src/github.com/bazelbuild/rules_go/go/tools/wtool run go install

Usage examples

wtool com_github_golang_glog [<bazel-importpath2> ...]

OR

wtool -asis github.com/golang/glog [<go-importpath2> ...]

Which will add the HEAD commit of this dependency as a go_repository to your WORKSPACE file.

go_repository(
  name = "com_github_golang_glog",
  commit = "23def4e6c14b4da8ac2ed8007337bc5eb5007998",
  importpath = "github.com/golang/glog",
)

Known Shortcomings

  • The default mode assumes that every '_' is a '.', which is not always true. In those cases use the actual importpath and '-asis'
  • Does not load skylark files and is thus unaware if the given repository is already transitively loaded.
  • Adds the dependency at HEAD, does not allow specification of a specific commit or tag.

Documentation

Overview

wtool augments your bazel WORKSPACE file with go_repository entries

Example Usage:

wtool com_github_golang_glog com_google_cloud_go

will add 2 go_repository rules to your WORKSPACE by converting com_github_golang_glog -> github.com/golang/glog and so forth and then doing a 'git ls-remote' to get the latest commit.

If wtool cannot figure out the bazel -> Go mapping, try Other Usage:

wtool -asis github.com/golang/glog

which takes an importpath, and computes the bazel name + ls-remote as above.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL