@@ -22,12 +22,6 @@ VTAG := $(shell [ -z $(VTAG) ] && echo $(ETAG) || echo $(VTAG))
2222VERS ?= $(shell [ -z $(VTAG ) ] && echo 'tip' || echo $(VTAG ) )
2323LDFLAGS := "-X main.date=$(DATE ) -X main.vers=$(VERS ) -X main.hash=$(HASH ) "
2424
25- # Templates
26- # Built into the binary are the contents of ./templates. This is done by
27- # running 'pkger' which generates pkged.go containing templates encoded
28- # as Go objects and exposed at runtime as a filesystem.
29- PKGER ?= ./hack/update-pkger.sh
30-
3125# All Code prerequisites, including generated files, etc.
3226CODE := $(shell find . -name '* .go') pkged.go go.mod schema/func_yaml-schema.json
3327TEMPLATES := $(shell find templates -name '* ' -type f)
@@ -65,6 +59,7 @@ bin/golangci-lint:
6559 curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.43.0
6660
6761pkged.go : $(TEMPLATES )
62+ # Removing temporary template files
6863 @rm -rf templates/node/cloudevents/node_modules
6964 @rm -rf templates/node/http/node_modules
7065 @rm -rf templates/python/cloudevents/__pycache__
@@ -77,8 +72,15 @@ pkged.go: $(TEMPLATES)
7772 @rm -rf templates/quarkus/http/target
7873 @rm -rf templates/springboot/cloudevents/target
7974 @rm -rf templates/springboot/http/target
80- # Generating pkged.go using pkger
81- $(PKGER )
75+ # Encoding ./templates as pkged.go
76+ # See ./hack/tools.go which triggers the vendoring of pkger cmd
77+ # The temp file ./hack/package.go averts a "no buildable files" error
78+ # gofmt updates the resultant pkged.go file to the new build tag f ormat.
79+ @echo "package tools" > hack/package.go
80+ @go run ./vendor/github.com/markbates/pkger/cmd/pkger
81+ @rm hack/package.go
82+ @gofmt -s -w pkged.go
83+
8284
8385clean : # # Remove generated artifacts such as binaries and schemas
8486 rm -f $(BIN ) $(BIN_WINDOWS ) $(BIN_LINUX ) $(BIN_DARWIN )
0 commit comments