-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
103 lines (77 loc) · 4.3 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
# Makefile Project
.PHONY: help
.DEFAULT_GOAL := help
# -------------------------------------------------------
PHP_MIN_VERSION := 8.1
PHPUNIT_MIN_COVERAGE := 90
# -------------------------------------------------------
#------------------------------------------------------------------------------------------------
help:
@echo ""
@echo "PROJECT COMMANDS"
@echo "--------------------------------------------------------------------------------------------"
@printf "\033[33mInstallation:%-30s\033[0m %s\n"
@grep -E '^[a-zA-Z_-]+:.*?##1 .*$$' $(firstword $(MAKEFILE_LIST)) | awk 'BEGIN {FS = ":.*?##1 "}; {printf "\033[33m - %-30s\033[0m %s\n", $$1, $$2}'
@echo "--------------------------------------------------------------------------------------------"
@printf "\033[36mDevelopment:%-30s\033[0m %s\n"
@grep -E '^[a-zA-Z_-]+:.*?##2 .*$$' $(firstword $(MAKEFILE_LIST)) | awk 'BEGIN {FS = ":.*?##2 "}; {printf "\033[36m - %-30s\033[0m %s\n", $$1, $$2}'
@echo "--------------------------------------------------------------------------------------------"
@printf "\033[32mTests:%-30s\033[0m %s\n"
@grep -E '^[a-zA-Z_-]+:.*?##3 .*$$' $(firstword $(MAKEFILE_LIST)) | awk 'BEGIN {FS = ":.*?##3 "}; {printf "\033[32m - %-30s\033[0m %s\n", $$1, $$2}'
@echo "--------------------------------------------------------------------------------------------"
@printf "\033[35mDevOps:%-30s\033[0m %s\n"
@grep -E '^[a-zA-Z_-]+:.*?##4 .*$$' $(firstword $(MAKEFILE_LIST)) | awk 'BEGIN {FS = ":.*?##4 "}; {printf "\033[35m - %-30s\033[0m %s\n", $$1, $$2}'
#------------------------------------------------------------------------------------------------
install: ##1 Installs all prod dependencies
composer install --no-dev
dev: ##1 Installs all dev dependencies
composer install --ignore-platform-req=ext-intl
clean: ##1 Clears all dependencies
rm -rf vendor/*
rm -rf .reports
build: ##1 Builds PHPUnuhi and creates phpunuhi.phar
@make install -B
@echo "===================================================================="
@echo "verifying if phar files can be created....phar.readonly has to be OFF"
@php -i | grep phar.readonly
@php -i | grep "Loaded Configuration"
@cd scripts && php build.php
#------------------------------------------------------------------------------------------------
pr: ##2 Runs and prepares everything for a pull request
php vendor/bin/rector process
PHP_CS_FIXER_IGNORE_ENV=1 php ./vendor/bin/php-cs-fixer fix --config=./.php_cs.php
@make phpcheck -B
@make phpmin -B
@make stan -B
@make phpmnd -B
@make phpunit -B
@make svrunit -B
@make infection -B
phpunit-debug: ##2 Debug the unit test with group "debug"
XDEBUG_MODE=coverage php ./vendor/bin/phpunit -v --group debug
#------------------------------------------------------------------------------------------------
phpcheck: ##3 Starts the PHP syntax checks
@find ./src -name '*.php' | xargs -n 1 -P4 php -l
phpmin: ##3 Starts the PHP compatibility checks
@php vendor/bin/phpcs -p --standard=PHPCompatibility --extensions=php --runtime-set testVersion $(PHP_MIN_VERSION) ./src
csfix: ##3 Starts the PHP CS Fixer
PHP_CS_FIXER_IGNORE_ENV=1 php ./vendor/bin/php-cs-fixer fix --config=./.php_cs.php
stan: ##3 Starts the PHPStan Analyser
php ./vendor/bin/phpstan analyse --memory-limit 1G -c ./.phpstan.neon
phpmnd: ##3 Runs the checks for magic numbers
php ./vendor/bin/phpmnd ./src
rector: ##3 Runs the Rector checks in dry run
php vendor/bin/rector process --dry-run
phpunit: ##3 Runs all tests
XDEBUG_MODE=coverage php ./vendor/bin/phpunit -v --coverage-html ./.reports/phpunit/coverage --coverage-clover ./.reports/phpunit/clover/index.xml
php vendor/bin/coverage-check ./.reports/phpunit/clover/index.xml $(PHPUNIT_MIN_COVERAGE)
infection: ##3 Starts all Infection/Mutation tests
rm -rf ./.reports/infection
@XDEBUG_MODE=coverage php vendor/bin/infection --configuration=./infection.json --log-verbosity=all --debug
svrunit: ##3 Runs all SVRUnit tests
@echo "## DEAKTIV Symfony Console passt nicht überein mit svrunit ##" && \
echo php vendor/bin/svrunit test --configuration=./svrunit.xml --debug --report-junit --report-html
#------------------------------------------------------------------------------------------------
release: ##4 Create a ZIP file in the build folder
cd build && zip phpunuhi.zip phpunuhi.phar
cd build && rm -rf phpunuhi.phar