-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (49 loc) · 1.79 KB
/
Makefile
File metadata and controls
61 lines (49 loc) · 1.79 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
VERSION=$(shell node -pe "require('./package.json').version")
# Generate the list of authors with the number of occurences in the git log
# (representing the amount of commits)
commit-count:
@git log --format='%aN <%aE>' | sort | uniq -c | sort -r;
# The list of authors, with the commit-count itself removed
credits:
@$(MAKE) commit-count | sed 's/^ *[0-9]* //';
# The list of authors piped into AUTHORS file
authors:
@$(MAKE) credits > AUTHORS.md;
# clean up the build target (if exists)
clean:
@rm -rf ./build/* || mkdir -p ./build;
# build only kontext itself
kontext-only:
@devour kontext;
# build only the kontext extensions
kontext-extensions:
@devour kontext:extensions;
# build only the kontext providers
kontext-providers:
@devour kontext:providers;
# build Kontext and all extensions/providers
kontext:
@devour kontext kontext:extensions kontext:providers;
# run the automated tests using npm (once)
npm-test:
@npm test;
# do some linting (in case of editing without a built-in one)
lint:
@eslint -c .eslintrc {test,source}
# create a fresh distribution in the dist folder
distribution:
@make clean authors lint npm-test && \
mkdir -p dist && \
cat build/kontext.js `ls -1 build/{provider,extension}/*.js | grep -v min` > \
dist/kontext-$(VERSION).js && \
cp dist/kontext-$(VERSION).js dist/kontext-latest.js && \
cat build/kontext.min.js build/{provider,extension}/*.min.js > \
dist/kontext-$(VERSION).min.js && \
cp dist/kontext-$(VERSION).min.js dist/kontext-latest.min.js;
distribution-size-report:
@make distribution && \
echo "Build sizes:" && \
ls -l build/{kontext,extension/*,provider/*}.js | grep -v ".min." && \
echo "Distribution sizes:" && \
ls -l dist | grep latest && \
gzip dist/*latest*js && ls -l dist | grep latest && gunzip dist/*latest*gz;