Browse Source

refactor Makefile

pull/679/head
korelstar 3 months ago
parent
commit
25ac9aa7db
  1. 99
      Makefile

99
Makefile

@ -1,16 +1,48 @@
### build and sign release
app_name=notes
project_dir=$(CURDIR)/../$(app_name)
build_dir=$(CURDIR)/build/artifacts
sign_dir=$(build_dir)/sign
appstore_dir=$(build_dir)/appstore
package_name=$(app_name)
cert_dir=$(HOME)/.nextcloud/certificates
appstore: clean lint build-js-production
mkdir -p $(sign_dir)
all: dev-setup build
##### Environment ####
dev-setup: clean clean-dev init
init: composer-init npm-init
composer-init:
composer install
npm-init:
npm install
npm-upgrade:
npm-upgrade
npm install
npm-update:
npm update
##### Building #####
appstore: lint build
@echo "Signing…"
php ../server/occ integrity:sign-app \
--privateKey=$(cert_dir)/$(app_name).key\
--certificate=$(cert_dir)/$(app_name).crt\
--path=$(build_dir)/$(app_name)
tar -czf $(build_dir)/$(app_name).tar.gz \
-C $(build_dir) $(app_name)
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name).tar.gz | openssl base64
build: clean build-js-production
mkdir -p $(build_dir)
rsync -a \
--exclude=.babelrc.js \
--exclude=build \
@ -35,40 +67,8 @@ appstore: clean lint build-js-production
--exclude=.tx \
--exclude=vendor \
--exclude=webpack*.js \
$(project_dir) $(sign_dir)
@echo "Signing…"
php ../server/occ integrity:sign-app \
--privateKey=$(cert_dir)/$(app_name).key\
--certificate=$(cert_dir)/$(app_name).crt\
--path=$(sign_dir)/$(app_name)
tar -czf $(build_dir)/$(app_name).tar.gz \
-C $(sign_dir) $(app_name)
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name).tar.gz | openssl base64
### from vueexample
all: dev-setup build-js-production
# Dev env management
dev-setup: clean clean-dev init
init: composer-init npm-init
composer-init:
composer install
npm-init:
npm install
npm-upgrade:
npm-upgrade
npm install
$(project_dir) $(build_dir)
npm-update:
npm update
# Building
build-js:
npm run dev
@ -78,14 +78,18 @@ build-js-production:
watch-js:
npm run watch
# Testing
##### Testing #####
test: test-api
test-api:
phpunit --bootstrap vendor/autoload.php --testdox tests/api/
# Linting
##### Linting #####
lint: lint-php lint-js lint-css lint-xml
@ -125,7 +129,9 @@ lint-xml:
xmllint appinfo/info.xml --schema appinfo/info.xsd --noout
# Fix lint
##### Fix lint #####
lint-fix: lint-php-fix lint-js-fix lint-css-fix
lint-php-fix:
@ -138,7 +144,10 @@ lint-js-fix:
lint-css-fix:
npm run stylelint:fix
# Cleaning
##### Cleaning #####
clean:
rm -rf js/
rm -rf $(build_dir)

Loading…
Cancel
Save