-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (31 loc) · 1.35 KB
/
Makefile
File metadata and controls
44 lines (31 loc) · 1.35 KB
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
42
43
44
.PHONY: build test test-integration vet check ui-install ui-build test-ui test-ui-coverage dev-ui dev-go
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -X github.com/RandomCodeSpace/docsiq/internal/buildinfo.Version=$(VERSION) \
-X github.com/RandomCodeSpace/docsiq/internal/buildinfo.Commit=$(COMMIT) \
-X github.com/RandomCodeSpace/docsiq/internal/buildinfo.Date=$(DATE)
ui-install:
cd ui && npm install
ui-build:
cd ui && npm run build
build: ui-build
CGO_ENABLED=1 go build -tags "sqlite_fts5" -ldflags "$(LDFLAGS)" -o docsiq .
# Filter out ui/node_modules — a transitive npm dep (flatted) ships a Go package
# that would otherwise be walked by `./...`.
GO_PKGS := $(shell CGO_ENABLED=1 go list -tags "sqlite_fts5" ./... 2>/dev/null | grep -v /ui/node_modules/)
test:
CGO_ENABLED=1 go test -tags "sqlite_fts5" -timeout 300s $(GO_PKGS)
test-integration:
CGO_ENABLED=1 go test -tags "sqlite_fts5 integration" -timeout 600s $(GO_PKGS)
vet:
CGO_ENABLED=1 go vet -tags "sqlite_fts5" $(GO_PKGS)
test-ui:
cd ui && npm test -- --run
test-ui-coverage:
cd ui && npm run test:coverage
check: build vet test test-ui
dev-ui:
cd ui && npm run dev
dev-go:
go run . serve