-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
138 lines (107 loc) · 2.87 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
.PHONY: dist
include .make/help.mk
include .make/text.mk
PHP_CS_FIXER_VERSION=v3.52.1
##########
# Colors #
##########
COLOR_RESET := \033[0m
COLOR_ERROR := \033[31m
COLOR_INFO := \033[32m
COLOR_WARNING := \033[33m
COLOR_COMMENT := \033[36m
###########
# Install #
###########
## Install - Prepare dev env with Symfony Flex
setup:
symfony composer global require --no-progress --no-scripts --no-plugins symfony/flex
## Install - Install
install: setup
install:
rm -f composer.lock
symfony composer config minimum-stability --unset
symfony composer update --prefer-dist
## Install - Install Symfony 6.4 deps
install.64: setup
install.64: export SYMFONY_REQUIRE = 6.4.*@dev
install.64:
rm -f composer.lock
symfony composer config minimum-stability dev
symfony composer update
symfony composer config minimum-stability --unset
## Install - Install Symfony 7.0 deps
install.70: setup
install.70: export SYMFONY_REQUIRE = 7.0.*@dev
install.70:
rm -f composer.lock
symfony composer config minimum-stability dev
symfony composer update
symfony composer config minimum-stability --unset
## Install - Install Symfony 7.1 deps
install.71: setup
install.71: export SYMFONY_REQUIRE = 7.1.*@dev
install.71:
rm -f composer.lock
symfony composer config minimum-stability dev
symfony composer update
symfony composer config minimum-stability --unset
########
# Lint #
########
## Lint - Lint
lint: lint.php-cs-fixer lint.phpstan lint.twig lint.yaml lint.composer
## Lint - Fix Lint
lint.fix: lint.php-cs-fixer.fix
lint.composer:
symfony composer validate --strict
lint.php-cs-fixer: php-cs-fixer.phar
lint.php-cs-fixer:
symfony php ./php-cs-fixer.phar fix --dry-run --diff
lint.php-cs-fixer.fix: php-cs-fixer.phar
lint.php-cs-fixer.fix:
symfony php ./php-cs-fixer.phar fix
lint.phpstan:
symfony php vendor/bin/phpstan analyse --memory-limit=-1
lint.twig:
symfony php bin/lint.twig.php templates
cd tests/fixtures/app && bin/console lint:twig templates -vv
lint.yaml:
symfony php vendor/bin/yaml-lint --parse-tags config tests/fixtures/app/config
## Lint - Update tools
lint.update:
rm -f php-cs-fixer.phar
make php-cs-fixer.phar
php-cs-fixer.phar:
wget --no-verbose https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/${PHP_CS_FIXER_VERSION}/php-cs-fixer.phar
chmod +x php-cs-fixer.phar
########
# Dist #
########
## Dist - Build dust files
dist:
npx encore production --color
## Dist - Install dist deps
dist.install:
npm install --color=always
## Dist - Update dist deps
dist.update:
npm update --color=always
## Dist - Build & watch dist files
dist.watch:
npx encore dev --watch
########
# Demo #
########
demo:
cd tests/fixtures/app; \
symfony console c:c; \
symfony console stenope:build --no-expose; \
open http://localhost:8000; \
symfony php -S localhost:8000 -t build;
########
# Test #
########
## Tests - Test
test:
symfony php vendor/bin/simple-phpunit