Nextcloud-App/Makefile

72 lines
1.4 KiB
Makefile
Raw Normal View History

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)
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
php $(build_tools_directory)/composer.phar update --prefer-dist
2021-08-21 10:58:00 +00:00
else
composer install --prefer-dist
composer update --prefer-dist
2021-08-21 10:58:00 +00:00
endif
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
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:
rm -rf js/*
2021-08-21 10:58:00 +00:00
clean-dev:
2021-08-21 10:58:00 +00:00
rm -rf node_modules
# Tests
test:
./vendor/phpunit/phpunit/phpunit -c phpunit.xml
./vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml