2018-09-28 17:19:12 +00:00
|
|
|
# This file is licensed under the Affero General Public License version 3 or
|
|
|
|
# later. See the COPYING file.
|
|
|
|
|
|
|
|
app_name=$(notdir $(CURDIR))
|
|
|
|
project_directory=$(CURDIR)/../$(app_name)
|
|
|
|
build_tools_directory=$(CURDIR)/build/tools
|
|
|
|
source_build_directory=$(CURDIR)/build/artifacts/source
|
|
|
|
source_package_name=$(source_build_directory)/$(app_name)
|
|
|
|
appstore_build_directory=$(CURDIR)/build/artifacts/appstore
|
|
|
|
appstore_package_name=$(appstore_build_directory)/$(app_name)
|
|
|
|
|
2020-07-10 15:58:48 +00:00
|
|
|
all: dev-setup lint build-js-production install-composer-deps-dev test-php
|
2015-10-26 10:29:01 +00:00
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
# Dev env management
|
2020-07-10 15:58:48 +00:00
|
|
|
dev-setup: clean clean-dev install-npm-deps-dev
|
2015-10-26 10:29:01 +00:00
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
npm-update:
|
|
|
|
npm update
|
2016-03-26 21:26:01 +00:00
|
|
|
|
2019-09-14 22:28:32 +00:00
|
|
|
composer.phar:
|
|
|
|
curl -sS https://getcomposer.org/installer | php
|
|
|
|
|
|
|
|
install-deps: install-composer-deps-dev install-npm-deps-dev
|
|
|
|
|
2020-07-10 15:58:48 +00:00
|
|
|
install-npm-deps-dev:
|
|
|
|
npm ci
|
|
|
|
|
2019-09-14 22:28:32 +00:00
|
|
|
install-composer-deps: composer.phar
|
|
|
|
php composer.phar install --no-dev -o
|
|
|
|
|
|
|
|
install-composer-deps-dev: composer.phar
|
|
|
|
php composer.phar install -o
|
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
# Building
|
|
|
|
build-js:
|
|
|
|
npm run dev
|
2016-03-26 21:26:01 +00:00
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
build-js-production:
|
|
|
|
npm run build
|
2016-03-26 21:26:01 +00:00
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
watch-js:
|
|
|
|
npm run watch
|
2017-10-03 20:15:26 +00:00
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
# Testing
|
|
|
|
test:
|
|
|
|
npm run test
|
2016-03-26 21:26:01 +00:00
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
test-watch:
|
|
|
|
npm run test:watch
|
2015-10-26 10:29:01 +00:00
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
test-coverage:
|
|
|
|
npm run test:coverage
|
2015-10-26 10:29:01 +00:00
|
|
|
|
2019-01-23 09:31:27 +00:00
|
|
|
test-php:
|
2019-09-14 22:28:32 +00:00
|
|
|
php composer.phar run test:unit
|
|
|
|
php composer.phar run test:integration
|
2019-01-23 09:31:27 +00:00
|
|
|
|
|
|
|
test-php-coverage:
|
2019-09-14 22:28:32 +00:00
|
|
|
php composer.phar run test:unit -- --coverage-clover=coverage-unit.xml
|
|
|
|
php composer.phar run test:integration -- --coverage-clover=coverage-integration.xml
|
2019-01-23 09:31:27 +00:00
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
# Linting
|
|
|
|
lint:
|
|
|
|
npm run lint
|
2016-03-26 21:26:01 +00:00
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
lint-fix:
|
|
|
|
npm run lint:fix
|
2016-03-26 21:26:01 +00:00
|
|
|
|
2018-09-11 12:21:43 +00:00
|
|
|
# Style linting
|
|
|
|
stylelint:
|
|
|
|
npm run stylelint
|
|
|
|
|
|
|
|
stylelint-fix:
|
|
|
|
npm run stylelint:fix
|
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
# Cleaning
|
|
|
|
clean:
|
2020-04-02 09:07:54 +00:00
|
|
|
rm -rf js
|
2016-03-26 21:26:01 +00:00
|
|
|
|
2018-07-10 16:40:59 +00:00
|
|
|
clean-dev:
|
|
|
|
rm -rf node_modules
|
2020-07-10 15:58:48 +00:00
|
|
|
rm -rf vendor
|
2016-03-29 13:18:23 +00:00
|
|
|
|
2018-09-28 17:19:12 +00:00
|
|
|
# Builds the source package for the app store, ignores php and js tests
|
|
|
|
appstore:
|
|
|
|
rm -rf $(appstore_build_directory)
|
|
|
|
mkdir -p $(appstore_build_directory)
|
|
|
|
tar cvzf $(appstore_package_name).tar.gz \
|
|
|
|
--exclude-vcs \
|
|
|
|
$(project_directory)/appinfo \
|
|
|
|
$(project_directory)/css \
|
|
|
|
$(project_directory)/img \
|
|
|
|
$(project_directory)/l10n \
|
|
|
|
$(project_directory)/lib \
|
|
|
|
$(project_directory)/templates \
|
|
|
|
$(project_directory)/js \
|
2019-03-14 20:05:49 +00:00
|
|
|
$(project_directory)/COPYING \
|
|
|
|
$(project_directory)/CHANGELOG.md
|