scala-ide/scala-ide — pull request #447 by dotta (2013-06-21 12:07:55+00:00)
Title: Build/use scala ide update site for building sources

**DO NOT MERGE THIS**

I'm opening this PR for giving you an overview of the changes I'm performing in the build, so that you have time to look at it and provide feedback. This is going to have major impacts on the way we build the Scala IDE, so I don't want to merge it before we can make sure everything is good. Furthermore, merging will require some coordination. For instance, we will have to upgrade the PR validator script used by the Scala project to validate commits against the Scala IDE (/cc @huitseeker).

The whole idea behind the change is to use *the Scala IDE nightly* for retrieving the dependencies that are needed to build the Scala IDE codebase. Basically, we expect ``repo.scala-ide.dependencies`` to point to a P2 repository that contains the Scala compiler + library, Sbt, scala-refactoring and scalariform bundles.

So, why the change, you may ask. The reason is simple, we currently have a very hard time making sure that the dependencies used to build the Scala IDE codebase have been build using the **same** Scala compiler + library. This is an important requirement for preventing binary incompatibilities (read, weird runtime errors when tests are executed, for instance). An additional benefit is that we no longer need to produce and publish update sites for the Scala IDE dependencies so that they can be consumed by the build. Hence, it will make our build simpler to understand and maintain.

Ok, so, the Scala IDE codebase will be built using the Scala IDE nightly, but how do we produce the nightly? (i.e., how to bootstrap?). For that we are going to use the [uber-build script](https://github.com/scala-ide/uber-build)! Of course, some changes where needed in the uber-build script as well, you can check the changes in [this branch](https://github.com/dotta/uber-build/tree/build/use-scala-ide-update-site-for-building-sources) (check the last commit). Btw, I also took the opportunity to do some clean-up in the scala-refactoring and scalariform POMs, you can check my changes [here](https://github.com/dotta/scala-refactoring/tree/build/use-scala-ide-update-site-for-building-sources) and [here](https://github.com/dotta/scalariform/tree/build/use-scala-ide-update-site-for-building-sources).
The changes in the uber-build script are not going to be compatible with the Scala IDE 3.0.x branch, hence we will have to tag the uber-build before merging my changes, so that we can still use the script to build the Scala IDE 3.0.x.

What does this change entail for me, Scala IDE committer? So, the ``build-all.sh`` has been renamed ``build.sh``, because it now only builds the codebase (before it also used to build *the toolchain*). That's it, instead of running ``./build-all.sh``, you will now have to type ````./build.sh``, i.e., you save 4 chars, and the build will execute faster! Really, only benefits, no drawbacks, can you believe it!? :)

Remaining work:

* Change the ecosystem nightlies for 4.0.x to publish the result of the build on our ``download.scala-ide.org`` and have a symbolic links for ``download.scala-ide.org/sdk/e37/scala211/nightly/4.0.x/site`` and ``download.scala-ide.org/sdk/e37/scala210/nightly/4.0.x/site`` that always point to the latest nightlies.

* Clean-up ``download.scala-ide.org`` to remove all unnecessary junk.

* Update Scala PR validator script (would be good if it could use the uber-build script for building)

* Open question: The scala-refactoring build needs a P2 repo with Scala compiler + library to build. This means that atm the only way to build scala-refactoring is by using the uber-build script (or, by using a Scala IDE update site that contains the needed Scala library + compiler). While this is not a problem for us (Scala IDE), I think this is somewhat not ideal for the scala-refatoring project, but I don't really have a good solution for this, so I'm just raising the question (and I'll point out that this is not a new problem, things have been the way they are for a long time...). \cc @misto

Btw, if you want to check for yourself that the [modified uber-build I have in my branch](https://github.com/dotta/uber-build/tree/build/use-scala-ide-update-site-for-building-sources) can be used to build the scala-ide based on this PR, here follows the command that you need to run:

```
./build-full-ide.sh \
ECLIPSE_PLATFORM=indigo \
VERSION_TAG=nightly \
SCALA_VERSION=2.10.2 \
SBINARY_BRANCH=0.4.1_SI-3.0.0-RC1 \
SBT_GIT_REPO=git://github.com/sbt/sbt.git \
SBT_BRANCH=0.13 \
SBT_VERSION=0.13.0-SNAPSHOT \
SCALARIFORM_GIT_REPO=git://github.com/dotta/scalariform.git \
SCALARIFORM_BRANCH=build/use-scala-ide-update-site-for-building-sources \
SCALA_REFACTORING_GIT_REPO=git://github.com/dotta/scala-refactoring \
SCALA_REFACTORING_BRANCH=build/use-scala-ide-update-site-for-building-sources \
SCALA_IDE_GIT_REPO=git://github.com/dotta/scala-ide.git \
SCALA_IDE_BRANCH=build/use-scala-ide-update-site-for-building-sources \
WORKSHEET_BRANCH=0.2.0 \
TYPESAFE_IDE_VERSION_TAG=4.0.0-nightly
``