This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
74 lines (56 loc) · 3.78 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
.PHONY: docs examples
MILL := ./bin/mill
EXAMPLE_MILL_CONFIG := examples/mill.xml
EXAMPLES_DIR := examples/Showtimes/compiled
EXAMPLES_DIR_PUBLIC := $(EXAMPLES_DIR)/public
code-coverage: ## Run code coverage.
./vendor/bin/phpunit --coverage-html reports/
phpcs: ## Verify code standards.
./vendor/bin/phpcs --standard=PSR2 bin/ src/ tests/
phpunit: ## Run unit tests.
./vendor/bin/phpunit
psalm: ## Run static analysis checks.
./vendor/bin/psalm
test: phpcs psalm phpunit ## Run all checks and unit tests.
npm test
examples: ## Compile examples.
rm -rf $(EXAMPLES_DIR)
mkdir $(EXAMPLES_DIR)
mkdir $(EXAMPLES_DIR_PUBLIC)
make examples-apiblueprint
make examples-openapi
make examples-changelogs
make examples-errors
examples-apiblueprint: ## Compile example API Blueprint definitions.
$(MILL) compile --config=$(EXAMPLE_MILL_CONFIG) --format=apiblueprint --for_public_consumption=true $(EXAMPLES_DIR_PUBLIC)
$(MILL) compile --config=$(EXAMPLE_MILL_CONFIG) --format=apiblueprint $(EXAMPLES_DIR)
examples-openapi: ## Compile example OpenAPI definitions.
$(MILL) compile --config=$(EXAMPLE_MILL_CONFIG) --format=openapi --for_public_consumption=true $(EXAMPLES_DIR_PUBLIC)
$(MILL) compile --config=$(EXAMPLE_MILL_CONFIG) --format=openapi $(EXAMPLES_DIR)
examples-changelogs: ## Compile example changelogs.
$(MILL) changelog --config=$(EXAMPLE_MILL_CONFIG) --private=false $(EXAMPLES_DIR)
@mv $(EXAMPLES_DIR)/changelog.md $(EXAMPLES_DIR)/changelog-public-only-all-vendor-tags.md
$(MILL) changelog --config=$(EXAMPLE_MILL_CONFIG) --private=false --vendor_tag='tag:BUY_TICKETS' --vendor_tag='tag:FEATURE_FLAG' $(EXAMPLES_DIR)
@mv $(EXAMPLES_DIR)/changelog.md $(EXAMPLES_DIR)/changelog-public-only-matched-with-tickets-and-feature-vendor-tags.md
$(MILL) changelog --config=$(EXAMPLE_MILL_CONFIG) --private=false --vendor_tag='tag:DELETE_CONTENT' $(EXAMPLES_DIR)
@mv $(EXAMPLES_DIR)/changelog.md $(EXAMPLES_DIR)/changelog-public-only-matched-with-delete-vendor-tags.md
$(MILL) changelog --config=$(EXAMPLE_MILL_CONFIG) $(EXAMPLES_DIR)
examples-errors: ## Compile example error compilations.
$(MILL) errors --config=$(EXAMPLE_MILL_CONFIG) --private=false $(EXAMPLES_DIR)
@mv $(EXAMPLES_DIR)/1.0/errors.md $(EXAMPLES_DIR)/1.0/errors-public-only-all-vendor-tags.md
@mv $(EXAMPLES_DIR)/1.1/errors.md $(EXAMPLES_DIR)/1.1/errors-public-only-all-vendor-tags.md
@mv $(EXAMPLES_DIR)/1.1.1/errors.md $(EXAMPLES_DIR)/1.1.1/errors-public-only-all-vendor-tags.md
@mv $(EXAMPLES_DIR)/1.1.3/errors.md $(EXAMPLES_DIR)/1.1.3/errors-public-only-all-vendor-tags.md
$(MILL) errors --config=$(EXAMPLE_MILL_CONFIG) --private=false --vendor_tag='tag:BUY_TICKETS' --vendor_tag='tag:FEATURE_FLAG' $(EXAMPLES_DIR)
@mv $(EXAMPLES_DIR)/1.0/errors.md $(EXAMPLES_DIR)/1.0/errors-public-only-unmatched-vendor-tags.md
@mv $(EXAMPLES_DIR)/1.1/errors.md $(EXAMPLES_DIR)/1.1/errors-public-only-unmatched-vendor-tags.md
@mv $(EXAMPLES_DIR)/1.1.1/errors.md $(EXAMPLES_DIR)/1.1.1/errors-public-only-unmatched-vendor-tags.md
@mv $(EXAMPLES_DIR)/1.1.3/errors.md $(EXAMPLES_DIR)/1.1.3/errors-public-only-unmatched-vendor-tags.md
$(MILL) errors --config=$(EXAMPLE_MILL_CONFIG) --private=false --vendor_tag='tag:DELETE_CONTENT' $(EXAMPLES_DIR)
@mv $(EXAMPLES_DIR)/1.0/errors.md $(EXAMPLES_DIR)/1.0/errors-public-only-matched-vendor-tags.md
@mv $(EXAMPLES_DIR)/1.1/errors.md $(EXAMPLES_DIR)/1.1/errors-public-only-matched-vendor-tags.md
@mv $(EXAMPLES_DIR)/1.1.1/errors.md $(EXAMPLES_DIR)/1.1.1/errors-public-only-matched-vendor-tags.md
@mv $(EXAMPLES_DIR)/1.1.3/errors.md $(EXAMPLES_DIR)/1.1.3/errors-public-only-matched-vendor-tags.md
$(MILL) errors --config=$(EXAMPLE_MILL_CONFIG) $(EXAMPLES_DIR)
help: ## Show this help.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'