Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notes.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkorelstar <korelstar@users.noreply.github.com>2021-02-03 23:28:15 +0300
committerkorelstar <korelstar@users.noreply.github.com>2021-02-03 23:35:06 +0300
commit25ac9aa7dbe6c5c6464b2d67a188dca96305ff96 (patch)
tree83090f5498decf4b64acd1ef47f96bb5e76e093d /Makefile
parentf362ea42e3fa3189ef12001fa68b8caabc22ee67 (diff)
refactor Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile99
1 files changed, 54 insertions, 45 deletions
diff --git a/Makefile b/Makefile
index c8a8ccfb..d8092cae 100644
--- a/Makefile
+++ b/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)