-
Notifications
You must be signed in to change notification settings - Fork 3
/
eclipse-install-plugins
executable file
·321 lines (287 loc) · 11.8 KB
/
eclipse-install-plugins
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
#!/bin/bash
ECLIPSE_FLAVOUR=$1
ACTION=$2
ECLIPSE_VERSION=2023-03
RELEASE=R
#INCUBATION_FLAG=-incubation
INCUBATION_FLAG=
MIRROR=https://ftp.snt.utwente.nl/pub/software/eclipse/technology/epp/downloads/release
if [ -z "$ECLIPSE_FLAVOUR" ]; then
echo You need to specify which Eclipse flavour you want.
exit 1
fi
if [ -z "$ACTION" ]; then
echo 'You need to specify what action you want (list, install).'
exit 1
fi
if [ -e /etc/os-release ]; then
. /etc/os-release
fi
if [ -e /etc/lsb-release ]; then
. /etc/lsb-release
fi
if [ -z "$DISTRIB_ID" ]; then
DISTRIB_ID=$ID
fi
if [ "$OS" = "Windows_NT" ] || ! sudo -l > /dev/null; then
DISTRIB_ID="eclipseproject"
fi
if [ "$DISTRIB_ID" = "rhel" ]; then
MAJOR_VERSION=$(printf %.0f "$VERSION_ID")
if [ $MAJOR_VERSION -ge 8 ]; then
sudo dnf module enable eclipse
sudo yum install eclipse
else
if [ -e /opt/rh/rh-eclipse/enable ]; then
. scl_source enable rh-eclipse
else
sudo yum install rh-eclipse
. scl_source enable rh-eclipse
fi
fi
fi
if [ "$DISTRIB_ID" = "fedora" ] && [ ! "$VERSION_ID" = 30 ] && ! [ -x "$(command -v eclipse)" ]; then
sudo dnf install eclipse eclipse-egit eclipse-anyedit eclipse-subclipse eclipse-findbugs eclipse-m2e-core eclipse-checkstyle eclipse-tm-terminal eclipse-eclemma eclipse-m2e-wtp eclipse-m2e-buildhelper eclipse-m2e-maven-dependency-plugin
fi
if [ "$DISTRIB_ID" = "Ubuntu" ] && ! dpkg -s libgtk-3-0 > /dev/null 2>&1; then
sudo apt install libgtk-3-0
fi
if ! [ -x "$(command -v eclipse)" ]; then
if [ -z "$ECLIPSE_HOME" ]; then
echo "Please set ECLIPSE_HOME to your Eclipse installation"
exit 1
else
PATH=$PATH:$ECLIPSE_HOME
DISTRIB_ID=eclipseproject
if [ ! -e "$ECLIPSE_HOME"/eclipse ] && [ ! -e "$ECLIPSE_HOME"/eclipse.exe ]; then
mkdir -p "$ECLIPSE_HOME"
case $ECLIPSE_FLAVOUR in
"java")
ECLIPSE_FLAVOUR_DOWNLOAD=jee
INCUBATION=${INCUBATION_FLAG}
;;
"liclipse")
ECLIPSE_FLAVOUR_DOWNLOAD=javascript
INCUBATION=${INCUBATION_FLAG}
;;
"cpp")
ECLIPSE_FLAVOUR_DOWNLOAD=cpp
INCUBATION=${INCUBATION_FLAG}
;;
esac
if [ `uname -o` = "Cygwin" ]; then
wget --output-document=- "$MIRROR"/"$ECLIPSE_VERSION"/"$RELEASE"/eclipse-"$ECLIPSE_FLAVOUR_DOWNLOAD"-"$ECLIPSE_VERSION"-"${RELEASE}"${INCUBATION}-win32-x86_64.zip|bsdtar -xvf- --directory "$ECLIPSE_HOME" --strip-components=1
find "$ECLIPSE_HOME" -name "*.dll" -exec chmod +x {} \;
find "$ECLIPSE_HOME" -name "*.exe" -exec chmod +x {} \;
else
wget --output-document=- "$MIRROR"/"$ECLIPSE_VERSION"/"$RELEASE"/eclipse-"$ECLIPSE_FLAVOUR_DOWNLOAD"-"$ECLIPSE_VERSION"-"${RELEASE}"${INCUBATION}-linux-gtk-x86_64.tar.gz|tar xvzf - --directory "$ECLIPSE_HOME" --strip-components=1
fi
sed -i 's/-Xms.*/-Xms1g/' "${ECLIPSE_HOME}"/eclipse.ini
sed -i 's/-Xmx.*/-Xmx4g/' "${ECLIPSE_HOME}"/eclipse.ini
wget https://github.com/google/google-java-format/releases/download/google-java-format-1.6/google-java-format-eclipse-plugin_1.6.0.jar -O "${ECLIPSE_HOME}"/dropins/google-java-format-eclipse-plugin.jar
fi
fi
fi
if [ $ECLIPSE_FLAVOUR = "java" ]; then
if [ $DISTRIB_ID = "eclipseproject" ]; then
wget https://projectlombok.org/downloads/lombok.jar -O "${ECLIPSE_HOME}"/lombok.jar
echo '-javaagent:lombok.jar' >> "${ECLIPSE_HOME}"/eclipse.ini
else
mkdir -p ${HOME}/.eclipse
wget https://projectlombok.org/downloads/lombok.jar -O ${HOME}/.eclipse/lombok.jar
rm -r ${HOME}/.eclipse/eclipse.ini
if [ -e /usr/lib/eclipse/eclipse.ini ]; then
cp /usr/lib/eclipse/eclipse.ini ${HOME}/.eclipse/
else
echo "Please enhance the script for your system's eclipse.ini path"
exit 1
fi
sed -i 's/-Xms.*/-Xms1g/' ${HOME}/.eclipse/eclipse.ini
sed -i 's/-Xmx.*/-Xmx4g/' ${HOME}/.eclipse/eclipse.ini
echo -javaagent:${HOME}/.eclipse/lombok.jar >> ${HOME}/.eclipse/eclipse.ini
mkdir -p ${HOME}/bin
rm ${HOME}/bin/eclipse
echo `which eclipse` --launcher.ini ~/.eclipse/eclipse.ini '$@' > ${HOME}/bin/eclipse
chmod +x ${HOME}/bin/eclipse
fi
fi
if [ -z "$DISTRIB_ID" ]; then
echo "No distribution found"
exit 1
fi
M2EAXISTOOLS_REPO=https://theit.github.io/m2e-lifecycle-axistools
M2EEXTRAS_REPO=https://repository.sonatype.org/content/repositories/forge-sites/m2e-extras/0.15.0/N/0.15.0.201206251206/
M2EMAVENDEV_REPO=https://repo1.maven.org/maven2/.m2e/connectors/mavendev/0.5.0/N/LATEST/
SONARLINT_REPO=https://eclipse.sonarlint.org/
CUCUMBER_REPO=https://cucumber.github.io/cucumber-eclipse/update-site
DBEAVER_REPO=https://dbeaver.io/update/latest/
ORACLE_REPO=https://download.oracle.com/otn_software/oepe/12.2.1.6/oxygen/repository
MOREUNIT_REPO=https://moreunit.github.io/eclipse-update-site/
CSVEDIT_REPO=https://raw.githubusercontent.com/SegFaultError/CsvEdit/master/csvedit.update/
DECOMPILER_REPO=https://ecd-plugin.github.io/update
M2EJAXWS_REPO=https://coderplus.github.io/m2e-connector-for-jaxws-maven-plugin/
NODECLIPSE_REPO=https://nodeclipse.github.io/updates/
ENCODING_REPO=https://cypher256.github.io/eclipse-encoding-plugin/
ECLEMMA_REPO=http://update.eclemma.org/
EDITORCONFIG_REPO=https://editorconfig-eclipse.github.io/repository
M2E_DEPENCENDY_PLUGIN_REPO=https://ianbrandt.github.io/m2e-maven-dependency-plugin/
ANYEDIT_REPO=https://raw.githubusercontent.com/iloveeclipse/plugins/latest/
JSON_REPO=https://boothen.github.io/Json-Eclipse-Plugin/
CHECKSTYLE_REPO=https://checkstyle.org/eclipse-cs-update-site
JENERATE_REPO=https://maximeaudrain.github.io/update/
# e(fx)eclipse requires Xtext
EFXCLIPSE_REPO=https://download.eclipse.org/efxclipse/runtime-nightly/site,http://download.eclipse.org/efxclipse/updates-nightly/site
BASHEDITOR_REPO=https://de-jcup.github.io/update-site-eclipse-bash-editor/update-site
ASCIIDOCTOREDITOR_REPO=https://de-jcup.github.io/update-site-eclipse-asciidoctor-editor/update-site/
LICLIPSE_REPO=https://www.liclipse.com/text/updates
PYDEV_REPO=https://www.pydev.org/updates
DLTK_REPO=https://download.eclipse.org/technology/dltk/updates-dev/latest/
CMAKE4E_REPO=https://raw.githubusercontent.com/15knots/cmake4eclipse/master/releng/comp-update/
CMAKEED_REPO=https://raw.githubusercontent.com/15knots/cmakeed/master/cmakeed-update/
# https://github.com/spring-projects/sts4/wiki/Installation
#SPRINGIDE_REPO=https://download.springsource.com/release/TOOLS/sts4/update/e4.23/
case $ECLIPSE_FLAVOUR in
"java")
REPOSITORIES=\
$M2EAXISTOOLS_REPO,\
$M2EEXTRAS_REPO,\
$M2EJAXWS_REPO,\
$SONARLINT_REPO,\
$DBEAVER_REPO,\
$ORACLE_REPO,\
$MOREUNIT_REPO,\
$CSVEDIT_REPO,\
$DECOMPILER_REPO,\
$ENCODING_REPO,\
$EDITORCONFIG_REPO,\
$JSON_REPO,\
$JENERATE_REPO,\
$EFXCLIPSE_REPO,\
$BASHEDITOR_REPO.\
$ASCIIDOCTOREDITOR_REPO
#$M2EMAVENDEV_REPO,\
#$CUCUMBER_REPO,\
if [ ! "$DISTRIB_ID" = "rhel" ] || [ ! "$MAJOR_VERSION" -gt 7 ]; then
ECLIPSE_REPO=https://download.eclipse.org/releases/"$ECLIPSE_VERSION"
REPOSITORIES=$ECLIPSE_REPO,$REPOSITORIES
fi
INSTALLIUS=\
de.theit.m2e.axistools.feature.feature.group,\
org.sonarlint.eclipse.feature.feature.group,\
org.jkiss.dbeaver.runtime.feature.feature.group,\
org.moreunit.feature.group,\
org.fhsolution.eclipse.feature.csvedit.feature.group,\
org.sf.feeling.decompiler.feature.group,\
eclipse.encoding.plugin.feature.feature.group,\
editorconfig-eclipse-feature.feature.group,\
jsonedit-feature.feature.group,\
org.jenerate.feature.feature.group,\
de.jcup.basheditor.feature.group,\
de.jcup.asciidoctoreditor.feature.group
INSTALLIUS_NA=com.ifedorenko.m2e.mavendev.feature.feature.group,cucumber.eclipse.feature.feature.group
if [ -x "$(command -v svn)" ]; then
if [ "$DISTRIB_ID" != "fedora" ]; then
SUBCLIPSE_REPO=https://dl.bintray.com/subclipse/releases/subclipse/latest/
REPOSITORIES=$REPOSITORIES,$SUBCLIPSE_REPO
INSTALLIUS=$INSTALLIUS,org.tigris.subversion.subclipse.feature.group
if [ "$OS" = "Windows_NT" ]; then
INSTALLIUS=$INSTALLIUS,org.tigris.subversion.clientadapter.javahl.feature.feature.group
fi
fi
else
echo 'You do not have any svn binary in your path, so I am skipping Subclipse.'
fi
if { [ ! "$DISTRIB_ID" = "rhel" ] && [ ! "$MAJOR_VERSION" -gt 7 ]; } && [ ! "$DISTRIB_ID" = "fedora" ]; then
# These are packaged on RHEL and Fedora
INSTALLIUS=$INSTALLIUS,org.sonatype.m2e.buildhelper.feature.feature.group
fi
if [ ! "$DISTRIB_ID" = "fedora" ]; then
# These are packaged on Fedora
REPOSITORIES=$REPOSITORIES,\
$CHECKSTYLE_REPO,\
$M2E_DEPENCENDY_PLUGIN_REPO,\
$ANYEDIT_REPO
INSTALLIUS=$INSTALLIUS,\
net.sf.eclipsecs.feature.group,\
com.ianbrandt.tools.m2e.mdp.feature.feature.group,\
AnyEditTools.feature.group
fi
if [ "$DISTRIB_ID" = "rhel" ]; then
# included with the distribution and with Fedora, not packaged on RHEL
REPOSITORIES=$REPOSITORIES,$ECLEMMA_REPO
INSTALLIUS=$INSTALLIUS,org.eclipse.eclemma.feature.feature.group
# if [ "$MAJOR_VERSION" -gt 7 ]; then
# INSTALLIUS=$INSTALLIUS,org.eclipse.m2e.feature.feature.group
# fi
fi
# The version in RHEL8 is too old for this, TODO: implement version detection.
if [ ! "$DISTRIB_ID" = "rhel" ] || [ ! "$MAJOR_VERSION" -gt 7 ]; then
# Hibernate plug-in comea from the JBoss repo
JBOSS_REPO=https://download.jboss.org/jbosstools/photon/stable/updates/
REPOSITORIES=$REPOSITORIES,$JBOSS_REPO
INSTALLIUS=$INSTALLIUS,org.jboss.tools.cdi.feature.feature.group,org.eclipse.fx.ide.feature.feature.group
if [ "$DISTRIB_ID" != "eclipseproject" ]; then
INSTALLIUS=$INSTALLIUS,org.hibernate.eclipse.feature.feature.group
fi
DIRECTORYSTUDIO_REPO=https://directory.apache.org/studio/update/
REPOSITORIES=$REPOSITORIES,$DIRECTORYSTUDIO_REPO
# TODO missing javax.xml.stream [1.0.0,2.0.0)
INSTALLIUS=$INSTALLIUS,org.apache.directory.studio.ldapbrowser.feature.feature.group
QWICKIE_REPO=https://raw.githubusercontent.com/count-negative/qwickie/master/qwickie.updatesite/site.xml
REPOSITORIES=$REPOSITORIES,$QWICKIE_REPO
# TODO missing org.eclipse.wst.sse.core 0.0.0
INSTALLIUS=$INSTALLIUS,qwickie.feature.feature.group
fi
# sapphire too old
#INSTALLIUS_DEPS_NA=oracle.eclipse.tools.database.feature.group
#INSTALLIUS_SITE_NA=zipeditor.feature.group
;;
"liclipse")
REPOSITORIES=$LICLIPSE_REPO,\
$PYDEV_REPO,\
$ENCODING_REPO,\
$EDITORCONFIG_REPO,\
$ANYEDIT_REPO
INSTALLIUS=org.brainwy.liclipsetext.feature.feature.group,\
org.python.pydev.feature.feature.group,\
eclipse.encoding.plugin.feature.feature.group,\
editorconfig-eclipse-feature.feature.group,\
AnyEditTools.feature.group
;;
"cpp")
REPOSITORIES=$LICLIPSE_REPO,\
$DLTK_REPO,\
$NODECLIPSE_REPO,\
$ENCODING_REPO,\
$CMAKE4E_REPO,\
$CMAKEED_REPO
INSTALLIUS=org.brainwy.liclipsetext.feature.feature.group,\
eclipse.encoding.plugin.feature.feature.group,\
de.marw.cdt.cmake.feature.group,\
com.cthing.cmakeed.feature.feature.group
;;
esac
if [ -e ${HOME}/bin/eclipse ]; then
PATH=${HOME}/bin:${PATH}
fi
COMMAND="eclipse -clean -purgeHistory -application org.eclipse.equinox.p2.director -noSplash -repository $REPOSITORIES"
case $ACTION in
"list")
ACTION=-list
;;
"install")
ACTION="-installIUs $INSTALLIUS"
;;
esac
[ -n "$ECLIPSE_HOME" ] && pushd $ECLIPSE_HOME
$COMMAND $ACTION
# Lombok
lombok()
{
if [ ! -e /opt/rh/rh-eclipse46/root/usr/local/lib/java/lombok.jar ]; then
sudo mkdir -p /opt/rh/rh-eclipse46/root/usr/local/lib/java
sudo wget https://projectlombok.org/downloads/lombok.jar -O /opt/rh/rh-eclipse46/root/usr/local/lib/java/lombok.jar
sudo ln -s /opt/rh/rh-eclipse46/root/usr/local/lib/java/lombok.jar /opt/rh/rh-eclipse46/root/lib64/eclipse/
echo '-javaagent:/opt/rh/rh-eclipse46/root/usr/local/lib/java/lombok.jar' | sudo tee -a /opt/rh/rh-eclipse46/root/etc/eclipse.ini
fi
}