comparison release.sh @ 806:bcb74c9b895c

Moved out files in the trunk folder to the root.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sun, 09 Mar 2008 00:12:19 +0100
parents trunk/release.sh@b091e8b0ef5c
children a3d1d5d5ce44
comparison
equal deleted inserted replaced
805:a3fab8b74a7d 806:bcb74c9b895c
1 #!/bin/bash
2
3 if [[ $1 != [0-9].[0-9][0-9][0-9] ]]; then
4 echo Wrong version format. Expected: d.ddd
5 exit;
6 fi
7
8 BUILD="./build"
9 DIR="dil.$1"
10 DEST="$BUILD/$DIR"
11 FRESH_REPOS="$BUILD/fresh_repos"
12
13 # Create build directory if it doesn't exist.
14 [ ! -e $BUILD ] && mkdir $BUILD
15
16 # Convert Unix newlines to Windows newlines
17 # function unix2win
18 # {
19 # sed {s/$/\\r/} $*
20 # }
21
22 # We need dil to get a list of all modules to be compiled.
23 if [ ! -s ./dil ]; then
24 dsss build -full &> /dev/null
25 fi
26
27 if [ ! -s ./dil ]; then
28 echo "Couldn't build DIL. Can't get list of modules to be built."
29 exit;
30 fi
31
32 # Used by doc generation and winbuild function.
33 SRC_FILES=`./dil igraph src/main.d --paths`
34
35 # Recreate destination directory.
36 rm -rf $DEST
37 mkdir -p $DEST/{bin,doc/htmlsrc,src}
38
39 # Create documentation.
40 ./dil ddoc $DEST/doc/ -v src/macros_dil.ddoc -version=DDoc src/config.d $SRC_FILES
41 # Generate syntax highlighted HTML files.
42 HTMLSRC="$DEST/doc/htmlsrc"
43 for filepath in $SRC_FILES;
44 do
45 htmlfile=`echo $filepath | sed -e 's@^src/@@' -e 's@/@.@g' -e 's@.d$@@'`.html
46 echo "FILE: $filepath > $HTMLSRC/$htmlfile";
47 ./dil gen --lines --syntax --html $filepath > "$HTMLSRC/$htmlfile";
48 done
49
50 # Linux Debug
51 echo "***** Building Linux binaries *****"
52 dsss build -clean -full -version=D2
53 cp dil $DEST/bin/dil2_d
54 dsss build -clean -full
55 cp dil $DEST/bin/dil_d
56 # Linux Release
57 dsss build -clean -full -release -O -inline -version=D2
58 cp dil $DEST/bin/dil2
59 dsss build -clean -full -release -O -inline
60 cp dil $DEST/bin/dil
61
62 if [ -s ~/bin/dmd.exe ]; then
63 echo "***** Building Windows binaries *****"
64 function winbuild
65 { # obj dir is winobj. -op = don't strip paths from obj files.
66 wine ~/bin/dmd.exe -odwinobj -op -ofdil $* $SRC_FILES
67 }
68 # Windows Debug
69 winbuild -version=D2
70 cp dil.exe $DEST/bin/dil2_d.exe
71 winbuild
72 cp dil.exe $DEST/bin/dil_d.exe
73 # Windows Release
74 winbuild -release -O -inline -version=D2
75 cp dil.exe $DEST/bin/dil2.exe
76 winbuild -release -O -inline
77 cp dil.exe $DEST/bin/dil.exe
78 fi
79
80 # Copy source and other files.
81 rm -rf $FRESH_REPOS
82 hg archive -r tip -t files $FRESH_REPOS
83 cp -r $FRESH_REPOS/trunk/* $DEST
84
85 cp $FRESH_REPOS/trunk/src/config.d $DEST/bin/
86 cp $FRESH_REPOS/trunk/src/lang_*.d $DEST/bin/
87 cp $FRESH_REPOS/trunk/src/*_map.d $DEST/bin/
88 cp $FRESH_REPOS/trunk/src/*.css $DEST/bin/
89 cp $FRESH_REPOS/trunk/src/predefined.ddoc $DEST/bin/
90 cp $FRESH_REPOS/trunk/src/html.css $HTMLSRC
91
92 # Build archives
93 # tar.gz doesn't compress well
94 tar --owner root --group root -czf $DEST.tar.gz $DEST
95 tar --owner root --group root --bzip2 -cf $DEST.tar.bz2 $DEST
96 zip -q -9 -r $DEST.zip $DEST