forked from CycloneDX/cyclonedx-gomod
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
41 lines (31 loc) · 860 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
LDFLAGS="-s -w -X github.com/CycloneDX/cyclonedx-gomod/internal/version.Version=v0.0.0-$(shell git show -s --date=format:'%Y%m%d%H%M%S' --format=%cd HEAD)-$(shell git rev-parse HEAD | head -c 12)"
build:
go build -v -ldflags=${LDFLAGS}
.PHONY: build
install:
go install -v -ldflags=${LDFLAGS}
.PHONY: install
generate:
go generate -v ./...
.PHONY: generate
unit-test:
go test -v -short -cover ./...
.PHONY: unit-test
test:
go test -v -cover ./...
.PHONY: test
clean:
go clean ./...
.PHONY: clean
docker:
docker build -t cyclonedx/cyclonedx-gomod -f Dockerfile .
.PHONY: docker
bom:
go run main.go -licenses -std -output bom.xml
cyclonedx validate --input-file bom.xml --input-format xml --fail-on-errors
.PHONY: bom
goreleaser-dryrun:
goreleaser release --skip-publish --snapshot
.PHONY: goreleaser-dryrun
all: clean build test
.PHONY: all