mongodb/mongo-tools — pull request #4 by shelman (2014-10-09 18:10:50+00:00)
Title: TOOLS-274: vendor dependencies

This is big, but the only code that's important is vendor.sh and make.sh. I moved all of the packages to the top level, and all our dependencies are now contained within vendor/src.

I renamed gpm to vendor.sh. I added a little tweak at the beginning, so that it sets GOPATH to vendor/ before running. That way all dependencies will be installed to the vendor/ directory. This shouldn't be necessary to run when cloning the repo if the dependencies are included in the repo.

The most important change is make.sh. Use this now to build the tools, rather than "go build" directly. How make.sh works:
- creates .gopath/src/github.com/mongodb/mongo-tools inside the mongo-tools directory
- soft links it to the root directory of the repo.
- sets GOPATH to .gopath:vendor (a dual GOPATH), so that packages within both .gopath and vendor are available to "go build"
- cd's in, and builds, the specified target, putting the binary in the freshly created bin/ directory.

Run make.sh as
make.sh
i.e
make.sh mongodump

It doesn't support multiple targets, but the "all" target will build all tools.

The one issue here is testing. "go test" won't work directly. I'll take a look at that, but want to get some feedback on this while I am.