Version 8, last updated by manojo at 12 Mar 06:57 UTC
Scala compiler development under Eclipse
This tutorial will show you how to set up the Scala IDE in Eclipse so you can use it to work on the Scala compiler:
- Download and install the latest stable Eclipse release from eclipse.org.
- Install the Scala IDE.
- In Eclipse go to Help -> Install New Software ... In "Work with:", put
- http://download.scala-ide.org/nightly-update-master-trunk (you need the nightly build of the Scala IDE)
- Click Add. Select All. Finish steps to install.
- Tweak the settings for eclipse.ini as discussed here: https://www.assembla.com/spaces/scala-ide/wiki/Setup
- Clone the scala git repository:
- git clone git://github.com/scala/scala.git
- cd scala
- cp project.SAMPLE .project
- cp classpath.SAMPLE .classpath
- ./pull-binary-libs.sh # to get the necessary libraries
- Now in Eclipse, import the scala project in your workspace:
- File -> Import ... Existing Projects into Workspace.
- Pick the scala trunk as the source directory.
- Finish.
- Add the reflection part of the scala library (Optional.)
- done in order to shield scala developers from the changes in the reflection part of the compiler and library
- go to Project > Properties
- Java Build Path
- Add Folder and select src/library
- Expand the newly created entry to show Excluded: (None) and double-click on it
- In the inclusion patterns part, click on Add (in the upper part of the window). Include scala/reflect
- In the exclusion patterns part, click on Add (in the lower part of the window). Insert '*'
- Finish, Ok
- now the latest reflection part of the library is overriding the ScalaIDE-supplied standard library
- Unselect Project -> Build Automatically. (Recommended.)
- If you get any errors, the first thing to do is update the Scala IDE:
- Help > Check for Software Updates
- if you still encounter problems, post a message to the scala-user mailing list.
- Make sure you have the right formatting style (or be ready to see pull requests rejected !). Click on Window->Preferences.
- Go to Java->Code Style->Formatter->Edit. In the General Settings, select Spaces Only for Tab Policy. Select Indentation and tab sizes of 2.
- Change the profile name and click ok.
- Go to General->Editors->Text Editors. Select the following options:
- Insert spaces for tabs
- Show print margin (120 characters)
- Show line numbers
- Show whitespace characters (click on it) and unselect everything but Tab (>>), This is useful to show when tabs have been inserted: you need to replace them with whitespaces.
Updating the Eclipse IDE with the latest compiler can also be done using command line tools (instead of Help > Check for updates and downloading the latest nightly)
Instructions were posted by Iulian on https://groups.google.com/group/scala-internals/browse_thread/thread/bec4e196a4efb45b/cf4dc2c106bc91b7