-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
149 lines (124 loc) · 3.31 KB
/
Makefile
File metadata and controls
149 lines (124 loc) · 3.31 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
# This file is licensed under the Affero General Public License version 3 or
# later. See the LICENSE file.
app_name=nextcloud-swarm-plugin
app_id=files_external_ethswarm
build_directory=$(CURDIR)/build
temp_build_directory=$(build_directory)/temp
build_tools_directory=$(CURDIR)/build/tools
cert_directory=$(HOME)/.nextcloud/certificates
all: dev-setup lint build-js-production
release: composer pnpm-init build-js-production build-tarball
appstore: composer pnpm-init build-js-production build-appstore-tarball
dev-setup: clean-dev composer pnpm-init
lint: lint-js-check format-check typecheck php-cs
lint-fix: lint-js-fix format-fix php-cs-fix
# Dependencies
composer:
composer install --prefer-dist
composer-update:
composer update --prefer-dist
pnpm-init:
pnpm install --frozen-lockfile
pnpm-update:
pnpm update
# Building
build-js:
pnpm run dev
build-js-production:
pnpm run build
watch-js:
pnpm run dev
serve-js:
pnpm run serve
# Linting
lint-js-check:
pnpm run lint
lint-js-fix:
pnpm run lint:fix
format-check:
pnpm run format
format-fix:
pnpm run format:fix
typecheck:
pnpm run typecheck
# PHP CS Fixer
php-cs:
vendor/bin/php-cs-fixer fix -v --dry-run
php-cs-fix:
vendor/bin/php-cs-fixer fix -v
# Cleaning
clean-dev:
rm -rf node_modules
build-tarball:
rm -rf $(build_directory)
mkdir -p $(temp_build_directory)
rsync -a \
--exclude=".git" \
--exclude=".github" \
--exclude=".vscode" \
--exclude="assets" \
--exclude="build" \
--exclude="cli" \
--exclude="dev-environment" \
--exclude="docker" \
--exclude="node_modules" \
--exclude="./src" \
--exclude="styles" \
--exclude="./vendor" \
--exclude="biome.json" \
--exclude=".editorconfig" \
--exclude=".gitignore" \
--exclude=".php_cs.cache" \
--exclude=".php-cs-fixer.dist.php" \
--exclude="composer.json" \
--exclude="composer.lock" \
--exclude="docker-compose.yml" \
--exclude="tsconfig.json" \
--exclude="Makefile" \
--exclude="package.json" \
--exclude="pnpm-lock.yaml" \
--exclude="vite.config.mjs" \
--exclude="CHANGELOG.md" \
../$(app_name)/ $(temp_build_directory)/$(app_id)
tar czf $(build_directory)/$(app_name).tar.gz \
-C $(temp_build_directory) $(app_id)
build-appstore-tarball:
rm -rf $(build_directory)
mkdir -p $(temp_build_directory)
rsync -a \
--exclude=".git" \
--exclude=".github" \
--exclude=".vscode" \
--exclude="assets" \
--exclude="build" \
--exclude="cli" \
--exclude="dev-environment" \
--exclude="docker" \
--exclude="node_modules" \
--exclude="./src" \
--exclude="styles" \
--exclude="./vendor" \
--exclude="biome.json" \
--exclude=".editorconfig" \
--exclude=".gitignore" \
--exclude=".php_cs.cache" \
--exclude=".php-cs-fixer.dist.php" \
--exclude="composer.json" \
--exclude="composer.lock" \
--exclude="docker-compose.yml" \
--exclude="tsconfig.json" \
--exclude="Makefile" \
--exclude="package.json" \
--exclude="pnpm-lock.yaml" \
--exclude="vite.config.mjs" \
--exclude="CHANGELOG.md" \
../$(app_id)/ $(temp_build_directory)/$(app_id)
@if [ -f $(cert_directory)/$(app_id).key ]; then \
echo "Signing app files…"; \
php ../occ integrity:sign-app \
--privateKey=$(cert_directory)/$(app_id).key\
--certificate=$(cert_directory)/$(app_id).crt\
--path=$(temp_build_directory)/$(app_id); \
fi
tar czf $(build_directory)/$(app_id).tar.gz \
-C $(temp_build_directory) $(app_id)