sbt/sbt — pull request #705 by gkossakowski (2013-03-08 19:26:16+00:00)
Title: Separate dependency phase

Move dependency extraction to separate compiler phase called `Dependency` that can be run independently from class file extraction that is performed by `Analyzer` phase.

This pull request serves as foundation for more deep changes were we switch to dependency extraction performed by incremental compiler.

This is pure refactoring that does not change behavior. One would wonder if moving logic that traverses contents of `CompilationUnit.depends` to earlier phase could affect behavior because `CompilationUnit.depends` might be populated by later phases. I verified this manually by grepping compiler code and checking where that field gets modified. It turns out that there are two places where `depends` is mutated:

* in typer (and dependency phase runs after typer)
* in mixin where it add dependency on symbols corresponding to `$class`

Since we are running before mixing we won't see those Symbols but that does not matter because sbt's tracking is not fine-grained enough to run into problem of tracking trait symbol but not tracking implementation class symbol.