-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
94 lines (77 loc) · 1.65 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
85
86
87
88
89
90
91
92
93
94
# Installs all dependencies
default:
@composer install
# Runs unit tests
#
# To run tests for a single operation, add `op=<operation>`.
#
# Example:
# make test op=map
#
test:
ifdef op
@vendor/bin/phpunit tests/$(op)Test.php --no-coverage
else
@vendor/bin/phpunit tests/ --no-coverage
endif
# Runs all unit tests with code coverage analysis
#
# To generate code coverage for a single operation, add `op=<operation>`.
#
# Example:
# make test-coverage op=map
#
test-coverage:
ifdef op
@vendor/bin/phpunit tests/$(op)Test.php --coverage-text
else
@vendor/bin/phpunit tests/ --coverage-text
endif
# @echo "Test coverage visible at:" $(shell pwd)/test-coverage/index.html
# Checks code against style rules
#
# To check a single operation, add `op=<operation>`
#
# Example:
# make check-style op=map
#
check-style:
ifdef op
@vendor/bin/phpcs --standard=phpcs.xml -s src/$(op).php
else
@vendor/bin/phpcs --standard=phpcs.xml -s src/
endif
# Fixes code to match style rules
#
# To fix a single operation, add `op=<operation>`
#
# Example:
# make fix-style op=map
#
fix-style:
ifdef op
@vendor/bin/phpcbf --standard=phpcs.xml -s src/$(op).php
else
@vendor/bin/phpcbf --standard=phpcs.xml -s src/
endif
# Builds documentation for all operations
docs:
@bin/docs.php src docs/Operations.md
# Removes all generated files
clean:
@rm -rf test-coverage/ vendor/
# Creates, tags, and pushes a new release
#
# Example:
# make release v=1.2.3
#
release:
make test
make docs
git add docs/Operations.md
git commit -m "Release v$v" --allow-empty
git tag -a v$(v) -m v$(v)
git push
git push --tags
# Forces these commands to always run
.PHONY: test test-coverage docs