diff options
| author | Jeff Carr <[email protected]> | 2025-10-09 01:04:24 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-09 01:04:24 -0500 |
| commit | 346956ca4bae0792c03c35b54b75bdea5350814c (patch) | |
| tree | e162a435ac6d60dc758d0f7a5cecdd522d7e2ef1 | |
| parent | 7b73f1d91d88bb8974435ab9b16f5a4c8f5d7307 (diff) | |
common protobuf makefile
| -rw-r--r-- | Makefile | 38 | ||||
| -rw-r--r-- | generate.go (renamed from generate.off) | 5 |
2 files changed, 8 insertions, 35 deletions
@@ -1,11 +1,8 @@ -# You must use the current protoc-gen-go -# -# go-clone --go-src google.golang.org/protobuf -# cd ~/go/src/google.golang.org/protobuf/cmd/protoc-gen-go -# go install +all: set.pb.go goimports vet + @echo This GO code passes the compile checks - -all: forgeConfig.pb.go patch.pb.go set.pb.go goimports vet +set.pb.go: set.proto + make generate generate: clean go mod init @@ -14,37 +11,14 @@ generate: clean go-generate: rm -f *.pb.go *.patch - go get go.wit.com/apps/autogenpb -forgeConfig.pb.go: forgeConfig.proto - autogenpb --proto forgeConfig.proto +goimports: + goimports -w *.go vet: @GO111MODULE=off go vet - @echo this go library package builds okay - -# autofixes your import headers in your golang files -goimports: - goimports -w *.go clean: rm -f *.pb.go *.patch -rm -f go.* go-mod-clean purge - -# patchset.pb.go: patchset.proto -# autogenpb --proto patchset.proto - -patch.pb.go: patch.proto - autogenpb --proto patch.proto - -set.pb.go: set.proto - autogenpb --proto set.proto - -protoc-test: - cd ~/go/src && protoc \ - --proto_path=. \ - --go_out=. \ - --go_opt=Mgo.wit.com/lib/protobuf/forgepb/patchset.proto=go.wit.com/lib/protobuf/forgepb \ - --go_opt=Mgo.wit.com/lib/protobuf/httppb/httpRequest.proto=go.wit.com/lib/protobuf/httppb \ - go.wit.com/lib/protobuf/forgepb/patchset.proto diff --git a/generate.off b/generate.go index 6158d14..936e322 100644 --- a/generate.off +++ b/generate.go @@ -4,11 +4,10 @@ package forgepb // NOTE: it would be helpful if go.mod doesn't exist, that go generate // would automatically run go mod init and go mod tidy -// and allow directives to 'go get go.wit.com/apps/autogenpb' -// then this process could be fully automated +// This would allow directives like 'go install go.wit.com/apps/autogenpb' +// Then this process could be fully automated // //go:generate make go-generate -//go:generate go install -v go.wit.com/apps/autogenpb //go:generate autogenpb --proto forgeConfig.proto //go:generate autogenpb --proto patch.proto //go:generate autogenpb --proto set.proto |
