-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
109 lines (83 loc) · 1.9 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
# This file is licensed under the Affero General Public License version 3 or
# later. See the LICENSE file.
app_name=adminly_calendar
app_id=calendar
build_directory=$(CURDIR)/build
temp_build_directory=$(build_directory)/temp
build_tools_directory=$(CURDIR)/build/tools
all: dev-setup lint build-js-production test
release: npm-init build-js-production build-tarball
# Dev env management
dev-setup: clean clean-dev composer npm-init
lint: eslint stylelint prettier php-cs
lint-fix: eslint-fix stylelint-fix prettier-fix php-cs-fix
# Dependencies
composer:
composer install --prefer-dist
composer-update:
composer update --prefer-dist
npm-init:
npm ci
npm-update:
npm update
# Building
build-js:
npm run dev
build-js-production:
npm run build
watch-js:
npm run watch
serve-js:
npm run serve
# Linting
eslint:
npm run eslint
eslint-fix:
npm run eslint:fix
# Style linting
stylelint:
npm run stylelint
stylelint-fix:
npm run stylelint:fix
# Prettier
prettier:
npm run prettier
prettier-fix:
npm run prettier:fix
# 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:
rm -rf js/*
clean-dev:
rm -rf node_modules
# Tests
test:
npm run test
./vendor/phpunit/phpunit/phpunit -c phpunit.xml
build-tarball:
rm -rf $(build_directory)
mkdir -p $(temp_build_directory)
rsync -a \
--exclude=".git" \
--exclude=".github" \
--exclude=".vscode" \
--exclude="node_modules" \
--exclude="build" \
--exclude="vendor" \
--exclude=".editorconfig" \
--exclude=".gitignore" \
--exclude=".php_cs.dist" \
--exclude=".prettierrc" \
--exclude=".stylelintrc.json" \
--exclude="composer.json" \
--exclude="composer.lock" \
--exclude="Makefile" \
--exclude="package-lock.json" \
--exclude="package.json" \
../$(app_name)/ $(temp_build_directory)/$(app_id)
tar czf $(build_directory)/$(app_name).tar.gz \
-C $(temp_build_directory) $(app_id)