-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
90 lines (71 loc) · 1.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
SHELL=bash
SOURCE_DIR = $(shell pwd)
BIN_DIR = ${SOURCE_DIR}/bin
COMPOSER_BIN ?= composer
CI_DIR = ${BIN_DIR}/tool-php-ci
define printSection
@printf "\033[36m\n==================================================\n\033[0m"
@printf "\033[36m $1 \033[0m"
@printf "\033[36m\n==================================================\n\033[0m"
endef
.PHONY: all
all: install quality test
.PHONY: install
install: clean-vendor composer-install
.PHONY: quality
quality: rector cs phpstan
.PHONY: quality-fix
quality-fix: rector-fix cs-fix
.PHONY: test
test: phpunit
# Coding Style
.PHONY: cs
cs:
$(call printSection,Check coding style)
${BIN_DIR}/php-cs-fixer fix --dry-run --stop-on-violation --diff
.PHONY: cs-fix
cs-fix:
${BIN_DIR}/php-cs-fixer fix
#COMPOSER
.PHONY: clean-vendor
clean-vendor:
$(call printSection,CLEAN-VENDOR)
rm -rf ${SOURCE_DIR}/composer.lock
rm -rf ${SOURCE_DIR}/vendor
rm -rf ${SOURCE_DIR}/bin/*
.PHONY: composer-install
composer-install:
$(call printSection,COMPOSER INSTALL)
${COMPOSER_BIN} update --no-interaction --ansi --no-progress
.PHONY: composer-install-sf4
composer-install-sf4:
composer config extra.symfony.require "4.4.*"
${MAKE} composer-install
composer config --unset extra
.PHONY: composer-install-sf5
composer-install-sf5:
composer config extra.symfony.require "5.4.*"
${MAKE} composer-install
composer config --unset extra
.PHONY: composer-install-sf6
composer-install-sf6:
composer config extra.symfony.require "6.*"
${MAKE} composer-install
composer config --unset extra
# TEST
.PHONY: phpunit
phpunit:
$(call printSection,Test PHPUnit)
${BIN_DIR}/phpunit
.PHONY: phpstan
phpstan:
$(call printSection,Test PHPStan)
${BIN_DIR}/phpstan.phar analyse
.PHONY: rector
rector:
$(call printSection,Test Rector)
${BIN_DIR}/rector process --dry-run
.PHONY: rector-fix
rector-fix:
$(call printSection,Execute Rector)
${BIN_DIR}/rector process