bookmarks/Makefile

95 lines
1.7 KiB
Makefile
Raw Permalink Normal View History

2017-07-16 16:25:27 +00:00
app_name=bookmarks
project_dir=$(CURDIR)/../$(app_name)
build_dir=$(CURDIR)/build/artifacts
appstore_dir=$(build_dir)/appstore
source_dir=$(build_dir)/source
sign_dir=$(build_dir)/sign
package_name=$(app_name)
cert_dir=$(HOME)/.nextcloud/certificates
version+=14.0.2
2017-07-16 16:25:27 +00:00
all: dev-setup build-js-production composer-no-dev
2017-07-16 16:25:27 +00:00
release: appstore create-tag
create-tag:
git tag -s -a v$(version) -m "Tagging the $(version) release."
git push origin v$(version)
# Dev env management
dev-setup: clean clean-dev npm-init composer-install
2017-07-16 16:25:27 +00:00
npm-init:
npm ci
npm-update:
npm update
composer-install:
composer install
composer-no-dev:
composer install --no-dev
# Building
build-js:
npm run dev
build-js-production:
2018-05-25 19:43:36 +00:00
npm run build
watch-js:
npm run watch
# Linting
lint:
npm run lint
lint-fix:
npm run lint:fix
# Style linting
stylelint:
npm run stylelint
stylelint-fix:
npm run stylelint:fix
# Cleaning
clean:
rm -rf js
2020-09-30 10:26:49 +00:00
rm -rf $(sign_dir)
clean-dev:
rm -rf node_modules
appstore:
2017-07-16 16:25:27 +00:00
mkdir -p $(sign_dir)
rsync -a \
2019-09-14 12:25:34 +00:00
--include=/js \
2020-06-30 15:27:22 +00:00
--include=/vendor \
--include=/CHANGELOG.md \
--include=/README.md \
--include=/composer.json \
--include=/composer.lock \
--include=/vendor \
--include=/tests \
--include=/templates \
--include=/package.json \
--include=/package-lock.json \
--include=/src \
--include=/lib \
--include=/l10n \
--include=/img \
--include=/appinfo \
--exclude=**/*.map \
2020-06-30 15:27:22 +00:00
--exclude=/* \
2017-07-16 16:25:27 +00:00
$(project_dir)/ $(sign_dir)/$(app_name)
tar -czf $(build_dir)/$(app_name)-$(version).tar.gz \
-C $(sign_dir) $(app_name)
@if [ -f $(cert_dir)/$(app_name).key ]; then \
echo "Signing package…"; \
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name)-$(version).tar.gz | openssl base64; \
fi