-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
134 lines (113 loc) · 3.75 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#
# Nextcloud scaffolder tool
#
# Copyright (C) 2013 Bernhard Posselt, <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Makefile for building the project
app_name=quicknotes
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
# building the javascript
all: build
# L10N Rules
l10n-update-pot:
php translationtool.phar create-pot-files
l10n-transifex-pull:
tx pull -s -a
l10n-transifex-push:
tx push -s -t
l10n-transifex-apply:
php translationtool.phar convert-po-files
l10n-clean:
rm -rf translationfiles
rm -f translationtool.phar
l10n-deps:
@echo "Checking transifex client."
tx --version
@echo "Downloading translationtool.phar"
wget https://github.com/nextcloud/docker-ci/raw/master/translations/translationtool/translationtool.phar -O translationtool.phar
# general
deps:
mkdir -p vendor
rm -rf vendor/*
npm i
cp node_modules/handlebars/dist/handlebars.js vendor/
cp node_modules/isotope-layout/dist/isotope.pkgd.js vendor/
cp node_modules/medium-editor/dist/js/medium-editor.js vendor/
cp node_modules/medium-editor/dist/css/medium-editor.css vendor/
cp node_modules/medium-editor-autolist/dist/autolist.js vendor/
cp node_modules/lozad/dist/lozad.js vendor/
depsmin:
mkdir -p vendor
rm -rf vendor/*
npm i
cp node_modules/handlebars/dist/handlebars.min.js vendor/handlebars.js
cp node_modules/isotope-layout/dist/isotope.pkgd.min.js vendor/isotope.pkgd.js
cp node_modules/medium-editor/dist/js/medium-editor.min.js vendor/medium-editor.js
cp node_modules/medium-editor/dist/css/medium-editor.min.css vendor/medium-editor.css
cp node_modules/medium-editor-autolist/dist/autolist.min.js vendor/autolist.js
cp node_modules/lozad/dist/lozad.min.js vendor/lozad.js
# Build Rules
build-vue:
npm run build
js-templates:
node_modules/handlebars/bin/handlebars js/templates -f js/templates.js
build: depsmin js-templates build-vue
@echo ""
@echo "Build done. You can enable the application in Nextcloud."
# Clean
clean:
rm -rf $(build_dir)
distclean: clean
rm -rf vendor
rm -rf node_modules
rm -rf js/vendor
rm -rf js/node_modules
dist: appstore
appstore: distclean build
mkdir -p $(sign_dir)
rsync -a \
--exclude='.*' \
--exclude=build \
--exclude=CONTRIBUTING.md \
--exclude=composer* \
--exclude=doc \
--exclude=Makefile \
--exclude=package*json \
--exclude=l10n/no-php \
--exclude=phpunit*xml \
--exclude=tests \
--exclude=vendor/bin \
--exclude=node_modules \
--exclude=js/templates \
--exclude=src \
--exclude=templates/fake.php \
--exclude=translation* \
--exclude=webpack*.js \
--exclude=*.js.map \
--exclude=psalm.xml \
$(project_dir) $(sign_dir)
@echo "Signing…"
php ../../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