summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile76
1 files changed, 34 insertions, 42 deletions
diff --git a/Makefile b/Makefile
index a67191f79..c4144e521 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ cert_dir=$(HOME)/.nextcloud/certificates
npm:=$(shell which npm 2> /dev/null)
composer:=$(shell which composer 2> /dev/null)
ifeq (,$(composer))
- composer:=php $(build_tools_directory)/composer.phar
+ composer:=php "$(build_tools_directory)/composer.phar"
endif
#Support xDebug 3.0+
@@ -74,28 +74,26 @@ build:
composer:
ifeq (, $(shell which composer 2> /dev/null))
@echo "No composer command available, downloading a copy from the web"
- mkdir -p $(build_tools_directory)
+ mkdir -p "$(build_tools_directory)"
curl -sS https://getcomposer.org/installer | php
- mv composer.phar $(build_tools_directory)
+ mv composer.phar "$(build_tools_directory)"
endif
$(composer) install --prefer-dist --no-dev
# Installs npm dependencies
.PHONY: npm
npm:
- $(npm) ci
- $(npm) run build
ifneq (, $(npm))
- cd js && $(npm) run build
+ $(npm) run build
else
@echo "npm command not available, please install nodejs first"
@exit 1
endif
-# Removes the appstore build
+# Removes the appstore build and compiled js files
.PHONY: clean
clean:
- rm -rf ./build
+ rm -rf ./build ./js/*
# Reports PHP codestyle violations
.PHONY: phpcs
@@ -126,9 +124,9 @@ dist:
# Builds the source package
.PHONY: source
source:
- rm -rf $(source_build_directory) $(source_artifact_directory)
- mkdir -p $(source_build_directory) $(source_artifact_directory)
- rsync -rv . $(source_build_directory) \
+ rm -rf "$(source_build_directory)" "$(source_artifact_directory)"
+ mkdir -p "$(source_build_directory)" "$(source_artifact_directory)"
+ rsync -rv . "$(source_build_directory)" \
--exclude=/.git/ \
--exclude=/.idea/ \
--exclude=/build/ \
@@ -139,13 +137,13 @@ ifdef CAN_SIGN
else
@echo $(sign_skip_msg)
endif
- tar -cvzf $(source_package_name).tar.gz -C $(source_build_directory)/../ $(app_name)
+ tar -cvzf "$(source_package_name).tar.gz" -C "$(source_build_directory)/../" $(app_name)
# Builds the source package for the app store, ignores php and js tests
.PHONY: appstore
appstore:
- rm -rf $(appstore_build_directory) $(appstore_sign_dir) $(appstore_artifact_directory)
- install -d $(appstore_sign_dir)/$(app_name)
+ rm -rf "$(appstore_build_directory)" "$(appstore_sign_dir)" "$(appstore_artifact_directory)"
+ install -d "$(appstore_sign_dir)/$(app_name)"
cp -r \
"appinfo" \
"css" \
@@ -154,50 +152,49 @@ appstore:
"lib" \
"templates" \
"vendor" \
- $(appstore_sign_dir)/$(app_name)
+ "$(appstore_sign_dir)/$(app_name)"
# remove composer binaries, those aren't needed
- rm -rf $(appstore_sign_dir)/$(app_name)/vendor/bin
+ rm -rf "$(appstore_sign_dir)/$(app_name)/vendor/bin"
# the App Store doesn't like .git
- rm -rf $(appstore_sign_dir)/$(app_name)/vendor/arthurhoaro/favicon/.git
+ rm -rf "$(appstore_sign_dir)/$(app_name)/vendor/arthurhoaro/favicon/.git"
# remove large test files
- rm -rf $(appstore_sign_dir)/$(app_name)/vendor/fivefilters/readability.php/test
+ rm -rf "$(appstore_sign_dir)/$(app_name)/vendor/fivefilters/readability.php/test"
- install "COPYING" $(appstore_sign_dir)/$(app_name)
- install "AUTHORS.md" $(appstore_sign_dir)/$(app_name)
- install "CHANGELOG.md" $(appstore_sign_dir)/$(app_name)
+ install "COPYING" "$(appstore_sign_dir)/$(app_name)"
+ install "AUTHORS.md" "$(appstore_sign_dir)/$(app_name)"
+ install "CHANGELOG.md" "$(appstore_sign_dir)/$(app_name)"
#remove stray .htaccess files since they are filtered by nextcloud
- find $(appstore_sign_dir) -name .htaccess -exec rm {} \;
+ find "$(appstore_sign_dir)" -name .htaccess -exec rm {} \;
# on macOS there is no option "--parents" for the "cp" command
- mkdir -p $(appstore_sign_dir)/$(app_name)/js/build $(appstore_sign_dir)/$(app_name)/js/admin
- cp js/build/app.min.js $(appstore_sign_dir)/$(app_name)/js/build
- cp js/build/news-admin-settings.js* $(appstore_sign_dir)/$(app_name)/js/build
+ mkdir -p "$(appstore_sign_dir)/$(app_name)/js"
+ cp js/* "$(appstore_sign_dir)/$(app_name)/js/"
# export the key and cert to a file
- @if [ ! -f $(cert_dir)/$(app_name).key ] || [ ! -f $(cert_dir)/$(app_name).crt ]; then \
+ @if [ ! -f "$(cert_dir)/$(app_name).key" ] || [ ! -f "$(cert_dir)/$(app_name).crt" ]; then \
echo "Key and cert do not exist"; \
- mkdir -p $(cert_dir); \
+ mkdir -p "$(cert_dir)"; \
php ./bin/tools/file_from_env.php "app_private_key" "$(cert_dir)/$(app_name).key"; \
php ./bin/tools/file_from_env.php "app_public_crt" "$(cert_dir)/$(app_name).crt"; \
fi
- @if [ -f $(cert_dir)/$(app_name).key ]; then \
+ @if [ -f "$(cert_dir)/$(app_name).key" ]; then \
echo "Signing app files…"; \
php ../../occ integrity:sign-app \
- --privateKey=$(cert_dir)/$(app_name).key\
- --certificate=$(cert_dir)/$(app_name).crt\
- --path=$(appstore_sign_dir)/$(app_name); \
+ --privateKey="$(cert_dir)/$(app_name).key"\
+ --certificate="$(cert_dir)/$(app_name).crt"\
+ --path="$(appstore_sign_dir)/$(app_name)"; \
echo "Signing app files ... done"; \
fi
- mkdir -p $(appstore_artifact_directory)
- tar -czf $(appstore_package_name).tar.gz -C $(appstore_sign_dir) $(app_name)
+ mkdir -p "$(appstore_artifact_directory)"
+ tar -czf "$(appstore_package_name).tar.gz" -C "$(appstore_sign_dir)" $(app_name)
.PHONY: js-test
js-test:
- cd js && $(npm) run test
+ $(npm) run test
.PHONY: php-test-dependencies
php-test-dependencies:
@@ -205,12 +202,7 @@ php-test-dependencies:
.PHONY: unit-test
unit-test:
- @if [ "$(CODECOVERAGE)" = "true" ]; then \
- ./vendor/phpunit/phpunit/phpunit -c phpunit.xml --coverage-clover build/php-unit.clover; \
- else \
- ./vendor/phpunit/phpunit/phpunit -c phpunit.xml --no-coverage; \
- fi
-
+ ./vendor/phpunit/phpunit/phpunit -c phpunit.xml --coverage-clover build/php-unit.clover
# Command for running JS and PHP tests. Works for package.json files in the js/
# and root directory. If phpunit is not installed systemwide, a copy is fetched
@@ -229,8 +221,8 @@ feed-test:
.PHONY: feed-server
feed-server:
- php -S 127.0.0.1:8090 -t $(CURDIR)/tests/test_helper/feeds
+ php -S 127.0.0.1:8090 -t "$(CURDIR)/tests/test_helper/feeds"
.PHONY: nextcloud-server
nextcloud-server:
- php -S 127.0.0.1:8080 -t $(CURDIR)/../../. \ No newline at end of file
+ php -S 127.0.0.1:8080 -t "$(CURDIR)/../../."