-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (61 loc) · 2.59 KB
/
Makefile
File metadata and controls
71 lines (61 loc) · 2.59 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.PHONY: build check run test clean bump-patch bump-minor bump-major update-formula release
## Build the project (debug)
build:
cargo build
## Release build — use this before manual testing
release:
cargo build --release
zip -j target/release/chrome-devtools-macos-arm64.zip target/release/chrome-devtools
## Type-check without producing a binary
check:
cargo check
## Run the CLI; pass subcommands via ARGS
## make run ARGS="list-pages"
## make run ARGS="screenshot --output out.png"
run:
cargo run -- $(ARGS)
## Run tests
test:
cargo test
## Remove build artifacts
clean:
cargo clean
## Bump the patch version (0.1.3 → 0.1.4) and update all version references
bump-patch:
@old=$$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/'); \
major=$$(echo $$old | cut -d. -f1); \
minor=$$(echo $$old | cut -d. -f2); \
patch=$$(echo $$old | cut -d. -f3); \
new="$$major.$$minor.$$((patch+1))"; \
sed -i '' "s/^version = \"$$old\"/version = \"$$new\"/" Cargo.toml; \
sed -i '' "s/version \"$$old\"/version \"$$new\"/" Formula/chrome-devtools.rb; \
sed -i '' "s|/$$old/|/$$new/|g" Formula/chrome-devtools.rb; \
echo "$$old → $$new"
## Bump the minor version (0.1.4 → 0.2.0) and update all version references
bump-minor:
@old=$$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/'); \
major=$$(echo $$old | cut -d. -f1); \
minor=$$(echo $$old | cut -d. -f2); \
new="$$major.$$((minor+1)).0"; \
sed -i '' "s/^version = \"$$old\"/version = \"$$new\"/" Cargo.toml; \
sed -i '' "s/version \"$$old\"/version \"$$new\"/" Formula/chrome-devtools.rb; \
sed -i '' "s|/$$old/|/$$new/|g" Formula/chrome-devtools.rb; \
echo "$$old → $$new"
## Bump the major version (0.1.4 → 1.0.0) and update all version references
bump-major:
@old=$$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/'); \
major=$$(echo $$old | cut -d. -f1); \
new="$$((major+1)).0.0"; \
sed -i '' "s/^version = \"$$old\"/version = \"$$new\"/" Cargo.toml; \
sed -i '' "s/version \"$$old\"/version \"$$new\"/" Formula/chrome-devtools.rb; \
sed -i '' "s|/$$old/|/$$new/|g" Formula/chrome-devtools.rb; \
echo "$$old → $$new"
## Update Formula/chrome-devtools.rb SHA256 from local release zip (run after release-macos, before upload)
## make update-formula
update-formula:
@mac_zip="target/release/chrome-devtools-macos-arm64.zip"; \
echo "Computing macOS SHA256 …"; \
mac_sha=$$(shasum -a 256 "$$mac_zip" | cut -d' ' -f1); \
echo "macOS SHA256: $$mac_sha"; \
sed -i '' "s/sha256 \"[a-f0-9]*\"/sha256 \"$$mac_sha\"/" Formula/chrome-devtools.rb; \
echo "Formula/chrome-devtools.rb updated"