Update Makefile

to @go install ./cmd/mapstructure-to-hcl2 so that we can `make generate` and tests that generated code is what it should be
This commit is contained in:
Adrien Delorme 2019-10-15 11:12:39 +02:00
parent a8b2918d0e
commit 1158eeb46d
1 changed files with 3 additions and 0 deletions

View File

@ -53,6 +53,7 @@ install-gen-deps: ## Install dependencies for code generation
@(cd $(TEMPDIR) && GO111MODULE=on go get github.com/mna/pigeon@master) @(cd $(TEMPDIR) && GO111MODULE=on go get github.com/mna/pigeon@master)
@(cd $(TEMPDIR) && GO111MODULE=on go get github.com/alvaroloes/enumer@master) @(cd $(TEMPDIR) && GO111MODULE=on go get github.com/alvaroloes/enumer@master)
@go install ./cmd/struct-markdown @go install ./cmd/struct-markdown
@go install ./cmd/mapstructure-to-hcl2
dev: ## Build and install a development build dev: ## Build and install a development build
@grep 'const VersionPrerelease = ""' version/version.go > /dev/null ; if [ $$? -eq 0 ]; then \ @grep 'const VersionPrerelease = ""' version/version.go > /dev/null ; if [ $$? -eq 0 ]; then \
@ -97,6 +98,8 @@ fmt-examples:
generate: install-gen-deps ## Generate dynamically generated code generate: install-gen-deps ## Generate dynamically generated code
@echo "==> removing autogenerated markdown..." @echo "==> removing autogenerated markdown..."
@find website/source/ -type f | xargs grep -l '^<!-- Code generated' | xargs rm @find website/source/ -type f | xargs grep -l '^<!-- Code generated' | xargs rm
@echo "==> removing autogenerated code..."
@find find post-processor common helper template builder provisioner -type f | xargs grep -l '^// Code generated' | xargs rm
go generate ./... go generate ./...
go fmt common/bootcommand/boot_command.go go fmt common/bootcommand/boot_command.go
go fmt command/plugin.go go fmt command/plugin.go