-
Notifications
You must be signed in to change notification settings - Fork 841
/
deploy_javadoc.sh
executable file
·65 lines (49 loc) · 1.14 KB
/
deploy_javadoc.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
REPO="[email protected]:sockeqwe/mosby.git"
MODULES[0]=core
MODULES[1]=core-dagger1
MODULES[2]=mvp
MODULES[3]=mvp-common
MODULES[4]=mvp-dagger1
MODULES[5]=retrofit
MODULES[6]=rx
MODULES[7]=viewstate
MODULES[8]=mvi
MODULES[9]=mvi-common
MODULES[10]=mvp-lce
MODULES[11]=mvp-nullobject-presenter
MODULES[12]=presentermanager
MODULES[13]=utils-fragment
DIR=/tmp/temp-clone
# Delete any existing temporary website clone
rm -rf $DIR
# Clone the current repo into temp folder
git clone $REPO $DIR
# Move working directory into temp folder
cd $DIR
mkdir ./merged_source
mkdir ../static
mkdir ../static/javadoc
for i in "${MODULES[@]}"
do
cp -R ./$i/src/main/java/com ./merged_source
done
cd merged_source
javadoc -d ../../static/javadoc -sourcepath . -subpackages com
cd ..
rm -rf merged_source
# Checkout and track the gh-pages branch
git checkout -t origin/gh-pages
rm -rf ./static/javadoc
mkdir ./static
cp -rf ../static/javadoc ./static/javadoc
rm -rf ../static/javadoc
# Commit changes
git add .
git add -u
git commit -m "Website at $(date)"
# Push the new files up to GitHub
git push origin gh-pages
# Delete our temp folder
cd ..
rm -rf $DIR