-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathhost-package-release
More file actions
executable file
·136 lines (96 loc) · 2.91 KB
/
host-package-release
File metadata and controls
executable file
·136 lines (96 loc) · 2.91 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/bin/bash
# host-package-release -- Packages Reprap host software into a .zip file and .deb package
# init
MACHINE="mendel"
RELEASE=${1:-`date -u +%Y%m%d`}
RELEASENAME="reprap-$MACHINE-$RELEASE"
FILELIST="jar/reprap.jar lib/*.jar lib/mendel-base.stl lib/huxley-base.stl lib/rr-logo-green-url.png\
lib/reprap-icon.png lib/reprap.properties.dist lib/system-dependent/linux-i386/*\
lib/system-dependent/windows-i586/* lib/system-dependent/macosx/RepRap-Mac-Drivers.mpkg.zip\
lib/prologue.gcode lib/epilogue.gcode LICENSE"
SRCFILELIST="src/* build.xml build-user.xml .classpath .project \
host-package-release readme"
LIBFILES="lib/*"
# Where are all the other non-host-software files we need to include?
DESIGNFILES=""
#for i in ../$MACHINE ../electronics ../firmware
#do
# if [ -d "$i" ]
# then
# DESIGNFILES="$DESIGNFILES $i"
# elif [ -d ../"$i" ]
# then
# DESIGNFILES="$DESIGNFILES ../$i"
# else
# echo "ERROR: directory $i not found"
# exit 1
# fi
#done
CLASSPATH=$CLASSPATH:./lib/j3dcore.jar
CLASSPATH=$CLASSPATH:./lib/j3d-org-java3d-all.jar
CLASSPATH=$CLASSPATH:./lib/j3dutils.jar
CLASSPATH=$CLASSPATH:./lib/vecmath.jar
CLASSPATH=$CLASSPATH:./lib/RXTXcomm.jar
CLASSPATH=$CLASSPATH:./lib/swing-layout-1.0.3.jar
CLASSPATH=$CLASSPATH:.
export CLASSPATH
# Remove any old jar directory
[ -d jar ] && rm -rf jar
# Recompile java files and create Reprap.jar
ant clean jar || exit 1
#Delete any old release
rm -f "../release/*.zip"
BASENAME="../release/$RELEASENAME"
mkdir "$BASENAME"
SRCFILENAME="$BASENAME/src"
mkdir "$SRCFILENAME"
# Copy files into binary package directory
for F in $FILELIST
do
cp -rp $F "$BASENAME"
done
echo "Executable created."
# Copy README into package dir, substituting release string for RELEASE
# and the current UTC date for DATE
NOW=`date -u +'%d %B %Y'`
sed -e "s/RELEASE/$RELEASE/g" -e "s/DATE/$NOW/g" readme > "$BASENAME/readme"
# Create README.txt for Windows people
sed -e 's/$/\r/' readme > "$BASENAME/readme.txt"
echo "READMEs created."
# Now create the src archive
for F in $SRCFILELIST
do
cp -rp $F "$SRCFILENAME"
done
mkdir -p "$SRCFILENAME"/lib
for F in $LIBFILES
do
cp -rp $F "$SRCFILENAME"/lib
done
echo "Sources copied."
for F in $DESIGNFILES
do
cp -rp $F "$BASENAME"
done
#Remove local configuration files
rm -f "$BASENAME"/firmware/FiveD_GCode/Extruder/configuration.h
rm -f "$BASENAME"/firmware/FiveD_GCode/FiveD_GCode_Interpreter/configuration.h
echo "Design files copied."
# Omit all .git subdirs
cd "$BASENAME"
find . -type d -name .git |xargs rm -rf
cd ..
echo "Git references removed."
# Make sure executable permissions are right
chmod 755 "$RELEASENAME"/reprap
# Create zip archive
rm -f *.zip
zip -qr "$RELEASENAME.zip" "$RELEASENAME"
echo "Zip file created."
# Remove the lot that is now in the .zip file
rm -rf "$RELEASENAME"
cd ../host
# Remove any old jar directory
[ -d jar ] && rm -rf jar
cd ..
echo "RepRap Release $RELEASE created."