-
Notifications
You must be signed in to change notification settings - Fork 84
/
Makefile
52 lines (44 loc) · 1.94 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
# This Makefile downloads and installs hook dependencies
#
# It depends on GNU Make.
# Tested on Linux (Ubuntu, Gentoo) and Mac OSX.
#
# The default target is "make install", but it also provides "make test" and "make docs".
SHELL := /bin/bash
APIGEN_PATH = ~/Downloads/apigen
CURPATH := $(shell pwd -P)
export PATH=$(HOME)/bin:$(shell echo $$PATH)
default: install
install:
# check dependencies
ifneq ($(shell which php > /dev/null 2>&1; echo $$?),0)
$(error "Missing php-cli.")
endif
# install composer if we don't have it already
ifneq ($(shell which composer > /dev/null 2>&1 || test -x $(HOME)/bin/composer; echo $$?),0)
mkdir -p $(HOME)/bin
curl -sS https://getcomposer.org/installer | php -d detect_unicode=Off -- --install-dir=$(HOME)/bin --filename=composer
chmod +x $(HOME)/bin/composer
endif
composer install --no-dev --prefer-dist
@echo "Finished"
test:
./vendor/bin/phpunit --configuration ./tests/phpunit.xml --testsuite unit
# DB_DRIVER=mysql ./vendor/bin/phpunit --configuration ./tests/phpunit.xml
# DB_DRIVER=postgres ./vendor/bin/phpunit --configuration ./tests/phpunit.xml
# DB_DRIVER=sqlite ./vendor/bin/phpunit --configuration ./tests/phpunit.xml
# DB_DRIVER=mongodb ./vendor/bin/phpunit --configuration ./tests/phpunit.xml
# DB_DRIVER=sqlsrv ./vendor/bin/phpunit --configuration ./tests/phpunit.xml
docs:
mkdir -p ../hook-docs
rm -rf ../hook-docs/*
php -d memory_limit=512M ${APIGEN_PATH}/apigen.php --destination ../hook-docs --debug \
--exclude */tests/* \
--exclude */Tests/* \
--source ./src/ \
--source ./vendor/illuminate \
--source ./vendor/slim/slim/Slim
open documentation/index.html
git init ../hook-docs
cd ../hook-docs && git remote add origin git@github.com:doubleleft/hook.git && git checkout -b gh-pages && git add . && git commit -m "update public documentation" && git push origin gh-pages -f
# --source ./vendor/guzzlehttp/guzzle/src \