-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregenerate_documentation.sh
40 lines (33 loc) · 1.04 KB
/
regenerate_documentation.sh
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
#!/bin/bash
projectDir=`pwd`
if [ `basename $projectDir` != 'ais3uson_app' ] ; then
echo 'Current dir is not ais3uson_app'
echo `basename $projectDir`
exit 1
fi
# Clean old
rm -rf doc/api/
# Generate or exit
flutter pub global activate dartdoc # fix for https://githubhot.com/repo/dart-lang/dartdoc/issues/2934
flutter pub global run dartdoc . --use-categories || exit 1
#dartdoc || exit 1
## Add missed files
cp LICENSE doc/api/
mkdir doc/api/images/
cp images/_license.pdf doc/api/images/
mkdir doc/api/assets/
cp assets/ais-3uson-logo-128.png doc/api/assets/
cp qr_web3uson.png doc/api/
cp qrcode_ais3uson_app_on_google_play.png doc/api/
# gitHub wants docs dir - conform
rm -rf docs/*
cp -a doc/api/* docs/
rm -f docs/source_client_server_api_service_entry/ServiceEntry/tNum.html # remove duplicate
echo "Generation of documentation is complete"
# open generated docs in browser
if [ `echo $DISPLAY` == '' ] ; then
echo "No DISPLAY found - exiting"
exit 0
fi
dart pub global run dhttpd --path doc/api &
xdg-open http://localhost:8080 &