Labs Setup

This page contains instructions on how to set up your computer such that you can:

  • program your assignments,
  • share them with your teammate via a version control system,
  • submit your labs for grading, and
  • use our black-box testing system.

Programming in Scala using Eclipse

You are by no means required to use an IDE. If you wish to do so, we recommend that you use Eclipse with the Scala plug-in. (Another good IDE for Scala is Intellij IDEA, but we do not provide detailed instructions.)

Installing Eclipse and the Scala plug-in.

  1. From the Eclipse downloads page, get Eclipse Classic 3.7 for your system.
  2. To install it, simply uncompress the archive in a directory of your choosing. There is no installer, uncompressing is enough.
  3. Launch Eclipse (your version should be called Indigo).
  4. Go to Help→Install New Software…
  5. Click Add… to add a software repository.
  6. Use as the Location and, e.g., “Scala plug-in repository” as the Name.
  7. In the list of packages that appears, select all three. Click Next> twice, accept the license and click Finish. (Click Ok if during installation you get a warning about content not being signed.)

Creating a Public/Private Key Pair and Registering your Group

All labs will be done in pairs. We have set up a version control system around Git, which you will use to share your project code with your partner, but also to submit your labs. Authentication to this service works by using a SSH key. If you do not already have a private/public key combination for your computer, follow these instructions. Note that you typically generate one key pair per computer that you use.

Once all member of the group have created a key pair, go to and follow the instructions there (Tequila authentication required.)

From within Eclipse

  1. Go to Window→Preferences→General→Network Connections→SSH2.
  2. In Key Management, click Generate RSA Key….
  3. The text blob that appears in the same window is your public key. You will need to copy-paste this blob when you register with our webservice, so save it somewhere.
  4. Click Save Private Key… (use a passphrase if you want to, but it is not required). The default location should be correct.
  5. You should now be all set to connect to our Git repository and to push your changes to the server.

From the Command Line

  1. Type ssh-keygen -t rsa -b 1024.
  2. Type enter to save it in the default location.
  3. Choose a passphrase, or type enter to ignore it.
  4. Your public key is now stored in a file (typically, in ~/.ssh/ You will need to copy-paste the content of this file into our webservice.

Using Git as a Version Control System

Installing the EGit plugin for Eclipse:

  1. Go to Help→Install New Software…
  2. In the Work with menu, choose the Indigo repository.
  3. Use the filter box to find the Eclipse EGit package, select it and install it.

Once we have created a Git repository for you:

  1. Go to File→Import→Git→Projects from Git
  2. Click Clone…. In the window, enter the URI you have received from us. The fields “Host” and “Repository path” should then be automatically completed. Don't select anything for the other fields. User should be “git” and password should be empty.
  3. The following steps depend on whether you are the first of your group to check out the project or not.
    • If you are the first: a “Branch Selection” window should open with a warning message saying “Source Git Repository is empty”. Click Next>.
    • If you are not the first: a “Branch Selection” window should open. Choose master.
  4. The next window asks you where to save the local copy of the repository. The default option should be good (probably “~/git/reposname”), but feel free to change it.
  5. You have now cloned the repository. Select it from the list and click Next>.

If you are the first to commit to the server

  1. Choose Use the New Projects wizard.
  2. From the wizard, choose Scala Wizards→Scala Project. Choose a meaningful name (e.g. “whilelang” for the first lab, or “toolc” for the semester-long project). All other options should be OK by default. Click Finish.
  3. You can now add source files. For instance, create the whilelang package in src and add the stub files from the first lab.

Somehow counter-intuitively, the project is not yet ready for pushing changes to the server:

  1. Right-click on the project, then select Team→Share Project.
  2. Choose Git, then in the Repository menu, choose the one you created a few steps ago, and click Finish.
  3. Go now to Window→Show View→Navigator. You should see little question marks on the .settings directory, .classpath, etc.
  4. This is an important step: for each of .settings, src, .classpath and .project (but not bin or .scala_dependencies), right-click the file and select Team→Add.
  5. Right-click the project name again and select Team→Commit. Enter some message, such as “first commit.” and click Commit.
  6. If you are used to using SVN, you may think this just pushed the changes to the server. It did not. To push the changes, right-click on the project and select Team→Push to Upstream.
  7. You should see “[new branch]” in the status column. Click OK.
  8. That's it.

If you are not the first to commit to the server

  1. Choose Import Existing Projects, click Next>.
  2. Make sure that the right project is checked and click Finish.
  3. You have now imported the project. You may want to switch to the Scala perspective by selecting Window→Open Perspective→Other…→Scala.