-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
56 lines (48 loc) · 1.58 KB
/
release.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
#!/bin/sh
# PIPE2 release package builder
# This script is meant to be used in a directory containing a full CVS checkout
# of the PIPE2 project.
# If the script is invoked with an incorrect number of arguments, then an explaination
# of the usage is given and the script exits.
if [ $# -ne 1 ]
then
echo "Incorrect number of arguments."
echo "Usage: `basename $0` [release version number]"
echo "e.g. ./`basename $0` 2.5"
exit 65
fi
# All decimal points in the version number are replaced with dashes, and this is used
# to create the filename for the .zip package.
version_number=$1
version_number=${version_number/\./-}
package_filename="PipeV"$version_number
# Compiles PIPE2 to build/app/ using ant.
ant || {
echo "Cannot compile PIPE2 using Ant."
exit;
}
# Copies binaries to bin/ directory.
mkdir -p bin || {
echo "Error creating bin/ directory."
exit;
}
cp -r build/app/* bin || {
echo "Error copying PIPE2 build to bin/."
exit;
}
# Creates javadoc in docs/api/
javadoc -d docs/api/ -sourcepath src/ -subpackages pipe || {
echo "Cannot create javadoc."
exit;
}
# Creates release package from the contents of the bin, docs, Resources, src, test directories
# (ignoring directories named 'CVS') and the 2 readme files.
find bin docs Resources src test -type d -not -name "*CVS*" -exec zip -r $package_filename {} ';' || {
echo "Cannot create PIPE2 release .zip package."
exit;
}
zip -r $package_filename readme.dnamaca.txt readme.txt || {
echo "Cannot add readme files to PIPE2 release .zip package."
exit;
}
exit 0