summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile78
1 files changed, 45 insertions, 33 deletions
diff --git a/Makefile b/Makefile
index 447cff328..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,9 +74,9 @@ 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
@@ -84,16 +84,16 @@ endif
.PHONY: npm
npm:
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
@@ -124,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/ \
@@ -137,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" \
@@ -152,45 +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"
- 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/admin/Admin.js $(appstore_sign_dir)/$(app_name)/js/admin
+ mkdir -p "$(appstore_sign_dir)/$(app_name)/js"
+ cp js/* "$(appstore_sign_dir)/$(app_name)/js/"
# export the key and cert to a file
- 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"
+ @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)"; \
+ 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:
@@ -213,4 +217,12 @@ test: php-test-dependencies
.PHONY: feed-test
feed-test:
- ./bin/tools/check_feeds.sh \ No newline at end of file
+ ./bin/tools/check_feeds.sh
+
+.PHONY: feed-server
+feed-server:
+ 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)/../../."