-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathMakefile
49 lines (38 loc) · 1.28 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
COMPOSER = php composer.phar
VENDOR_DIR = vendor
BIN_DIR = bin
PHPUNIT = $(BIN_DIR)/phpunit
PHPCS = $(BIN_DIR)/phpcs
PHPCS_STANDARD = PSR2
.check-composer:
@echo "Checking if Composer is installed..."
@test -f composer.phar || curl -s http://getcomposer.org/installer | php;
.check-installation: .check-composer
@echo "Checking for vendor directory..."
@test -d $(VENDOR_DIR) || make install
@echo "Checking for bin directory..."
@test -d $(BIN_DIR) || make install
clean:
@echo "Removing Composer..."
rm -f composer.phar
rm -f composer.lock
rm -rf $(VENDOR_DIR)
rm -f bin/phpunit
rm -f bin/phpcs
test: .check-installation
$(PHPUNIT)
testdox: .check-installation
$(PHPUNIT) --testdox
coverage: .check-installation
$(PHPUNIT) --coverage-text
install: clean .check-composer
@echo "Executing a composer installation of development dependencies.."
$(COMPOSER) install --dev
update: .check-installation
@echo "Executing a composer update of development dependencies.."
$(COMPOSER) update --dev
code-sniffer: .check-installation
$(PHPCS) --standard=$(PHPCS_STANDARD) src/
code-sniffer-report: .check-installation
$(PHPCS) --report-summary --report-source --report-gitblame --standard=$(PHPCS_STANDARD) src
.PHONY: test clean testdox coverage install update code-sniffer code-sniffer-report