summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: cd608814ceb7e1a3c67b4edf65b0d68d80b21c19 (plain)
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
# Makefile for building the project
app_name=$(notdir $(CURDIR))
build_directory=$(CURDIR)/build/artifacts/source
package_name=$(build_directory)/$(app_name)

all: build

.PHONY: build
build:
	make composer
	make npm

.PHONY: composer
composer:
	curl -sS https://getcomposer.org/installer | php
	php composer.phar install --prefer-dist
	php composer.phar update --prefer-dist
	rm -f composer.phar

.PHONY: npm
npm:
	cd js && npm run build

.PHONY: clean
clean:
	rm -rf ./build

.PHONY: distclean
distclean: clean
	rm -rf vendor
	rm -rf js/vendor
	rm -rf js/node_modules

.PHONY: dist
dist:
	make clean
	make build
	make test
	mkdir -p $(build_directory)
	tar cvzf $(package_name).tar.gz ../$(app_name) \
	--exclude-vcs \
	--exclude=../$(app_name)/build \
	--exclude=../$(app_name)/js/node_modules \

.PHONY: test
test:
	cd js && npm run test
	phpunit -c phpunit.xml
	phpunit -c phpunit.integration.xml