quickfeed icon indicating copy to clipboard operation
quickfeed copied to clipboard

chore: replace Makefile target tools with simpler alternative

Open meling opened this issue 1 year ago • 0 comments

We should simplify installing the tools dependencies. The Makefile tools target and its sub-targets works, but it is a bit magic, requiring even people with general makefile knowledge to lookup the documentation to understand what's going on.

  • Move the tools.go file to internal/tools package.
  • Augment the tools.go file with lines like this: //go:generate go install google.golang.org/protobuf/cmd/protoc-gen-go

The Makefile would instead do this:

tools: internal/tools/*.go
	go generate --tags tools ./internal/tools

This is inspired by protopatch.

Or we could wait for golang/go issue #48429, which should obviate the need for a separate tools.go file and Makefile targets, since it would be supported by the go command itself.

meling avatar Jul 16 '24 19:07 meling