2016-12-13 17:17:39 +03:00
|
|
|
# Makefile for building the project
|
|
|
|
|
|
|
|
app_name=spreed
|
|
|
|
|
|
|
|
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+=master
|
|
|
|
|
2019-05-06 15:45:39 +03:00
|
|
|
all: dev-setup build-js-production
|
|
|
|
|
|
|
|
dev-setup: clean-dev npm-init
|
|
|
|
|
2019-12-16 14:01:33 +03:00
|
|
|
dependabot: dev-setup npm-update build-js-production
|
2016-12-13 17:17:39 +03:00
|
|
|
|
2016-12-13 17:25:27 +03:00
|
|
|
release: appstore create-tag
|
|
|
|
|
2019-05-06 15:45:39 +03:00
|
|
|
build-js:
|
2019-10-09 13:21:33 +03:00
|
|
|
npm run dev
|
2016-12-13 17:25:27 +03:00
|
|
|
|
2019-05-06 15:45:39 +03:00
|
|
|
build-js-production:
|
2019-10-09 13:21:33 +03:00
|
|
|
npm run build
|
2019-05-06 15:45:39 +03:00
|
|
|
|
|
|
|
watch-js:
|
2019-10-09 13:21:33 +03:00
|
|
|
npm run watch
|
2019-05-06 15:45:39 +03:00
|
|
|
|
2020-03-18 12:45:29 +03:00
|
|
|
test:
|
|
|
|
npm run test:unit
|
|
|
|
|
2019-05-06 15:45:39 +03:00
|
|
|
lint:
|
2019-10-09 13:11:42 +03:00
|
|
|
npm run lint
|
2019-05-06 15:45:39 +03:00
|
|
|
|
|
|
|
lint-fix:
|
2019-10-09 13:11:42 +03:00
|
|
|
npm run lint:fix
|
2016-12-13 17:17:39 +03:00
|
|
|
|
2019-10-18 14:01:50 +03:00
|
|
|
npm-init:
|
2019-05-06 15:45:39 +03:00
|
|
|
npm install
|
2016-12-13 17:17:39 +03:00
|
|
|
|
2019-05-06 15:45:39 +03:00
|
|
|
npm-update:
|
|
|
|
npm update
|
|
|
|
|
|
|
|
clean:
|
2019-10-18 15:23:52 +03:00
|
|
|
rm -rf js/*
|
2019-05-06 15:45:39 +03:00
|
|
|
rm -rf $(build_dir)
|
|
|
|
|
|
|
|
clean-dev: clean
|
|
|
|
rm -rf node_modules
|
|
|
|
|
|
|
|
create-tag:
|
|
|
|
git tag -a v$(version) -m "Tagging the $(version) release."
|
|
|
|
git push origin v$(version)
|
2016-12-13 17:17:39 +03:00
|
|
|
|
2019-05-08 19:08:03 +03:00
|
|
|
appstore:
|
|
|
|
rm -rf $(build_dir)
|
2016-12-13 17:17:39 +03:00
|
|
|
mkdir -p $(sign_dir)
|
|
|
|
rsync -a \
|
2020-04-14 15:31:00 +03:00
|
|
|
--exclude=babel.config.js \
|
2016-12-13 18:21:59 +03:00
|
|
|
--exclude=/build \
|
2020-04-14 17:43:12 +03:00
|
|
|
--exclude=composer.json \
|
|
|
|
--exclude=composer.lock \
|
2016-12-13 17:17:39 +03:00
|
|
|
--exclude=docs \
|
|
|
|
--exclude=.drone.yml \
|
|
|
|
--exclude=.eslintignore \
|
2019-12-16 14:09:13 +03:00
|
|
|
--exclude=.eslintrc.js \
|
2016-12-13 17:17:39 +03:00
|
|
|
--exclude=.git \
|
|
|
|
--exclude=.gitattributes \
|
|
|
|
--exclude=.github \
|
|
|
|
--exclude=.gitignore \
|
2020-04-14 15:31:00 +03:00
|
|
|
--exclude=jest.config.js \
|
2019-05-16 15:48:52 +03:00
|
|
|
--exclude=.l10nignore \
|
2019-12-16 14:09:13 +03:00
|
|
|
--exclude=mkdocs.yml \
|
2016-12-13 17:17:39 +03:00
|
|
|
--exclude=Makefile \
|
|
|
|
--exclude=node_modules \
|
|
|
|
--exclude=package.json \
|
2019-05-16 15:48:52 +03:00
|
|
|
--exclude=package-lock.json \
|
2020-04-14 17:43:12 +03:00
|
|
|
--exclude=.php_cs.dist \
|
2020-05-12 22:52:15 +03:00
|
|
|
--exclude=.php_cs.cache \
|
2016-12-13 17:17:39 +03:00
|
|
|
--exclude=README.md \
|
2019-10-18 14:01:50 +03:00
|
|
|
--exclude=src \
|
2019-12-16 14:09:13 +03:00
|
|
|
--exclude=.stylelintignore \
|
2020-05-12 22:52:15 +03:00
|
|
|
--exclude=stylelint.config.js \
|
|
|
|
--exclude=.tx \
|
2016-12-13 17:17:39 +03:00
|
|
|
--exclude=tests \
|
2020-04-14 17:43:12 +03:00
|
|
|
--exclude=vendor \
|
2019-12-16 14:09:13 +03:00
|
|
|
--exclude=webpack.*.js \
|
2016-12-13 18:32:39 +03:00
|
|
|
$(project_dir)/ $(sign_dir)/$(app_name)
|
2016-12-13 17:17:39 +03:00
|
|
|
@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=$(sign_dir)/$(app_name); \
|
|
|
|
fi
|
|
|
|
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
|