-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
132 lines (117 loc) · 5.15 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
SHELL := /bin/bash
GENERATED_DATA_DIR := .data
REPOS = heptaconnect-bridge-shopware-platform \
heptaconnect-core \
heptaconnect-dataset-base \
heptaconnect-dataset-ecommerce \
heptaconnect-framework \
heptaconnect-portal-base \
heptaconnect-portal-local-shopware-platform \
heptaconnect-package-http \
heptaconnect-package-web-frontend \
heptaconnect-package-shopware-6 \
heptaconnect-storage-base \
heptaconnect-storage-shopware-dal \
heptaconnect-test-suite-storage
ifndef MKDOCS
# MKDOCS := docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material
MKDOCS := mkdocs
endif
ifndef CURL
CURL := curl
endif
ifndef PHP
PHP := $(shell which php) $(PHP_EXTRA_ARGS)
endif
ifndef COMPOSER
COMPOSER := $(PHP) $(shell which composer)
endif
ifndef JQ
JQ := jq
endif
ifndef MKDIR
MKDIR := mkdir
endif
ifndef MV
MV := mv
endif
ifndef RM
RM := rm
endif
ifndef NPM
NPM := npm
endif
ifndef GIT
GIT := git
endif
.PHONY: all
all: build
.PHONY: clean
clean:
rm -rf ${GENERATED_DATA_DIR}/
rm -rf mkdocs-pdf.yml
rm -rf site/
rm -rf assets/css/vendor/
rm -rf node_modules/
rm -rf overrides/partials/github.json
rm -rf overrides/partials/generated/*.html
rm -rf overrides/partials/generated/*.md
rm -rf docs/assets/app.css
rm -rf docs/assets/uml/
rm -rf docs/assets/stylesheets/vendor/
rm -rf docs/assets/javascripts/vendor/
rm -rf docs/news/
.PHONY: build
build: assets/css/vendor/highlight.js/atom-one-dark.min.css docs/assets/javascripts/vendor/highlight.js/highlight.min.js github_stats rss adr node_modules git-code-dependencies
$(NPM) run simplify-recent-releases
$(NPM) run mkdocs-pdf
$(MKDOCS) build -f mkdocs-pdf.yml
$(MV) site/pdf/document.pdf document.pdf
$(NPM) run prod
$(MKDOCS) build
$(NPM) run html-minify
$(NPM) run cache-breaker
$(MV) document.pdf site/HEPTAconnect.pdf
.PHONY: github_stats
github_stats: overrides/partials/github.json
.PHONY: rss
rss: node_modules
$(NPM) run rss
.PHONY: adr
adr: node_modules
$(NPM) run adr
overrides/partials/github.json: $(GENERATED_DATA_DIR)
$(CURL) -o ${GENERATED_DATA_DIR}/github-framework.json https://api.github.com/repos/HEPTACOM/heptaconnect-framework
$(CURL) -o ${GENERATED_DATA_DIR}/github-bridge-shopware-platform.json https://api.github.com/repos/HEPTACOM/heptaconnect-bridge-shopware-platform
$(CURL) -o ${GENERATED_DATA_DIR}/github-core.json https://api.github.com/repos/HEPTACOM/heptaconnect-core
$(CURL) -o ${GENERATED_DATA_DIR}/github-dataset-base.json https://api.github.com/repos/HEPTACOM/heptaconnect-dataset-base
$(CURL) -o ${GENERATED_DATA_DIR}/github-dataset-ecommerce.json https://api.github.com/repos/HEPTACOM/heptaconnect-dataset-ecommerce
$(CURL) -o ${GENERATED_DATA_DIR}/github-docs.json https://api.github.com/repos/HEPTACOM/heptaconnect-docs
$(CURL) -o ${GENERATED_DATA_DIR}/github-playground.json https://api.github.com/repos/HEPTACOM/heptaconnect-playground
$(CURL) -o ${GENERATED_DATA_DIR}/github-portal-base.json https://api.github.com/repos/HEPTACOM/heptaconnect-portal-base
$(CURL) -o ${GENERATED_DATA_DIR}/github-portal-local-shopware-platform.json https://api.github.com/repos/HEPTACOM/heptaconnect-portal-local-shopware-platform
$(CURL) -o ${GENERATED_DATA_DIR}/github-package-shopware-6.json https://api.github.com/repos/HEPTACOM/heptaconnect-package-shopware-6
$(CURL) -o ${GENERATED_DATA_DIR}/github-storage-base.json https://api.github.com/repos/HEPTACOM/heptaconnect-storage-base
$(CURL) -o ${GENERATED_DATA_DIR}/github-storage-shopware-dal.json https://api.github.com/repos/HEPTACOM/heptaconnect-storage-shopware-dal
$(CURL) -o ${GENERATED_DATA_DIR}/github-test-suite-storage.json https://api.github.com/repos/HEPTACOM/heptaconnect-test-suite-storage
$(JQ) -s '{ stars: [ .[].stargazers_count ] | add, forks: [ .[].forks ] | add, repositories: . | length }' ${GENERATED_DATA_DIR}/github-*.json > overrides/partials/github.json
assets/css/vendor/highlight.js/atom-one-dark.min.css:
$(MKDIR) -p assets/css/vendor/highlight.js
$(CURL) -o assets/css/vendor/highlight.js/atom-one-dark.min.css https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/atom-one-dark.min.css
docs/assets/javascripts/vendor/highlight.js/highlight.min.js:
$(MKDIR) -p docs/assets/javascripts/vendor/highlight.js
$(CURL) -o docs/assets/javascripts/vendor/highlight.js/highlight.min.js https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js
.PHONY: git-code-dependencies
git-code-dependencies: $(REPOS)
.PHONY: $(REPOS)
$(REPOS): $(GENERATED_DATA_DIR)
$(GIT) -C "${GENERATED_DATA_DIR}/git-$@" pull --ff-only || git clone --depth 1 --no-tags "https://github.com/HEPTACOM/[email protected]" "${GENERATED_DATA_DIR}/git-$@"
stat ${GENERATED_DATA_DIR}/git-heptaconnect-src || mkdir ${GENERATED_DATA_DIR}/git-heptaconnect-src
test -d "${GENERATED_DATA_DIR}/git-$@/src" && cp -a "${GENERATED_DATA_DIR}/git-$@/src" "${GENERATED_DATA_DIR}/git-heptaconnect-src/$@" || cp -a "${GENERATED_DATA_DIR}/git-$@" "${GENERATED_DATA_DIR}/git-heptaconnect-src/$@"
.bin/PhpDependencyAnalysis:
$(GIT) clone https://github.com/HEPTACOM/PhpDependencyAnalysis.git .bin/PhpDependencyAnalysis
$(COMPOSER) install -d .bin/PhpDependencyAnalysis
node_modules:
$(NPM) ci --include=dev
$(GENERATED_DATA_DIR):
mkdir -p ${GENERATED_DATA_DIR}