Skip to content

Commit

Permalink
Improve generic makefile (kyma-project#9880)
Browse files Browse the repository at this point in the history
* improve generic makefile
  • Loading branch information
dbadura authored Nov 23, 2020
1 parent f28db0b commit 77ca246
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion common/makefiles/generic-make-go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ endef
verify:: test check-imports check-fmt
format:: imports fmt

release: resolve dep-status verify build-image push-image
release:
$(MAKE) release-dep

#Old Target for dep projects
release-dep: resolve dep-status verify build-image push-image

.PHONY: build-image push-image
build-image: pull-licenses
Expand Down Expand Up @@ -111,6 +115,31 @@ ensure-local:
dep-status-local:
dep status -v

#Go mod
gomod-deps-local:: gomod-vendor-local gomod-verify-local gomod-status-local
$(eval $(call buildpack-mount,gomod-deps))

gomod-check-local:: test-local check-imports-local check-fmt-local
$(eval $(call buildpack-cp-ro,gomod-check))

gomod-component-check-local:: gomod-deps-local gomod-check-local
$(eval $(call buildpack-mount,gomod-component-check))

gomod-release:gomod-component-check build-image push-image

gomod-vendor-local:
GO111MODULE=on go mod vendor -v

gomod-verify-local:
GO111MODULE=on go mod verify

gomod-status-local:
GO111MODULE=on go mod graph

gomod-tidy-local:
GO111MODULE=on go mod tidy

## Source Code tools
check-imports-local:
@if [ -n "$$(goimports -l $$($(FILES_TO_CHECK)))" ]; then \
echo "✗ some files contain not propery formatted imports. To repair run make imports-local"; \
Expand Down

0 comments on commit 77ca246

Please sign in to comment.