forked from eclipse-archived/ceylon-lang.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-site.sh
executable file
·74 lines (64 loc) · 1.69 KB
/
build-site.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
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
## Copy the latest version of the spec
## as well as the latest version of the ceylon.language ceylondoc
##
while [ $# -gt 0 ] ; do
case $1 in
--help) HELP="true" ; shift 1 ;;
--light) LIGHT="true" ; shift 1 ;;
*) shift 1 ;;
esac
done
if [ "$HELP" = "true" ]; then
echo "Options:"
echo " --light to only copy files (spec and docs are assumed to be built)"
echo " --help this help message"
exit 0;
fi
# Build site
awestruct --profile production
# Update the repos
REPOS="_tmp/repos"
mkdir -p $REPOS
cd $REPOS
if [ ! -d "ceylon-spec" ]; then
git clone [email protected]:ceylon/ceylon-spec.git
fi
if [ ! -d "ceylon.language" ]; then
git clone [email protected]:ceylon/ceylon.language.git
fi
if [ ! -d "ceylon-compiler" ]; then
git clone [email protected]:ceylon/ceylon-compiler.git
fi
# Build spec and type checker
if [ "$LIGHT" != "true" ]; then
cd ceylon-spec
git fetch origin
git checkout origin/master
ant
ant publish
cd ..
fi
# Copy spec into website
rm -rf ../../_site/documentation/spec
cp -R ceylon-spec/build/en ../../_site/documentation/spec
mv ../../_site/documentation/spec/pdf/Ceylon*.pdf ../../_site/documentation/spec/pdf/ceylon-language-specification.pdf
# Build language module
if [ "$LIGHT" != "true" ]; then
cd ceylon.language
git fetch origin
git checkout origin/master
ant
cd ..
fi
# Create ceylondoc for ceylon.language and copy it into the website
if [ "$LIGHT" != "true" ]; then
cd ceylon-compiler
git fetch origin
git checkout origin/master
ant build
cd ..
fi
mkdir -p ../../../_site/documentation/api/current/ceylon/language
./ceylon-compiler/bin/ceylond -dest-dir ../../_site/documentation/api/current/ceylon/language -src ceylon.language/languagesrc/current/
cd ../..