-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (37 loc) · 1.96 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
export PWD := $(shell pwd)
export PHP :=/usr/bin/env php
#export PHP :=/opt/plesk/php/8.1/bin/php
help: ## show this help
# @echo "make create-phar [MODE=(prod|dev)]"
@cat src/locales/en/make.txt
# @-fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/:.*##/:/'
create: create-phar ## alias for create-phar
create-phar: ## create productive version of PHAR file locally
@test -f hymn.phar && rm hymn.phar || true
@${PHP} build/create.php --mode=${MODE} --php="${PHP}" && chmod +x hymn.phar || true
create-phar-dev: ## create development version of PHAR file locally
@test -f hymn.phar && rm hymn.phar || true
@$(MAKE) -s create-phar MODE=dev
install: install-link ## alias for install-link
install-copy: uninstall ## installs PHAR file in system (/usr/local/bin) by copy
@echo "Installing hymn to /usr/local/bin"
@sudo cp $(shell pwd)/hymn.phar /usr/local/bin/hymn
install-link: uninstall ## installs PHAR file in system (/usr/local/bin) by link
@echo "Installing hymn symlink to /usr/local/bin"
@sudo ln -sf $(shell pwd)/hymn.phar /usr/local/bin/hymn
uninstall:
@test -h /usr/local/bin/hymn && echo "Removing hymn symlink in /usr/local/bin" && sudo rm /usr/local/bin/hymn || true
@test -f /usr/local/bin/hymn && echo "Removing hymn in /usr/local/bin" && sudo rm -f /usr/local/bin/hymn || true
test-units:
@./vendor/bin/phpunit
test-syntax:
@hymn test-syntax && echo "Result: OK" || echo "Result: FAILED"
test-syntax-verbose:
@hymn test-syntax -vv && echo "Result: OK" || echo "Result: FAILED"
test-phpstan:
@vendor/bin/phpstan analyse --configuration phpstan.neon --xdebug || true
test-phpstan-save-baseline:
@vendor/bin/phpstan analyse --configuration phpstan.neon --generate-baseline phpstan-baseline.neon || true
update:
@echo "Currently installed: \c" && hymn version
@git fetch && git checkout hymn.phar && touch stashing && git stash --include-untracked -q && git rebase && git stash pop -q && rm stashing && $(MAKE) -s create-phar