-
Notifications
You must be signed in to change notification settings - Fork 43
/
Makefile
65 lines (52 loc) · 1.49 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
all:
@echo "Please choose a task."
.PHONY: all
lint: lint-composer lint-yaml lint-xml lint-php
.PHONY: lint
lint-composer:
composer validate
.PHONY: lint-composer
lint-yaml:
yaml-lint --ignore-non-yaml-files --quiet --exclude vendor .
.PHONY: lint-yaml
lint-xml:
find . \( -name '*.xml' -or -name '*.xliff' -or -name '*.xlf' \) \
-not -path './vendor/*' \
| while read xmlFile; \
do \
XMLLINT_INDENT=' ' xmllint --encode UTF-8 --format "$$xmlFile"|diff - "$$xmlFile"; \
if [ $$? -ne 0 ] ;then exit 1; fi; \
done
.PHONY: lint-xml
lint-php:
php-cs-fixer fix --ansi --verbose --diff --dry-run
.PHONY: lint-php
cs-fix: cs-fix-php cs-fix-xml
.PHONY: cs-fix
cs-fix-php:
php-cs-fixer fix --verbose
.PHONY: cs-fix-php
cs-fix-xml:
find . \( -name '*.xml' -or -name '*.xliff' -or -name '*.xlf' \) \
-not -path './vendor/*' \
| while read xmlFile; \
do \
XMLLINT_INDENT=' ' xmllint --encode UTF-8 --format "$$xmlFile" --output "$$xmlFile"; \
done
.PHONY: cs-fix-xml
build:
mkdir $@
test:
ifeq ($(shell php --modules|grep --quiet pcov;echo $$?), 0)
vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml --exclude-group vichuploaderbundle
else
vendor/bin/phpunit -c phpunit.xml.dist --exclude-group vichuploaderbundle
endif
.PHONY: test
test_with_vichuploaderbundle:
ifeq ($(shell php --modules|grep --quiet pcov;echo $$?), 0)
vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml
else
vendor/bin/phpunit -c phpunit.xml.dist
endif
.PHONY: test