- Install JDK 1.6.0 or above (e.g. Sun JDK 6.0 version 1.6.0_19):
- JDK is available on http://java.sun.com/.
- Remember to set the JAVA_HOME environment variable after installation.
- (Optional) Add JAVA_HOME/bin to PATH for executing Java commands.
- If you want to use Eclipse then install Eclipse 3.5 or above (e.g. Eclipse 3.5.2):
- Eclipse is available on http://www.eclipse.org/.
- Install a Subversion-Plug-in e.g.:
- Subclipse, the plug-in provided by the subversion authors, http://subclipse.tigris.org/ (Update Site is http://subclipse.tigris.org/update.
- Subversive, another plug-in integrating Subversion support, http://www.polarion.org/index.php?page=overview&project=subversive (Update Site is http://www.polarion.org/projects/subversive/download/1.1/update-site/.
- or another plug-in supporting Subversion.
- Install Scala plug-in for Eclipse
- Scala Eclipse Plug-in web site with instructions: http://www.assembla.com/wiki/show/scala-ide/Requirements_and_Installation (Update Site http://www.scala-lang.org/scala-eclipse-plugin-nightly)
- Restart Eclipse
- Extract Scala source, either:
- If using Eclipse:
- Decide where your workspace is (will be reference later), switch to the SVN perspective. If you are not familiar with Eclipse, in menu Help -> Welcome may help you a lot.
- Browse SVN to know SVN information.
- Create a new repository, extract scala source
- If not using Eclipse then from command line: svn co http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk scala
- If using Eclipse:
- Build Scala compiler source
- If you want to build from the command line with ANT check link: http://www.scala-lang.org/node/217
- For Eclipse:
- Open in any text editor file .classpath from root folder and add after tag <classpath>
<classpathentry kind="con" path="ch.epfl.lamp.sdt.launching.SCALA_CONTAINER"/>
- Close File
- Import src catalog to eclipse workspace
- Right click on build.xml and select Run As -> Ant Build optionally you can just use shortcut Alt+Shift+X,Q
- Debug Compiler
- Add new deconfiguration by click on and selecting from menu Debug Configuration…
- Add new item under Scala Application
- create HelloWorld.scala file under root folder and paste sample Scala code
- under Main tab set Main class to: scala.tools.nsc.Main
- under Arguments tab (Remember to replace {PathToSrc} with path to Scala src) set
- Program arguments: HelloWorld.scala -target:jvm-1.5 -d bin
- VM arguments: -Xbootclasspath/a:{PathToSrc}\build\pack\lib\scala-compiler.jar;{PathToSrc}\build\pack\lib\scala-library.jar;{PathToSrc}\build\pack\lib\fjbg.jar;{PathToSrc}\build\pack\lib\msil.jar;{PathToSrc}\lib\original_msil.jar
- Done!
Tuesday, May 25, 2010
Mini how-to for building Scala from SVN
Steps to setup development environment for Scala compiler with Eclipse Scala plug-in:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment