-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (24 loc) · 917 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (24 loc) · 917 Bytes
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
BINARY := treblle
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS := -s -w -X main.version=$(VERSION)
# Path to a local checkout of the platform repository, used by sync-spec.
PLATFORM_REPO ?= ../platform
.PHONY: build install test lint fmt vet verify-spec sync-spec check clean
build: ## Build ./bin/treblle
go build -ldflags "$(LDFLAGS)" -o bin/$(BINARY) ./cmd/treblle
install: ## Install treblle into GOPATH/bin
go install -ldflags "$(LDFLAGS)" ./cmd/treblle
test:
go test ./...
fmt:
gofmt -l -w .
vet:
go vet ./...
verify-spec: ## Check every route the CLI calls still exists in api/openapi.json
go run ./tools/verifyspec
sync-spec: ## Refresh api/openapi.json from a local platform checkout
cp $(PLATFORM_REPO)/openapi.json api/openapi.json
@echo "Synced api/openapi.json from $(PLATFORM_REPO)"
check: fmt vet test verify-spec
clean:
rm -rf bin dist