forked from etsy/morgue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (28 loc) · 1.02 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
#
# make it so
#
PHPUNIT:=phpunit --include-path=phplib --log-junit results.xml
VERSION := $(shell git rev-parse --short HEAD)
# targets
all: deploy_version
deploy_version:
@echo "Setting MORGUE_VERSION to $(VERSION) in phplib/deploy_version.php..."
@sed 's/{{ VERSION }}/$(VERSION)/' <phplib/deploy_version.php.in >phplib/deploy_version.php
unittests:
${PHPUNIT} tests/unit/
# You can use this to set up basic structure of a new feature like so:
# make feature NAME=report
feature:
@if [ -d features/$(NAME) ]; then \
echo "Feature \"$(NAME)\" already exists";\
exit 1;\
fi
@echo "making new feature " $(NAME)
@mkdir -p features/$(NAME)/views
@touch features/$(NAME)/lib.php
@cp skeleton/feature_routes.php features/$(NAME)/routes.php
@perl -p -i -e 's/%%FEATURE%%/$(NAME)/g' features/$(NAME)/routes.php
@touch features/$(NAME)/views/$(NAME).php
@echo "THIS IS THE $(NAME) VIEW" > features/$(NAME)/views/$(NAME).php
@echo "Feature directory for $(NAME) created."
@echo "Remember to add an entry to your feature config."