-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8cec954
commit 99253e4
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# This file is licensed under the GNU General Public License v2.0 | ||
# # @author Sergio Bertolin <[email protected]> | ||
|
||
app_name=$(notdir $(CURDIR)) | ||
project_directory=$(CURDIR)/../$(app_name) | ||
build_tools_directory=$(CURDIR)/build/tools | ||
appstore_build_directory=$(CURDIR)/build/artifacts/appstore | ||
appstore_package_name=$(appstore_build_directory)/$(app_name) | ||
npm=$(shell which npm 2> /dev/null) | ||
composer=$(shell which composer 2> /dev/null) | ||
|
||
occ=$(CURDIR)/../../occ | ||
private_key=$(HOME)/.owncloud/certificates/$(app_name).key | ||
certificate=$(HOME)/.owncloud/certificates/$(app_name).crt | ||
sign=php -f $(occ) integrity:sign-app --privateKey="$(private_key)" --certificate="$(certificate)" | ||
sign_skip_msg="Skipping signing, either no key and certificate found in $(private_key) and $(certificate) or occ can not be found at $(occ)" | ||
ifneq (,$(wildcard $(private_key))) | ||
ifneq (,$(wildcard $(certificate))) | ||
ifneq (,$(wildcard $(occ))) | ||
CAN_SIGN=true | ||
endif | ||
endif | ||
endif | ||
|
||
.PHONY: all | ||
all: vendor | ||
|
||
# Removes the appstore build | ||
.PHONY: clean | ||
clean: | ||
rm -rf ./build/artifacts | ||
rm -rf ./vendor | ||
|
||
# Install dependencies | ||
vendor: | ||
$(composer) install | ||
|
||
# Builds the appstore package | ||
.PHONY: dist | ||
dist: | ||
make appstore | ||
|
||
# Builds the package for the app store, ignores php and js tests | ||
.PHONY: appstore | ||
appstore: vendor | ||
rm -rf $(appstore_build_directory) | ||
mkdir -p $(appstore_package_name) | ||
cp --parents -r \ | ||
appinfo \ | ||
lib \ | ||
vendor \ | ||
LICENSE \ | ||
$(appstore_package_name) | ||
|
||
ifdef CAN_SIGN | ||
$(sign) --path="$(appstore_package_name)" | ||
else | ||
@echo $(sign_skip_msg) | ||
endif | ||
tar -czf $(appstore_package_name).tar.gz -C $(appstore_package_name)/../ $(app_name) | ||
|
||
.PHONY: test-php-codecheck | ||
test-php-codecheck: | ||
$(occ) app:check-code $(app_name) -c private -c strong-comparison | ||
$(occ) app:check-code $(app_name) -c deprecation | ||
|
||
.PHONY: test-php-lint | ||
test-php-lint: | ||
../../lib/composer/bin/parallel-lint . --exclude 3rdparty --exclude build . | ||
|