Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 93 lines (74 sloc) 2.428 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
#!/bin/bash

eclipse_dir="/Applications/Programming/eclipse-helios/"
eclipse_opt="-nosplash -consoleLog"
app="org.eclipse.equinox.p2.director"

eclipse_repo="http://download.eclipse.org/releases/helios/"
branch="master"
scala_repo="http://scala-ide.dreamhosters.com/nightly-update"

function usage()
{
    cat <<EOF
`basename $0` [opt] command [pluginid]

Options:
--eclipse-dir <path> Path to the Eclipse installation that you want to modify

Commands:
list List available plugins. (useless right now, as it uses the Eclipse repo).

install <id> Install plugin. It is the version number of the Scala installation
For instance: 2.9.1.final or trunk

uninstall Uninstall the currently installed Scala plugin

uninstall-bundle <id> Uninstall the given bundle

help Print this help screen

EOF
    exit 1
}

while [ $# -gt 0 ]; do

    case $1 in
        "" | "help")
            usage
            ;;

        "--eclipse-dir")
            eclipse_dir=$2
            echo "Eclipse installation dir is $eclipse_dir"
            shift 2
            ;;

        "--branch")
            branch=$2
            echo "Eclipse repository is $scala_repo-$branch-?"
            shift 2
            ;;

        "list")
            $eclipse_dir/eclipse $eclipse_opt \
                -application $app \
                -repository $eclipse_repo \
                -list
            shift
            ;;

        "install")
            echo "Installing $2.."
            $eclipse_dir/eclipse $eclipse_opt \
                -application $app \
                -repository "$scala_repo-$branch-$2" \
                -installIU org.scala-ide.sdt.feature.feature.group
            shift 2
            ;;

        "uninstall")
            echo "Unnstalling.."
            shift 1
            $eclipse_dir/eclipse $eclipse_opt \
                -application $app \
                -repository "$eclipse_repo" \
                -uninstallIU org.scala-ide.sdt.feature.feature.group
            ;;

        "uninstall-bundle")
            echo "Unnstalling.. $2"
            $eclipse_dir/eclipse $eclipse_opt \
                -application $app \
                -repository "$eclipse_repo" \
                -uninstallIU $2
            shift 2
            ;;

        *)
            usage
            ;;
    esac
done
Something went wrong with that request. Please try again.