-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile
84 lines (63 loc) · 1.98 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
SHELL = /bin/bash
export SYMBOLICATOR_PYTHON_VERSION := python3
all: check test
.PHONY: all
check: style lint
.PHONY: check
clean:
cargo clean
rm -rf .venv
.PHONY: clean
# Builds
build:
cargo build
.PHONY: build
release:
cargo build --release --locked
objcopy --only-keep-debug target/release/symbolicator{,.debug}
objcopy --strip-debug --strip-unneeded target/release/symbolicator
objcopy --add-gnu-debuglink target/release/symbolicator{.debug,}
.PHONY: release
# Tests
test:
cargo test --workspace --all-features --locked
.PHONY: test
# Documentation
docs: .venv/bin/python
.venv/bin/pip install -U mkdocs mkdocs-material pygments
.venv/bin/mkdocs build
touch site/.nojekyll
.PHONY: docs
docserver: .venv/bin/python
.venv/bin/pip install -U mkdocs mkdocs-material pygments
.venv/bin/mkdocs serve
.PHONY: doc
# Style checking
style:
@rustup component add rustfmt --toolchain stable 2> /dev/null
cargo +stable fmt -- --check
.PHONY: style
# Linting
lint:
@rustup component add clippy --toolchain stable 2> /dev/null
cargo +stable clippy --all-features --workspace --tests --examples
.PHONY: lint
# Formatting
format:
@rustup component add rustfmt --toolchain stable 2> /dev/null
cargo +stable fmt
.PHONY: format-rust
# Dependencies (currently needed for docs)
.venv/bin/python: Makefile
rm -rf .venv
$$SYMBOLICATOR_PYTHON_VERSION -m venv .venv
# Build GoCD pipelines
gocd:
@ rm -rf ./gocd/generated-pipelines
@ mkdir -p ./gocd/generated-pipelines
@ cd ./gocd/templates && jb install && jb update
@ find . -type f \( -name '*.libsonnet' -o -name '*.jsonnet' \) -print0 | xargs -n 1 -0 jsonnetfmt -i
@ find . -type f \( -name '*.libsonnet' -o -name '*.jsonnet' \) -print0 | xargs -n 1 -0 jsonnet-lint -J ./gocd/templates/vendor
@ cd ./gocd/templates && jsonnet --ext-code output-files=true -J vendor -m ../generated-pipelines ./symbolicator.jsonnet
@ cd ./gocd/generated-pipelines && find . -type f \( -name '*.yaml' \) -print0 | xargs -n 1 -0 yq -p json -o yaml -i
.PHONY: gocd