This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
101 lines (70 loc) · 3.75 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
95
96
97
98
99
100
101
# Powered by https://makefiles.dev/
export PHP_CS_FIXER_IGNORE_ENV=true
################################################################################
_HOOK_FIXTURE_INPUT_FILES := $(shell find test/fixture/hook-generator -name callback.php)
_HOOK_FIXTURE_OUTPUT_FILES := $(_HOOK_FIXTURE_INPUT_FILES:callback.php=expected.php)
_MOCK_FIXTURE_INPUT_FILES := $(shell find test/fixture/mock-generator -name builder.php)
_MOCK_FIXTURE_OUTPUT_FILES := $(_MOCK_FIXTURE_INPUT_FILES:builder.php=expected.php)
_VERIFICATION_FIXTURE_INPUT_FILES := $(shell find test/fixture/verification -name verification.php)
_VERIFICATION_FIXTURE_OUTPUT_FILES := $(_VERIFICATION_FIXTURE_INPUT_FILES:verification.php=expected)
_VERIFICATION_IMAGE_FILES := $(_VERIFICATION_FIXTURE_INPUT_FILES:test/fixture/verification/%/verification.php=artifacts/build/doc-img/%.svg)
_DOC_MARKDOWN_FILES := $(wildcard doc/*.md)
_DOC_HTML_FILES := $(_DOC_MARKDOWN_FILES:doc/%.md=artifacts/build/doc-html/%.html)
GENERATED_FILES += $(_HOOK_FIXTURE_OUTPUT_FILES) $(_MOCK_FIXTURE_OUTPUT_FILES) $(_VERIFICATION_FIXTURE_OUTPUT_FILES)
################################################################################
-include .makefiles/Makefile
-include .makefiles/pkg/php/v1/Makefile
.makefiles/%:
@curl -sfL https://makefiles.dev/v1 | bash /dev/stdin "$@"
################################################################################
.PHONY: doc
doc: artifacts/build/gh-pages
.PHONY: doc-open
doc-open:
open http://localhost:8080/
.PHONY: doc-publish
doc-publish: artifacts/build/gh-pages
scripts/publish-doc "$<"
.PHONY: doc-serve
doc-serve: artifacts/build/gh-pages
php -S 0.0.0.0:8080 -t "$<" assets/router.php
.PHONY: output-examples
output-examples: vendor
scripts/output-examples
.PHONY: test-edge-cases
test-edge-cases: artifacts/test/edge-cases.touch
.PHONY: test-integration
test-integration: artifacts/test/integration.touch
################################################################################
artifacts/build/doc-html/%.html: doc/%.md vendor $(wildcard assets/web/*.tpl.html)
@mkdir -p "$(@D)"
scripts/gfm-to-html "$<" "$@"
artifacts/build/doc-img/%.svg: test/fixture/verification/%/verification.php $(wildcard assets/svg/*.tpl.svg) vendor $(PHP_SOURCE_FILES)
@mkdir -p "$(@D)"
scripts/build-doc-img "$<" "$@"
artifacts/build/doc: $(wildcard assets/web/css/* assets/web/data/* assets/web/img/* assets/web/js/*) $(_DOC_HTML_FILES) $(_VERIFICATION_IMAGE_FILES)
@rm -rf "$@"
@mkdir -p "$@/img/verification"
@cp -av assets/web/css assets/web/data assets/web/img assets/web/js artifacts/build/doc-html/*.html "$@/"
@cp -av artifacts/build/doc-img/* "$@/img/verification/"
artifacts/build/gh-pages: artifacts/build/doc artifacts/build/gh-pages-clone vendor $(wildcard assets/web/*.tpl.html)
scripts/refresh-git-clone artifacts/build/gh-pages-clone
@rm -rf "$@"
cp -a artifacts/build/gh-pages-clone "$@"
scripts/update-gh-pages "$<" "$@"
artifacts/build/gh-pages-clone:
git clone -b gh-pages --single-branch --depth 1 https://github.com/eloquent/phony.git "$@"
artifacts/test/edge-cases.touch: $(PHP_PHPUNIT_REQ) $(_PHP_PHPUNIT_REQ)
php $(_PHP_PHPUNIT_RUNTIME_ARGS) vendor/bin/phpunit $(_PHP_PHPUNIT_ARGS) --no-coverage test/suite-edge-cases
@mkdir -p "$(@D)"
@touch "$@"
artifacts/test/integration.touch: vendor $(PHP_SOURCE_FILES) $(_PHP_TEST_ASSETS)
test/integration/run-all
@mkdir -p "$(@D)"
@touch "$@"
test/fixture/hook-generator/%/expected.php: | test/fixture/hook-generator/%/callback.php
scripts/build-hook-generator-fixture "$|" "$@"
test/fixture/mock-generator/%/expected.php: | test/fixture/mock-generator/%/builder.php
scripts/build-mock-generator-fixture "$|" "$@"
test/fixture/verification/%/expected: | test/fixture/verification/%/verification.php
scripts/build-verification-fixture "$|" "$@"