Extract the dependency information of a compilation unit.
To understand why we track the used names see the section "Name hashing algorithm" in http://www.scala-sbt.org/0.13/docs/Understanding-Recompilation.html To understand why we need to track dependencies introduced by inheritance specially, see the subsection "Dependencies introduced by member reference and inheritance" in the "Name hashing algorithm" section.
Traverse a used type and record all the dependencies we need to keep track of for incremental recompilation.
As a motivating example, given a type
T defined as:
type T >: L <: H type L <: A1 type H <: B1 class A1 extends A0 class B1 extends B0
We need to record a dependency on
B1. This is
necessary because the API representation that
ExtractAPI produces for
T just refers to the strings "L" and "H", it does not contain their API
representation. Therefore, the name hash of
T does not change if for
example the definition of
We do not need to keep track of superclasses like
the API representation of a class (and therefore its name hash) already
contains all necessary information on superclasses.
A natural question to ask is: Since traversing all referenced types to
find all these names is costly, why not change the API representation
ExtractAPI to contain that information? This way the name
T would change if any of the types it depends on change, and we
would only need to record a dependency on
T. Unfortunately there is no
simple answer to the question "what does T depend on?" because it depends
on the prefix and
ExtractAPI does not compute types as seen from every
possible prefix, the documentation of
ExtractAPI explains why.
The tests in sbt
as-seen-from-b rely on this.
Top level import dependencies are registered as coming from a first top level class/trait/object declared in the compilation unit. If none exists, issue warning.
The set of class dependencies from this compilation unit.
Mangle a JVM symbol name in a format better suited for internal uses by sbt.
Resolves dependency source (that is, the closest non-local enclosing
class from a given
Traverse the tree of a source file and record the dependencies and used names which
can be retrieved using