-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (50 loc) · 1.53 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
.DEFAULT_GOAL := help
include ../.env
export
.PHONY: require
require:
@echo "Checking the programs required for the build are installed..."
@node --version >/dev/null 2>&1 || (echo "ERROR: node is required."; exit 1)
@husky --version >/dev/null 2>&1 || (echo "ERROR: husky is required."; exit 1)
.PHONY: dep
#dep: @ Install all depencies defined in package.json
dep:
npm install
npm run prepare
.PHONY: test
#test: @ Run all tests
test: t.prettier t.lint
.PHONY: t.prettier
#t.prettier: @ Prettify the source code
t.prettier:
npm run prettier
.PHONY: t.lint
#t.lint: @ Checks the source code against defined coding standard rules
t.lint:
npm run lint
.PHONY: build
#build: @ Builds the project
build: dep b.clean t.lint b.bundle b.package
.PHONY: b.clean
#b.clean: @ Removes all build artifacts
b.clean:
rm -rf build release release.tar.gz
.PHONY: b.bundle
#b.bundle: @ Builds the application as a JavaScript bundle
b.bundle:
npm run build -- --NODE_ENV=production
.PHONY: b.package
#b.package: @ Packages the application for NextCloud as a tarball
b.package:
mkdir -p release/templates
cp -r build/static lib appinfo LICENSE README.md img release
./build-nextcloud-app.sh release
tar -czvf release.tar.gz -C release .
.PHONY: release
#release: @ Release on GitHub, tag the application with appinfo/info.xml
release: build
./release.sh
.PHONY: help
#help: @ List available tasks on this project
help:
@grep -E '[a-zA-Z\.\-]+:.*?@ .*$$' $(MAKEFILE_LIST)| tr -d '#' | awk 'BEGIN {FS = ":.*?@ "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'