Mercurial > projects > dil
annotate trunk/release.sh @ 793:b091e8b0ef5c
Fixed and improved release.sh.
Modified DDoc comments of modules in util/.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Wed, 27 Feb 2008 18:37:13 +0100 |
parents | 4adfca0c71df |
children |
rev | line source |
---|---|
450 | 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" | |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
9 DIR="dil.$1" |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
10 DEST="$BUILD/$DIR" |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
11 FRESH_REPOS="$BUILD/fresh_repos" |
450 | 12 |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
13 # Create build directory if it doesn't exist. |
450 | 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 | |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
24 dsss build -full &> /dev/null |
450 | 25 fi |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
26 |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
27 if [ ! -s ./dil ]; then |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
28 echo "Couldn't build DIL. Can't get list of modules to be built." |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
29 exit; |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
30 fi |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
31 |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
32 # Used by doc generation and winbuild function. |
450 | 33 SRC_FILES=`./dil igraph src/main.d --paths` |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
34 |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
35 # Recreate destination directory. |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
36 rm -rf $DEST |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
37 mkdir -p $DEST/{bin,doc/htmlsrc,src} |
450 | 38 |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
39 # Create documentation. |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
40 ./dil ddoc $DEST/doc/ -v src/macros_dil.ddoc -version=DDoc src/config.d $SRC_FILES |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
41 # Generate syntax highlighted HTML files. |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
42 HTMLSRC="$DEST/doc/htmlsrc" |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
43 for filepath in $SRC_FILES; |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
44 do |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
45 htmlfile=`echo $filepath | sed -e 's@^src/@@' -e 's@/@.@g' -e 's@.d$@@'`.html |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
46 echo "FILE: $filepath > $HTMLSRC/$htmlfile"; |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
47 ./dil gen --lines --syntax --html $filepath > "$HTMLSRC/$htmlfile"; |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
48 done |
450 | 49 |
50 # Linux Debug | |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
51 echo "***** Building Linux binaries *****" |
450 | 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 | |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
63 echo "***** Building Windows binaries *****" |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
64 function winbuild |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
65 { # obj dir is winobj. -op = don't strip paths from obj files. |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
66 wine ~/bin/dmd.exe -odwinobj -op -ofdil $* $SRC_FILES |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
67 } |
450 | 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. | |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
81 rm -rf $FRESH_REPOS |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
82 hg archive -r tip -t files $FRESH_REPOS |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
83 cp -r $FRESH_REPOS/trunk/* $DEST |
450 | 84 |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
85 cp $FRESH_REPOS/trunk/src/config.d $DEST/bin/ |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
86 cp $FRESH_REPOS/trunk/src/lang_*.d $DEST/bin/ |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
87 cp $FRESH_REPOS/trunk/src/*_map.d $DEST/bin/ |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
88 cp $FRESH_REPOS/trunk/src/*.css $DEST/bin/ |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
89 cp $FRESH_REPOS/trunk/src/predefined.ddoc $DEST/bin/ |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
90 cp $FRESH_REPOS/trunk/src/html.css $HTMLSRC |
450 | 91 |
92 # Build archives | |
93 # tar.gz doesn't compress well | |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
94 tar --owner root --group root -czf $DEST.tar.gz $DEST |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
95 tar --owner root --group root --bzip2 -cf $DEST.tar.bz2 $DEST |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
96 zip -q -9 -r $DEST.zip $DEST |