Version 8, last updated by Hubert Plociniczak at December 15, 2011 15:37 UTC
Building headless
The Scala IDE for Eclipse can be built on the command line using Maven, as is done, for example, during the Hudson-driven nightly builds on Amazon EC2. Using a Unix-like OS, the process is as follows ...
- Requirements,
- The git command line tools (this will be available as a standard package for Linux distributions)
- A recent JDK (the current Oracle JDK is recommended)
- Maven 3
-
(Inital setup) Retrieve the source from its git repository, and make sure to checkout the
masterbranch# Clone $ git clone git://github.com/scala-ide/scala-ide.git # $ cd scala-ide -
(Subsequent updates) Update the source from the repository,
$cd scala-ide $git pull - Navigate to the build directory,
cd org.scala-ide.build - Build using scripts provided,
# For builds relative to Scala 2.8.x $ ./build-ide-2.8.x.sh # # For builds relative to Scala 2.9.x $ ./build-ide-2.9.x.sh # # For builds relative to Scala trunk $ ./build-ide-trunk.sh
Assuming your build is successful you should find an Eclipse update site has been built in org.scala-ide.sdt.update-site/target/site and a zipped version of the same at org.scala-ide.sdt.update-site/target/site_assembly.zip. You can install directly into Eclipse from this update site by adding it as a local update site via the Eclipse "Install New Software ..." action. Alternatively, if you make the unpacked site available via a web server, then the http URL of its root directory is acceptable as an ordinary Eclipse update site URL.
Working with local version of the Scala Presentation Compiler
- Make your local changes in the scala compiler
-
Build the scala compiler, package into maven format and deploy locally,
# You are in the main scala directory $ ant distpack-opt $ (cd dists/maven/latest; ant -Dlocal.snapshot.repository=${LOCAL_REPO} -Dlocal.release.repository=${LOCAL_REPO} deploy.snapshot.local) # If you use the standard .m2 location for maven, then the last command reduces to $ (cd dists/maven/latest; ant deploy.snapshot.local) -
Go to directory where you cloned your scala-ide and run the necessary scripts that use your local trunk version
$ (cd org.scala-ide.build-toolchain; ./build-toolchain-local-trunk.sh) $ (cd org.scala-ide.build; ./build-ide-local-trunk.sh)
If the build was successful you will end up with a right update-site - it contains the local changes you made in the scala compiler.
Starting another instance of Eclipse within Eclipse
It is also convenient to run another instance of Eclipse within the current Eclipse instance. It is especially useful if you need to do some manual debugging of the plugin. The only trouble is that the version you want to build has to rely exactly on the version which is currently installed in Eclipse. Another precondition is to have a Weaving Equinox launcher installed (can be found at the bottom of our download page).
You just have to have the following projects open org.scala-ide.{sdt.core, scala.compiler, scala.library}. If you didn't bundle Scala compiler and library into OSGI you have to build the "toolchain" first. Basically you have to run the respective script in the org.scala-ide.build-toolchain from the commandline. Refresh all opened plugin projects within eclipse and build org.scala-ide.sdt-core using standard builder.
If you get weird errors about missing methods then you are probably mixing scala versions in the scripts and the pluign. Before starting the new instance of Eclipse (with your version of the Scala plugin) make sure that no errors occurred. Finally simply create a new run configuration for the Equinox launcher.