| 1 |
# Copyright 2022 The Kubernetes Authors. |
| 2 |
# SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
include ../Makefile-modules.mk |
| 5 |
|
| 6 |
test: |
| 7 |
go test -v -timeout 45m -cover ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.buildDate=2023-01-31T23:38:41Z -X sigs.k8s.io/kustomize/api/provenance.version=(test)" |
| 8 |
|
| 9 |
build: |
| 10 |
go build -ldflags "-X sigs.k8s.io/kustomize/api/provenance.buildDate=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")" ./... |
| 11 |
|
| 12 |
generate: $(MYGOBIN)/k8scopy $(MYGOBIN)/stringer |
| 13 |
go generate ./... |
| 14 |
|
| 15 |
lint: lint-api-static |
| 16 |
|
| 17 |
## lint-api-static runs the linter on the API module |
| 18 |
## with build-tag kustomize_disable_go_plugin_support |
| 19 |
## this aims to catch any issues with the API module |
| 20 |
## that would prevent the API module from being used |
| 21 |
## when the go plugin support is disabled. |
| 22 |
lint-api-static: |
| 23 |
$(MYGOBIN)/golangci-lint cache clean # Workaround for https://github.com/golangci/golangci-lint/issues/3228 |
| 24 |
$(MYGOBIN)/golangci-lint \ |
| 25 |
-c $$KUSTOMIZE_ROOT/.golangci.yml \ |
| 26 |
--build-tags kustomize_disable_go_plugin_support \ |
| 27 |
--path-prefix api \ |
| 28 |
run ./... |