diff --git a/build.sh b/build.sh index 58ec096..999de19 100755 --- a/build.sh +++ b/build.sh @@ -93,11 +93,28 @@ install_packages () { chmod +x $ECLIPSE_BIN_PATH fi + set -o pipefail $ECLIPSE_BIN_PATH -nosplash \ -application org.eclipse.equinox.p2.director \ -repository "$1" \ -installIU "$(parse_package_list $2)" \ | grep -v 'DEBUG' + set +o pipefail +} + +# Uninstalls a given list of packages. +uninstall_packages () { + if [[ "$OS" = "macos" ]]; then + chmod +x $ECLIPSE_BIN_PATH + fi + + set -o pipefail + $ECLIPSE_BIN_PATH -nosplash \ + -application org.eclipse.equinox.p2.director \ + -repository "$1" \ + -uninstallIU "$(parse_package_list $2)" \ + | grep -v 'DEBUG' + set +o pipefail } # Displays the given input including "=> " on the console. @@ -260,6 +277,13 @@ for p in ${ORDER[@]}; do log "Skipping plug-in: $p." continue fi + + # Check if Xtext (old version) must be uninstalled first. + if [[ "$p" = "xtext" ]]; then + log "Uninstalling plug-in: $p." + uninstall_packages "$UPDATESITES" "./packages/$p-uninstall-packages.list" + fi + log "Installing plug-in: $p." install_packages "$UPDATESITES" "./packages/$p-packages.list" done diff --git a/packages/xtext-uninstall-packages.list b/packages/xtext-uninstall-packages.list new file mode 100644 index 0000000..190205e --- /dev/null +++ b/packages/xtext-uninstall-packages.list @@ -0,0 +1,21 @@ +org.eclipse.xtend.sdk.feature.group +org.eclipse.xtext.docs.feature.group +org.eclipse.xtext.examples.feature.group +org.eclipse.xtext.redist.feature.group +org.eclipse.xtext.runtime.feature.group +org.eclipse.xtext.sdk.feature.group +org.eclipse.xtext.ui.feature.group +org.eclipse.xtext.xbase.feature.group +org.eclipse.xtext.xtext.ui.feature.group +org.eclipse.xtext.xtext.ui.graph.feature.group +org.eclipse.xtext.docs.feature.group +org.eclipse.xtext.examples.feature.group +org.eclipse.xtext.redist.feature.group +org.eclipse.xtext.runtime.feature.group +org.eclipse.xtext.sdk.feature.group +org.eclipse.xtext.ui.feature.group +org.eclipse.xtext.xbase.feature.group +org.eclipse.xtext.xbase.lib.feature.group +org.eclipse.xtext.xtext.ui.feature.group +org.eclipse.emf.mwe2.language.ui +org.eclipse.emf.mwe2.language.sdk.feature.group