-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
56 lines (43 loc) · 1.64 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
# vim: ts=4:sw=4:noexpandtab!:
BASEDIR := $(shell pwd)
COMPOSER := $(shell which composer)
help:
@echo "---------------------------------------------"
@echo "List of available targets:"
@echo " composer-install - Installs composer dependencies."
@echo " proto-generate - Generate PHP classes from proto files."
@echo " phpcs - Runs PHP Code Sniffer."
@echo " phpunit - Runs tests."
@echo " phpunit-coverage-clover - Runs tests to genereate coverage clover."
@echo " phpunit-coverage-html - Runs tests to genereate coverage html."
@echo " help - Shows this dialog."
@exit 0
all: install phpunit
install: composer-install proto-generate
test: phpcs phpunit
composer-install:
ifdef COMPOSER
php $(COMPOSER) install --prefer-source --no-interaction;
else
@echo "Composer not found !!"
@echo
@echo "curl -sS https://getcomposer.org/installer | php"
@echo "mv composer.phar /usr/local/bin/composer"
endif
proto-clean:
rm -rf $(BASEDIR)/tests/Protos/*;
proto-generate: proto-clean
php $(BASEDIR)/vendor/bin/protobuf --include-descriptors \
--psr4 ProtobufTest\\Protos \
-o $(BASEDIR)/tests/Protos \
-i $(BASEDIR)/tests/Resources \
$(BASEDIR)/tests/Resources/*.proto
phpunit: proto-generate
php $(BASEDIR)/vendor/bin/phpunit -v;
phpunit-coverage-clover:
php $(BASEDIR)/vendor/bin/phpunit -v --coverage-clover ./build/logs/clover.xml;
phpunit-coverage-html:
php $(BASEDIR)/vendor/bin/phpunit -v --coverage-html ./build/coverage;
phpcs:
php $(BASEDIR)/vendor/bin/phpcs -p --extensions=php --standard=ruleset.xml src;
.PHONY: composer-install phpunit phpcs help