2021-08-21 10:58:00 +00:00
|
|
|
# This file is licensed under the Affero General Public License version 3 or
|
|
|
|
# later. See the COPYING file.
|
|
|
|
app_name=$(notdir $(CURDIR))
|
|
|
|
build_tools_directory=$(CURDIR)/build/tools
|
|
|
|
composer=$(shell which composer 2> /dev/null)
|
|
|
|
|
2021-08-21 14:17:14 +00:00
|
|
|
all: dev-setup lint build-js-production test
|
|
|
|
|
|
|
|
# Dev env management
|
|
|
|
dev-setup: clean clean-dev composer npm-init
|
2021-08-21 10:58:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Installs and updates the composer dependencies. If composer is not installed
|
|
|
|
# a copy is fetched from the web
|
|
|
|
composer:
|
|
|
|
ifeq (, $(composer))
|
|
|
|
@echo "No composer command available, downloading a copy from the web"
|
|
|
|
mkdir -p $(build_tools_directory)
|
|
|
|
curl -sS https://getcomposer.org/installer | php
|
|
|
|
mv composer.phar $(build_tools_directory)
|
|
|
|
php $(build_tools_directory)/composer.phar install --prefer-dist
|
2021-08-21 14:17:14 +00:00
|
|
|
php $(build_tools_directory)/composer.phar update --prefer-dist
|
2021-08-21 10:58:00 +00:00
|
|
|
else
|
|
|
|
composer install --prefer-dist
|
2021-08-21 14:17:14 +00:00
|
|
|
composer update --prefer-dist
|
2021-08-21 10:58:00 +00:00
|
|
|
endif
|
|
|
|
|
2021-08-21 14:17:14 +00:00
|
|
|
npm-init:
|
|
|
|
npm ci
|
|
|
|
|
|
|
|
npm-update:
|
|
|
|
npm update
|
|
|
|
|
|
|
|
# Building
|
|
|
|
build-js:
|
|
|
|
npm run dev
|
|
|
|
|
|
|
|
build-js-production:
|
2021-08-21 10:58:00 +00:00
|
|
|
npm run build
|
|
|
|
|
2021-08-21 14:17:14 +00:00
|
|
|
watch-js:
|
|
|
|
npm run watch
|
|
|
|
|
|
|
|
serve-js:
|
|
|
|
npm run serve
|
|
|
|
|
|
|
|
# Linting
|
|
|
|
lint:
|
|
|
|
npm run lint
|
|
|
|
|
|
|
|
lint-fix:
|
|
|
|
npm run lint:fix
|
|
|
|
|
|
|
|
# Style linting
|
|
|
|
stylelint:
|
|
|
|
npm run stylelint
|
|
|
|
|
|
|
|
stylelint-fix:
|
|
|
|
npm run stylelint:fix
|
|
|
|
|
|
|
|
# Cleaning
|
2021-08-21 10:58:00 +00:00
|
|
|
clean:
|
2021-08-21 14:17:14 +00:00
|
|
|
rm -rf js/*
|
2021-08-21 10:58:00 +00:00
|
|
|
|
2021-08-21 14:17:14 +00:00
|
|
|
clean-dev:
|
2021-08-21 10:58:00 +00:00
|
|
|
rm -rf node_modules
|
2021-08-21 14:17:14 +00:00
|
|
|
|
|
|
|
# Tests
|
|
|
|
test:
|
|
|
|
./vendor/phpunit/phpunit/phpunit -c phpunit.xml
|
|
|
|
./vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml
|