-
Notifications
You must be signed in to change notification settings - Fork 47
/
generate-pages
executable file
·56 lines (45 loc) · 2.2 KB
/
generate-pages
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
#!/usr/bin/env bash
: "${DTC_VERSION:=latest}"
export DTC_VERSION
: "${DTC_TASKS:=exportExcel generateHtml generateSite generatePdf}"
# Use a local version!
if test -d "${HOME}/.doctoolchain/docToolchain-${DTC_VERSION}"; then
if test "${DTC_VERSION}" = "latest"; then
(cd "${HOME}/.doctoolchain/docToolchain-${DTC_VERSION}" && git pull )
fi
else
./dtcw local install doctoolchain
fi
test -d "${HOME}/.doctoolchain/jdk" || ./dtcw local install java
set -eu -o pipefail
run() {
local title="${1}"
shift
local action="${*}"
echo "##########################"
echo "### ${title} ###"
echo "####### Start ############"
bash -c "${action}"
echo "######## End #############"
echo
}
run "CleanUp build" rm -rf build/html5 build/microsite build/pdf
run "Create CHANGELOG" "cat src/templates/CHANGELOG-head.md CHANGELOG.md > src/docs/development/CHANGELOG.md"
run "DTC (tasks '${DTC_TASKS}' with version '${DTC_VERSION}')" \
./dtcw local "${DTC_TASKS} --refresh-dependencies --scan"
run "CleanUp Internals" rm -rf build/microsite/output/excel
run "CleanUp Drafts" find build/microsite/output/. -name "*-draft.html" -type f -delete
run "CleanUp Reports" rm -rf build/report build/test-results
run copyPdf cp -rp build/pdf build/microsite/output
run copyStandalone cp -rp build/html5/images build/microsite/output \
&& mkdir -p build/microsite/output/single-page/ \
&& cp -p build/html5/arc42/hsc_arc42.html build/microsite/output/single-page/hsc_arc42-single-page.html
run htmlSanityCheck "(cd self-check && ../gradlew htmlSanityCheck --refresh-dependencies --scan)"
run copyCheckResult cp -rp build/reports/htmlchecks build/microsite/output
run fixDocLinks "sed -i .bak \
-e 's, href=\"${PWD}/build/microsite/output/, href=\"../,g' \
-e 's,\">${PWD}/build/microsite/output/,\">,g' \
build/microsite/output/htmlchecks/index.html" \
&& rm -f build/microsite/output/htmlchecks/index.html.bak
run "CleanUp public" rm -rf public
run copyToPublic cp -rp build/microsite/output public