robfig / glock

MIT License
230 stars 27 forks source link

Any way to install binaries? #3

Closed joeshaw closed 10 years ago

joeshaw commented 10 years ago

I would like a Go dependency management tool to be able to handle installing specific versions of binaries. Is there a way to do this with glock?

For instance, I'd like to be able to lock a specific revision of github.com/jteeuwen/go-bindata/go-bindata. It is installed into $GOPATH/bin, and I can't import it directly into my code.

I've tried creating a deps.go file with // +build ignore at the top, but glock seems to ignore the file in that case. If I remove the build ignore flag it gets github.com/jteeuwen/go-bindata, but not the go-bindata binary. (Then my program also fails to build because I am trying to import something that isn't a package.)

If it's not possible, would you consider adding something like this to glock?

robfig commented 10 years ago

This sounds like a great feature.

One possible implementation:

"glock bin path/to/project/cmd/prog" could add "bin path/to/project/cmd/prog" to the bottom of the GLOCKFILE and then recompute dependencies. When computing dependencies, glock would consider the "bin" lines as imports.

The only thing that's a little bit dirty about the above is that the GLOCKFILE will contain computed data as well as user-provided configuration. Presently it is purely computed from the GOPATH. It's probably ok.. doesn't seem worth adding a 2nd file to avoid it.

robfig commented 10 years ago

Please give it a shot and let me know how it works for you https://github.com/robfig/glock/commit/a593771826c98c6178a73f013629aeb921bd56b7