mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-25 16:31:10 -06:00
cb7713bc54
Signed-off-by: Serdar Dalgıç <sd@serdardalgic.org>
65 lines
1.7 KiB
Makefile
65 lines
1.7 KiB
Makefile
export PATH := $(abspath bin/):${PATH}
|
|
|
|
# Dependency versions
|
|
LICENSEI_VERSION = 0.9.0
|
|
|
|
# generate runs `go generate` to build the dynamically generated
|
|
# source files, except the protobuf stubs which are built instead with
|
|
# "make protobuf".
|
|
.PHONY: generate
|
|
generate:
|
|
go generate ./...
|
|
|
|
# We separate the protobuf generation because most development tasks on
|
|
# OpenTofu do not involve changing protobuf files and protoc is not a
|
|
# go-gettable dependency and so getting it installed can be inconvenient.
|
|
#
|
|
# If you are working on changes to protobuf interfaces, run this Makefile
|
|
# target to be sure to regenerate all of the protobuf stubs using the expected
|
|
# versions of protoc and the protoc Go plugins.
|
|
.PHONY: protobuf
|
|
protobuf:
|
|
go run ./tools/protobuf-compile .
|
|
|
|
.PHONY: fmtcheck
|
|
fmtcheck:
|
|
"$(CURDIR)/scripts/gofmtcheck.sh"
|
|
|
|
.PHONY: importscheck
|
|
importscheck:
|
|
"$(CURDIR)/scripts/goimportscheck.sh"
|
|
|
|
.PHONY: staticcheck
|
|
staticcheck:
|
|
"$(CURDIR)/scripts/staticcheck.sh"
|
|
|
|
.PHONY: exhaustive
|
|
exhaustive:
|
|
"$(CURDIR)/scripts/exhaustive.sh"
|
|
|
|
# Run license check
|
|
.PHONY: license-check
|
|
license-check:
|
|
go mod vendor
|
|
licensei cache --debug
|
|
licensei check --debug
|
|
licensei header --debug
|
|
rm -rf vendor/
|
|
git diff --exit-code
|
|
|
|
# Install dependencies
|
|
deps: bin/licensei
|
|
deps:
|
|
|
|
bin/licensei: bin/licensei-${LICENSEI_VERSION}
|
|
@ln -sf licensei-${LICENSEI_VERSION} bin/licensei
|
|
bin/licensei-${LICENSEI_VERSION}:
|
|
@mkdir -p bin
|
|
curl -sfL https://git.io/licensei | bash -s v${LICENSEI_VERSION}
|
|
@mv bin/licensei $@
|
|
|
|
# disallow any parallelism (-j) for Make. This is necessary since some
|
|
# commands during the build process create temporary files that collide
|
|
# under parallel conditions.
|
|
.NOTPARALLEL:
|