1
1
DOCKER_COMPOSE? =docker-compose
2
2
EXEC? =$(DOCKER_COMPOSE ) exec app
3
- CONSOLE =bin/console
3
+ CONSOLE =php bin/console
4
4
PHPCSFIXER? =$(EXEC ) php -d memory_limit=1024m vendor/bin/php-cs-fixer
5
5
6
6
.DEFAULT_GOAL := help
7
7
.PHONY : help start stop restart install uninstall reset clear-cache shell clear clean
8
8
.PHONY : db-diff db-migrate db-rollback db-fixtures db-validate
9
9
.PHONY : watch assets assets-build
10
10
.PHONY : tests lint lint-symfony lint-yaml lint-twig lint-xliff php-cs php-cs-fix security-check test-schema test-all
11
- .PHONY : build up perm
12
- .PHONY : docker-compose.override.yml
11
+ .PHONY : deps
12
+ .PHONY : build up perm docker-compose.override.yml
13
13
14
14
help :
15
15
@grep -E ' (^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST ) | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e ' s/\[32m##/[33m/'
16
16
17
+
17
18
# #
18
19
# # Project setup
19
20
# #---------------------------------------------------------------------------
27
28
restart : # # Restart docker containers
28
29
$(DOCKER_COMPOSE ) restart
29
30
30
- install : docker-compose.override.yml build up vendor perm # # Create and start docker containers
31
+ install : docker-compose.override.yml build up deps perm # # Create and start docker containers
31
32
32
33
uninstall : stop # # Remove docker containers
33
34
$(DOCKER_COMPOSE ) rm -vf
@@ -48,7 +49,7 @@ clear: perm
48
49
rm -f var/.php_cs.cache
49
50
50
51
clean : clear # # Clear and remove dependencies
51
- rm -rf vendor
52
+ rm -rf vendor node_modules
52
53
53
54
54
55
# #
@@ -81,17 +82,18 @@ watch: node_modules
81
82
assets : node_modules # # Build the development version of the assets
82
83
$(EXEC ) yarn dev
83
84
84
- assets-build : node_modules # # Build the production version of the assets
85
+ assets-build : node_modules # # Build the production version of the assets
85
86
$(EXEC ) yarn build
86
87
88
+
87
89
# #
88
90
# # Tests
89
91
# #---------------------------------------------------------------------------
90
92
91
93
tests : # # Run all the PHP tests
92
94
$(EXEC ) bin/phpunit
93
95
94
- lint : lint-symfony php-cs # # Run lint on Twig, YAML, PHP and Javascript files
96
+ lint : lint-symfony php-cs # # Run lint on Twig, YAML, XLIFF, and PHP files
95
97
96
98
lint-symfony : lint-yaml lint-twig lint-xliff # # Lint Symfony (Twig and YAML) files
97
99
@@ -101,13 +103,13 @@ lint-yaml:
101
103
lint-twig : # # Lint Twig files
102
104
$(EXEC ) $(CONSOLE ) lint:twig templates
103
105
104
- lint-xliff : # # Lint Translation files
106
+ lint-xliff : # # Lint Translation files
105
107
$(EXEC ) $(CONSOLE ) lint:xliff translations
106
108
107
109
php-cs : vendor # # Lint PHP code
108
110
$(PHPCSFIXER ) fix --diff --dry-run --no-interaction -v
109
111
110
- php-cs-fix : vendor # # Lint and fix PHP code to follow the convention
112
+ php-cs-fix : vendor # # Fix PHP code to follow the convention
111
113
$(PHPCSFIXER ) fix
112
114
113
115
security-check : vendor # # Check for vulnerable dependencies
@@ -116,7 +118,15 @@ security-check: vendor
116
118
test-schema : vendor # # Test the doctrine Schema
117
119
$(EXEC ) $(CONSOLE ) doctrine:schema:validate --skip-sync -vvv --no-interaction
118
120
119
- test-all : lint test-schema security-check tests # # Lint all, check vulnerable dependencies, run PHP tests
121
+ test-all : lint test-schema security-check tests # # Lint all, run schema and security check, then unit and functionnal tests
122
+
123
+
124
+ # #
125
+ # # Dependencies
126
+ # #---------------------------------------------------------------------------
127
+
128
+ deps : vendor assets # # Install the project dependencies
129
+
120
130
121
131
# #
122
132
@@ -147,7 +157,7 @@ vendor: composer.lock
147
157
$(EXEC ) composer install -n
148
158
149
159
composer.lock : composer.json
150
- @echo compose .lock is not up to date.
160
+ @echo composer .lock is not up to date.
151
161
152
162
node_modules : yarn.lock
153
163
$(EXEC ) yarn install
0 commit comments