summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile13
-rw-r--r--init.go11
2 files changed, 20 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index c9403cc..3485f90 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,15 @@
all: forgeConfig.pb.go patch.pb.go set.pb.go goimports vet
generate: clean
- autogenpb --proto patchset.proto
+ go mod init
+ go mod tidy
+ go generate
+
+go-generate:
+ rm -f *.pb.go *.patch
+ go get go.wit.com/apps/autogenpb
+
+forgeConfig.pb.go: forgeConfig.proto
autogenpb --proto forgeConfig.proto
vet:
@@ -24,9 +32,6 @@ clean:
-rm -f go.*
go-mod-clean purge
-forgeConfig.pb.go: forgeConfig.proto
- autogenpb --proto forgeConfig.proto
-
# patchset.pb.go: patchset.proto
# autogenpb --proto patchset.proto
diff --git a/init.go b/init.go
index 5e2cd8e..4caad03 100644
--- a/init.go
+++ b/init.go
@@ -1,4 +1,15 @@
// Copyright 2025 WIT.COM Inc Licensed GPL 3.0
+//
+// 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
+//
+//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
package forgepb