-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
105 lines (93 loc) · 2.28 KB
/
Makefile
File metadata and controls
105 lines (93 loc) · 2.28 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
# Makefile for DashLink Nextcloud app
app_name=dashlink
project_dir=$(CURDIR)
build_dir=$(project_dir)/build
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+=1.0.0
all: dev
# Development build
.PHONY: dev
dev:
npm run dev
# Production build
.PHONY: build
build:
npm run build
# Install composer dependencies
.PHONY: composer
composer:
composer install --prefer-dist
composer dump-autoload
# Install npm dependencies
.PHONY: npm
npm:
npm install --legacy-peer-deps
# Clean build artifacts
.PHONY: clean
clean:
rm -rf $(build_dir)
rm -rf node_modules
rm -rf vendor
rm -rf js/
# Run tests
.PHONY: test
test:
composer test
# Run linters
.PHONY: lint
lint:
npm run lint
composer run lint
# Fix code style
.PHONY: fix
fix:
npm run lint:fix
composer run cs:fix
# Build app package for app store
.PHONY: appstore
appstore: clean build
mkdir -p $(sign_dir)
rsync -a \
--exclude=/.git \
--exclude=/.github \
--exclude=/build \
--exclude=/docs \
--exclude=/l10n/templates \
--exclude=/node_modules \
--exclude=/src \
--exclude=/tests \
--exclude=/vendor \
--exclude=/.gitignore \
--exclude=/.tx \
--exclude=/phpunit.xml \
--exclude=/composer.json \
--exclude=/composer.lock \
--exclude=/package.json \
--exclude=/package-lock.json \
--exclude=/webpack.config.js \
--exclude=/Makefile \
--exclude=/.editorconfig \
--exclude=/CLAUDE.md \
$(project_dir)/ $(sign_dir)/$(app_name)
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
.PHONY: help
help:
@echo "Available targets:"
@echo " make dev - Build for development with watch mode"
@echo " make build - Build for production"
@echo " make composer - Install PHP dependencies"
@echo " make npm - Install Node.js dependencies"
@echo " make clean - Clean build artifacts"
@echo " make test - Run tests"
@echo " make lint - Run linters"
@echo " make fix - Fix code style issues"
@echo " make appstore - Build app package for app store"