Mercurial > projects > dil
annotate release.sh @ 834:8bcf482b2062
Fix: corrected dil subcommand in release.sh.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Mon, 11 Aug 2008 19:14:28 +0200 |
parents | a3d1d5d5ce44 |
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"; |
834
8bcf482b2062
Fix: corrected dil subcommand in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
833
diff
changeset
|
47 ./dil hl --lines --syntax --html $filepath > "$HTMLSRC/$htmlfile"; |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
48 done |
450 | 49 |
834
8bcf482b2062
Fix: corrected dil subcommand in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
833
diff
changeset
|
50 # Linux Debug Binaries |
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 | |
834
8bcf482b2062
Fix: corrected dil subcommand in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
833
diff
changeset
|
56 # Linux Release Binaries |
8bcf482b2062
Fix: corrected dil subcommand in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
833
diff
changeset
|
57 # N.B.: the -inline switch makes the binaries significantly larger. |
450 | 58 dsss build -clean -full -release -O -inline -version=D2 |
59 cp dil $DEST/bin/dil2 | |
60 dsss build -clean -full -release -O -inline | |
61 cp dil $DEST/bin/dil | |
62 | |
63 if [ -s ~/bin/dmd.exe ]; then | |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
64 echo "***** Building Windows binaries *****" |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
65 function winbuild |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
66 { # 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
|
67 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
|
68 } |
834
8bcf482b2062
Fix: corrected dil subcommand in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
833
diff
changeset
|
69 # Windows Debug Binaries |
450 | 70 winbuild -version=D2 |
71 cp dil.exe $DEST/bin/dil2_d.exe | |
72 winbuild | |
73 cp dil.exe $DEST/bin/dil_d.exe | |
834
8bcf482b2062
Fix: corrected dil subcommand in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
833
diff
changeset
|
74 # Windows Release Binaries |
450 | 75 winbuild -release -O -inline -version=D2 |
76 cp dil.exe $DEST/bin/dil2.exe | |
77 winbuild -release -O -inline | |
78 cp dil.exe $DEST/bin/dil.exe | |
79 fi | |
80 | |
81 # Copy source and other files. | |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
82 rm -rf $FRESH_REPOS |
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
83 hg archive -r tip -t files $FRESH_REPOS |
833
a3d1d5d5ce44
Fixed paths in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
84 cp -r $FRESH_REPOS/* $DEST |
450 | 85 |
833
a3d1d5d5ce44
Fixed paths in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
86 cp $FRESH_REPOS/src/config.d $DEST/bin/ |
a3d1d5d5ce44
Fixed paths in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
87 cp $FRESH_REPOS/src/lang_*.d $DEST/bin/ |
a3d1d5d5ce44
Fixed paths in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
88 cp $FRESH_REPOS/src/*_map.d $DEST/bin/ |
a3d1d5d5ce44
Fixed paths in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
89 cp $FRESH_REPOS/src/*.css $DEST/bin/ |
a3d1d5d5ce44
Fixed paths in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
90 cp $FRESH_REPOS/src/predefined.ddoc $DEST/bin/ |
a3d1d5d5ce44
Fixed paths in release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
806
diff
changeset
|
91 cp $FRESH_REPOS/src/html.css $HTMLSRC |
450 | 92 |
93 # Build archives | |
94 # tar.gz doesn't compress well | |
793
b091e8b0ef5c
Fixed and improved release.sh.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
450
diff
changeset
|
95 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
|
96 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
|
97 zip -q -9 -r $DEST.zip $DEST |