-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (42 loc) · 1.66 KB
/
Makefile
File metadata and controls
53 lines (42 loc) · 1.66 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
45
46
47
48
49
50
51
52
53
.PHONY: build build-convert install test test-convert test-convert-integration lint clean deps
BINARY = probe
OUT_DIR = bin
VERSION = $(shell cat VERSION)
LDFLAGS = -ldflags="-s -w -X github.com/alphawavesystems/flutter-probe/internal/cli.Version=$(VERSION)"
## Download dependencies
deps:
go mod tidy
go mod download
## Build the probe binary
build: deps
@mkdir -p $(OUT_DIR)
go build $(LDFLAGS) -o $(OUT_DIR)/$(BINARY) ./cmd/probe
## Build probe-convert tool
build-convert:
cd tools/probe-convert && go build -ldflags="-s -w" -o ../../$(OUT_DIR)/probe-convert .
## Install probe to GOPATH/bin
install: deps
go install $(LDFLAGS) ./cmd/probe
## Cross-compile for all platforms
build-all: deps
@mkdir -p $(OUT_DIR)
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(OUT_DIR)/probe-linux-amd64 ./cmd/probe
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(OUT_DIR)/probe-darwin-amd64 ./cmd/probe
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o $(OUT_DIR)/probe-darwin-arm64 ./cmd/probe
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(OUT_DIR)/probe-windows-amd64.exe ./cmd/probe
## Run unit tests (probe CLI)
test:
go test ./...
## Run probe-convert unit tests
test-convert:
cd tools/probe-convert && go test ./convert/...
## Run probe-convert integration tests (golden files + lint + dry-run verify)
## Requires probe binary — builds it first if missing.
test-convert-integration: build build-convert
cd tools/probe-convert && go test -v -run "TestGoldenFiles|TestLintGeneratedOutput|TestVerifyDryRun" .
## Lint .probe test files in the tests/ directory
lint:
./$(OUT_DIR)/$(BINARY) lint tests/ || true
## Clean build artifacts
clean:
rm -rf $(OUT_DIR)