-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
175 lines (145 loc) · 5.11 KB
/
Copy pathMakefile
File metadata and controls
175 lines (145 loc) · 5.11 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#
# Nextcloud scaffolder tool
#
# Copyright (C) 2013 Bernhard Posselt, <nukewhale@gmail.com>
#
# 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
mkdir -p js/vendor
mkdir -p css/vendor
rm -rf js/vendor/*
npm i
cp node_modules/handlebars/dist/handlebars.js js/vendor/
cp node_modules/isotope-layout/dist/isotope.pkgd.js js/vendor/
cp node_modules/medium-editor/dist/js/medium-editor.js js/vendor/
cp node_modules/medium-editor/dist/css/medium-editor.css css/vendor/medium-editor.css
cp node_modules/medium-editor-autolist/dist/autolist.js js/vendor/
cp node_modules/lozad/dist/lozad.js js/vendor/
depsmin:
mkdir -p vendor
mkdir -p js/vendor
mkdir -p css/vendor
rm -rf js/vendor/*
npm i
cp node_modules/handlebars/dist/handlebars.min.js js/vendor/handlebars.js
cp node_modules/isotope-layout/dist/isotope.pkgd.min.js js/vendor/isotope.pkgd.js
cp node_modules/medium-editor/dist/js/medium-editor.min.js js/vendor/medium-editor.js
cp node_modules/medium-editor/dist/css/medium-editor.min.css css/vendor/medium-editor.css
cp node_modules/medium-editor-autolist/dist/autolist.min.js js/vendor/autolist.js
cp node_modules/lozad/dist/lozad.min.js 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."
# Docker dev environment (preferred for end-to-end work).
# See docker/README.md for the full workflow; the scripts under
# docker/scripts/ do the actual work — these targets are thin wrappers
# so the same commands work whether the user types them directly or via
# make.
docker-up:
./docker/scripts/up.sh
docker-down:
./docker/scripts/down.sh $(if $(purge),--purge,)
docker-build:
./docker/scripts/build.sh
# Re-enable the app after editing PHP / info.xml / templates/*.php.
# Triggers a disable+enable so the schema migrations and the
# event-listener registration re-run.
docker-enable:
./docker/scripts/enable-app.sh
# Recompile js/templates.js from js/templates/*.handlebars inside the
# `builder` container. Cheaper than the full `make docker-build`
# because it skips `npm install` and the webpack pass — only the
# Handlebars precompile runs.
docker-templates:
docker compose -f docker/docker-compose.yml exec -T builder \
sh -c 'node_modules/.bin/handlebars js/templates -f js/templates.js'
docker-logs:
docker compose -f docker/docker-compose.yml logs -f
.PHONY: all build build-vue js-templates \
docker-up docker-down docker-build docker-enable \
docker-templates docker-logs
# 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