From f7520a8fe7191475668904f5f8c1816df25e2e5a Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 25 Mar 2016 19:45:29 +0100 Subject: add appstore package makefile --- Makefile | 54 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 13 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 37cd7a1db..6284f1540 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,11 @@ # "build": "node node_modules/gulp-cli/bin/gulp.js" # }, app_name=$(notdir $(CURDIR)) -build_directory=$(CURDIR)/build/artifacts/source -package_name=$(build_directory)/$(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) npm=$(shell which npm 2> /dev/null) all: build @@ -56,11 +59,11 @@ build: composer: ifeq (, $(shell which composer 2> /dev/null)) @echo "No composer command available, downloading a copy from the web" - mkdir -p build/tools + mkdir -p $(build_tools_directory) curl -sS https://getcomposer.org/installer | php - mv composer.phar build/tools/ - php build/tools/composer.phar install --prefer-dist - php build/tools/composer.phar update --prefer-dist + mv composer.phar $(build_tools_directory) + php $(build_tools_directory)/composer.phar install --prefer-dist + php $(build_tools_directory)/composer.phar update --prefer-dist else composer install --prefer-dist composer update --prefer-dist @@ -88,18 +91,43 @@ distclean: clean rm -rf js/vendor rm -rf js/node_modules -# Builds the package for the app store +# Builds the source package .PHONY: dist dist: make clean make build make test - mkdir -p $(build_directory) - tar cvzf $(package_name).tar.gz ../$(app_name) \ + mkdir -p $(source_build_directory) + tar cvzf $(source_package_name).tar.gz ../$(app_name) \ --exclude-vcs \ --exclude=../$(app_name)/build \ --exclude=../$(app_name)/js/node_modules \ +# Builds the source package for the app store, ignores php and js tests +.PHONY: appstore +appstore: + make clean + make build + make test + mkdir -p $(appstore_build_directory) + tar cvzf $(appstore_package_name).tar.gz ../$(app_name) \ + --exclude-vcs \ + --exclude=../$(app_name)/build \ + --exclude=../$(app_name)/tests \ + --exclude=../$(app_name)/Makefile \ + --exclude=../$(app_name)/\.* \ + --exclude=../$(app_name)/*\.log \ + --exclude=../$(app_name)/phpunit*xml \ + --exclude=../$(app_name)/composer\.* \ + --exclude=../$(app_name)/js/node_modules \ + --exclude=../$(app_name)/js/tests \ + --exclude=../$(app_name)/js/test \ + --exclude=../$(app_name)/js/*\.log + --exclude=../$(app_name)/js/\.* \ + --exclude=../$(app_name)/js/package.json \ + --exclude=../$(app_name)/js/bower.json \ + --exclude=../$(app_name)/js/karma\.* \ + --exclude=../$(app_name)/js/protractor\.* \ # 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 @@ -113,10 +141,10 @@ else endif ifeq (, $(shell which phpunit 2> /dev/null)) @echo "No phpunit command available, downloading a copy from the web" - mkdir -p build/tools - curl -sSL https://phar.phpunit.de/phpunit.phar -o build/tools/phpunit.phar - php build/tools/phpunit.phar -c phpunit.xml - php build/tools/phpunit.phar -c phpunit.integration.xml + mkdir -p $(build_tools_directory) + curl -sSL https://phar.phpunit.de/phpunit.phar -o $(build_tools_directory)/phpunit.phar + php $(build_tools_directory)/phpunit.phar -c phpunit.xml + php $(build_tools_directory)/phpunit.phar -c phpunit.integration.xml else phpunit -c phpunit.xml phpunit -c phpunit.integration.xml -- cgit v1.2.3