-
Notifications
You must be signed in to change notification settings - Fork 0
/
eclipse
87 lines (70 loc) · 3.13 KB
/
eclipse
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
#!/bin/bash
ECLIPSE_LOC=~/bin/eclipse-bs/
export SLOBER_LOC=$ECLIPSE_LOC
SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if (! test -e ~/bin) then
mkdir ~/bin
fi
if ! [ "$SCRIPT" = "$HOME/bin" ]; then
echo "Script source copied to ~/bin from " $SCRIPT
cp $SCRIPT/eclipse ~/bin/eclipse
chmod +x ~/bin/eclipse
fi
if (! test -e ~/bin/Eclipse-BS.desktop) then
echo "[Desktop Entry]
Version=1.0
Type=Application
Name=Eclipse Bowlerstudio
Comment=
Exec=$HOME/bin/eclipse
Icon=$HOME/bin/eclipse-bs/eclipse/icon.xpm
Path=
Terminal=false
StartupNotify=false" > ~/bin/Eclipse-BS.desktop
chmod +x ~/bin/Eclipse-BS.desktop
gio set ~/bin/Eclipse-BS.desktop "metadata::trusted" yes
ln -s ~/bin/Eclipse-BS.desktop ~/Desktop/Eclipse-BS.desktop
gio set ~/Desktop/Eclipse-BS.desktop "metadata::trusted" yes
pkexec desktop-file-install ~/bin/Eclipse-BS.desktop
sync
fi
if (! test -e $ECLIPSE_LOC) then
if (! test -e ~/bin/eclipse-linux-sloeber-groovy.zip ) then
echo "Downloading Eclipse Zip"
wget https://github.com/CommonWealthRobotics/ESP32ArduinoEclipseInstaller/releases/download/0.0.0/eclipse-linux-sloeber-groovy.zip -O ~/bin/eclipse-linux-sloeber-groovy.zip
fi
echo "Extracting Eclipse"
unzip ~/bin/eclipse-linux-sloeber-groovy.zip -d $SLOBER_LOC
for val in $StringVal; do
LIBCHECK=$SLOBER_LOC/eclipse/arduinoPlugin/libraries/$val
if ( test -e $LIBCHECK) then
echo $LIBCHECK To Be Erased
rm -rf $LIBCHECK
fi
done
grep -v "osgi.instance.area.default" $SLOBER_LOC/eclipse/configuration/config.ini > ~/bin/config.ini
echo "osgi.instance.area.default=$HOME/bowler-workspace/eclipse" >>~/bin/config.ini
cp ~/bin/config.ini $SLOBER_LOC/eclipse/configuration/
grep -v "RECENT_WORKSPACES=" $SLOBER_LOC/eclipse/configuration/.settings/org.eclipse.ui.ide.prefs > ~/bin/org.eclipse.ui.ide.prefs
echo "RECENT_WORKSPACES=$HOME/bowler-workspace/eclipse" >>~/bin/org.eclipse.ui.ide.prefs
cp ~/bin/org.eclipse.ui.ide.prefs $SLOBER_LOC/eclipse/configuration/.settings/
grep -v "Dosgi.instance.area.default" $SLOBER_LOC/eclipse/eclipse.ini > ~/bin/eclipse.ini
echo "[email protected]/bowler-workspace/eclipse" >>~/bin/eclipse.ini
cp ~/bin/eclipse.ini $SLOBER_LOC/eclipse/
File=$SLOBER_LOC/eclipse/arduinoPlugin/packages/esp32/hardware/esp32/1.0.4/platform.txt
TOOLROOT=$SLOBER_LOC/eclipse/arduinoPlugin/packages/esp32/tools/xtensa-esp32-elf-gcc/
TOOLROOT_PY=$SLOBER_LOC/eclipse/arduinoPlugin/packages/esp32/tools/esptool_py/
VERSIO_PY=$(ls $TOOLROOT_PY)
echo -e "tools.esptool_py.runtime.tools.esptool_py.path=$TOOLROOT_PY/$VERSIO_PY \n$(cat $File)" >$File
VERSION=$(ls $TOOLROOT)
echo $VERSION
echo -e "runtime.tools.xtensa-esp32-elf-gcc.path=$TOOLROOT/$VERSION \n$(cat $File)" >$File
rsync -avtP $SLOBER_LOC/eclipse/arduinoPlugin/packages/* ~/.arduino15/packages/
# Replace the mbedtls definition so it commpiles
sed -i 's/"mbedtls\/esp_config.h"/\\"mbedtls\/esp_config.h\\"/g' $File
# clear stale temp sloeber files
fi
cd $SLOBER_LOC; grep -RiIl 'hephaestus' .| xargs sed -i "s/hephaestus/$USER/g"
export WEBKIT_DISABLE_DMABUF_RENDERER=1
#Run SLoeber
$SLOBER_LOC/eclipse/eclipse "$@"