-
Notifications
You must be signed in to change notification settings - Fork 3
/
prep.sh
140 lines (108 loc) · 5.48 KB
/
prep.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
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
136
137
138
139
140
#!/bin/bash
START=$PWD
VERSION=$1
DIR=rbe-inst
OUTDIR=rbe-inst-output
INST=$OUTDIR/WPI-RBE-esp32-$VERSION.exe
INSTLAB=$OUTDIR/WPI-RBE-esp32-LAB-$VERSION.exe
INSTDIR=rbe-inst-iss
unzipifiy(){
testget $1
echo "Unzipping $1 to $2"
unzip -qq $1 -d $2
}
testget () {
if [ -f $1 ]; then
echo "$1 exist"
else
wget https://github.com/WPIRoboticsEngineering/ESP32ArduinoEclipseInstaller/releases/download/0.0.0/$1
fi
}
testlink () {
if (! test -e $1) then
mkdir $1
fi
if (! test -e $HOME/.wine/drive_c/$1) then
echo "Linking build dirs for wine $1"
ln -s $2/$1 $HOME/.wine/drive_c/
fi
}
if (! test -z "$VERSION" ) then
if (! test -e $DIR) then
echo "Making install dir $DIR"
mkdir $DIR
mkdir $DIR/gitRbe/
unzipifiy driver.zip $DIR
unzipifiy WorkingDirectories.zip $DIR
unzipifiy sloeber.zip $DIR
unzipifiy arduino-1.8.5.zip $DIR
unzipifiy doxygen.zip $DIR
unzipifiy graphviz.zip $DIR
fi
testlink $DIR $START
testlink $OUTDIR $START
testlink $INSTDIR $START
cp LICENSE.txt $DIR
cp sloeber.ico $DIR/sloeber/
java -Xmx8g -jar GithubPublish.jar ESP32ArduinoEclipseInstaller WPIRoboticsEngineering $VERSION linux-eclipse-esp32.sh
if (! test -e $INST) then
rm -rf $INSTDIR/run.iss
cp TEMPLATErbeArduinoEclipseInstaller.iss $INSTDIR/run.iss
sed -i s/VER/"$VERSION"/g $INSTDIR/run.iss
if (! test -e $DIR/sloeber/configuration/.settings/) then
mkdir -p $DIR/sloeber/configuration/.settings/
fi
#Remove files with non-ascii names, cause installer to fail
LC_ALL=C find rbe-inst/ -name '*[! -~]*' | xargs -n1 rm
#cp org.eclipse.ui.ide.prefs $DIR/sloeber/configuration/.settings/
grep -v "osgi.instance.area.default" rbe-inst/sloeber/configuration/config.ini > config.ini
echo "osgi.instance.area.default=C\:\\\\RBE\\\\eclipse-workspace" >>config.ini
cp config.ini $DIR/sloeber/configuration/
grep -v "RECENT_WORKSPACES=" ./rbe-inst/sloeber/configuration/.settings/org.eclipse.ui.ide.prefs > org.eclipse.ui.ide.prefs
echo "RECENT_WORKSPACES=C\:\\\\RBE\\\\eclipse-workspace" >>org.eclipse.ui.ide.prefs
cp org.eclipse.ui.ide.prefs ./rbe-inst/sloeber/configuration/.settings/
sed 's/F\\\:\\\\rbe-inst/C\\\:\\\\RBE/g' ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/io.sloeber.core.ui.prefs > io.sloeber.core.ui.prefs
cp io.sloeber.core.ui.prefs ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
sed 's/F\\\:\\\\rbe-inst/C\\\:\\\\RBE/g' ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/io.sloeber.arduino.prefs > io.sloeber.arduino.prefs
cp io.sloeber.arduino.prefs ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
sed 's/R\\\:\\\\RBE\\\\ArduinoSketchbook/C\\\:\\\\RBE\\\\ArduinoSketchbook/g' ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/io.sloeber.core.ui.prefs > io.sloeber.core.ui.prefs
cp io.sloeber.core.ui.prefs ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
sed 's/R\\\:\\\\RBE\\\\ArduinoSketchbook/C\\\:\\\\RBE\\\\ArduinoSketchbook/g' ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/io.sloeber.arduino.prefs > io.sloeber.arduino.prefs
cp io.sloeber.arduino.prefs ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
cp preferences.txt $DIR/arduino-1.8.5/lib/
chmod -R 7777 $DIR/eclipse-workspace/
echo Running wine C:\$INSTDIR\run.iss
if ( wine "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" /cc "c:\rbe-inst-iss\run.iss") then
echo wine ok
else
testget isetup-5.4.3.exe
wine isetup-5.4.3.exe
exit 1
fi
fi
testget GithubPublish.jar
java -Xmx8g -jar GithubPublish.jar ESP32ArduinoEclipseInstaller WPIRoboticsEngineering $VERSION $INST
if (! test -e $INSTLAB) then
rm -rf $INSTDIR/runWPI.iss
cp rbe/TEMPLATErbeArduinoEclipseInstaller.iss $INSTDIR/runWPI.iss
sed 's/C\\\:\\\\RBE\\\\ArduinoSketchbook/R\\\:\\\\RBE\\\\ArduinoSketchbook/g' ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/io.sloeber.core.ui.prefs > io.sloeber.core.ui.prefs
cp io.sloeber.core.ui.prefs ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
sed 's/C\\\:\\\\RBE\\\\ArduinoSketchbook/R\\\:\\\\RBE\\\\ArduinoSketchbook/g' ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/io.sloeber.arduino.prefs > io.sloeber.arduino.prefs
cp io.sloeber.arduino.prefs ./rbe-inst/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
grep -v "osgi.instance.area.default" rbe-inst/sloeber/configuration/config.ini > rbe/config.ini
echo "osgi.instance.area.default=R\:\\\\RBE\\\\eclipse-workspace" >>rbe/config.ini
cp rbe/config.ini $DIR/sloeber/configuration/
grep -v "RECENT_WORKSPACES=" ./rbe-inst/sloeber/configuration/.settings/org.eclipse.ui.ide.prefs > org.eclipse.ui.ide.prefs
echo "RECENT_WORKSPACES=R\:\\\\RBE\\\\eclipse-workspace" >>org.eclipse.ui.ide.prefs
cp org.eclipse.ui.ide.prefs ./rbe-inst/sloeber/configuration/.settings/
cp rbe/preferences.txt $DIR/arduino-1.8.5/lib/
sed -i s/VER/"$VERSION"/g $INSTDIR/runWPI.iss
echo Running wine C:\$INSTDIR\run.iss
if ( wine "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" /cc "c:\rbe-inst-iss\runWPI.iss") then
echo wine ok
else
exit 1
fi
fi
java -Xmx8g -jar GithubPublish.jar ESP32ArduinoEclipseInstaller WPIRoboticsEngineering $VERSION $INSTLAB
fi