-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
98 lines (72 loc) · 2.67 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
PACKAGE_NAME = kopano-meet
# Tools
YARN ?= yarn
CHGLOG ?= git-chglog
# Variables
ARGS ?=
VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2>/dev/null | sed 's/^v//' || \
cat $(CURDIR)/.version 2> /dev/null || echo 0.0.0-unreleased)
# Build
.PHONY: all
all: build
.PHONY: build
build: vendor | src i18n ; $(info building ...) @
@rm -rf build
REACT_APP_KOPANO_BUILD="${VERSION}" $(YARN) run build
.PHONY: src
src:
@$(MAKE) -C src
.PHONY: i18n
i18n: vendor
@$(MAKE) -C i18n
.PHONY: lint
lint: vendor ; $(info running eslint ...) @
@$(YARN) eslint . --cache && echo "eslint: no lint errors"
.PHONY: lint-checkstyle
lint-checkstyle: vendor ; $(info running eslint checkstyle ...) @
@$(YARN) eslint -f checkstyle -o ./test/tests.eslint.xml . || true
# Tests
.PHONY: test
test: vendor ; $(info running jest tests ...) @
REACT_APP_KOPANO_BUILD="${VERSION}" CI=true $(YARN) test -- --verbose
.PHONY: test-coverage
test-coverage: vendor ; $(info running jest tests ...) @
REACT_APP_KOPANO_BUILD="${VERSION}" CI=true JEST_JUNIT_OUTPUT=./test/jest-test-results.xml $(YARN) test -- --coverage --coverageDirectory=coverage --testResultsProcessor="jest-junit"
# Yarn
.PHONY: vendor
vendor: .yarninstall
.yarninstall: package.json ; $(info getting depdencies with yarn ...) @
@$(YARN) install --silent
@touch $@
# Dist
.PHONY: licenses
licenses: ; $(info building licenses files ...)
@echo "# Kopano Meet 3rd party licenses\n\nCopyright 2019-2020 Kopano and its licensors. See LICENSE.txt for license information. This document contains a list of open source components used in this project.\n\n## Kopano Meet webapp\n" > 3rdparty-LICENSES.md
@$(YARN) run -s licenses >> 3rdparty-LICENSES.md
3rdparty-LICENSES.md: licenses
.PHONY: dist
dist: 3rdparty-LICENSES.md ; $(info building dist tarball ...)
@mkdir -p "dist/${PACKAGE_NAME}-${VERSION}"
@cd dist && \
cp -avf ../LICENSE.txt "${PACKAGE_NAME}-${VERSION}" && \
cp -avf ../3rdparty-LICENSES.md "${PACKAGE_NAME}-${VERSION}" && \
cp -avf ../README.md "${PACKAGE_NAME}-${VERSION}" && \
cp -avf ../CHANGELOG.md "${PACKAGE_NAME}-${VERSION}" && \
cp -avf ../config.json.in "${PACKAGE_NAME}-${VERSION}" && \
cp -avf ../Caddyfile.example "${PACKAGE_NAME}-${VERSION}" && \
cp -avr ../build "${PACKAGE_NAME}-${VERSION}/meet-webapp" && \
tar --owner=0 --group=0 -czvf ${PACKAGE_NAME}-${VERSION}.tar.gz "${PACKAGE_NAME}-${VERSION}" && \
cd ..
.PHONY: changelog
changelog: ; $(info updating changelog ...)
$(CHGLOG) --output CHANGELOG.md $(ARGS)
.PHONY: clean ; $(info cleaning ...) @
clean:
$(YARN) cache clean
@rm -rf build
@rm -rf node_modules
@rm -f .yarninstall
@$(MAKE) -C src clean
.PHONY: version
version:
@echo $(VERSION)