Remove trait `DependencyContext` in favor of enum

Since `DependencyContext` is needed in the compiler interface
subproject, it has to be defined in this same subproject.

`DependencyContext` is needed in this subproject because the
`AnalysisCallback` interface uses it.
This commit is contained in:
Martin Duhem 2014-11-18 23:42:00 +01:00
parent b2c2ff698e
commit deda8eee70
6 changed files with 28 additions and 16 deletions

View File

@ -5,6 +5,7 @@ package sbt
package inc
import xsbti.api.Source
import xsbti.DependencyContext._
import java.io.File
/**

View File

@ -10,6 +10,7 @@ import xsbti.{ Position, Problem, Severity }
import Logger.{ m2o, problem }
import java.io.File
import xsbti.api.Definition
import xsbti.DependencyContext._
object IncrementalCompile {
def apply(sources: Set[File], entry: String => Option[File],

View File

@ -2,22 +2,7 @@ package sbt.inc
import java.io.File
import xsbti.api.Source
/**
* Represents contextual information about particular depedency edge. See comments in
* subtypes for examples of particular contexts.
*/
private[inc] sealed abstract class DependencyContext
/**
* Marks dependency edge introduced by referring to a class through inheritance as in
*
* class A extends B
*
* Each dependency by inheritance introduces corresponding dependency by member reference.
*/
private[inc] final case object DependencyByInheritance extends DependencyContext
private[inc] final case object DependencyByMemberRef extends DependencyContext
import xsbti.DependencyContext
/**
* Represents the kind of dependency that exists between `sourceFile` and either `targetFile`

View File

@ -8,6 +8,8 @@ import java.io.File
import Relations.Source
import Relations.SourceDependencies
import xsbti.api.{ Source => APISource }
import xsbti.DependencyContext
import xsbti.DependencyContext._
/**
* Provides mappings between source files, generated classes (products), and binaries.

View File

@ -7,6 +7,7 @@ package inc
import xsbti.api.{ Source, Compilation }
import xsbti.{ Position, Problem, Severity }
import xsbti.compile.{ CompileOrder, Output => APIOutput, SingleOutput, MultipleOutput }
import xsbti.DependencyContext._
import MultipleOutput.OutputGroup
import java.io.File
import sbinary._

View File

@ -0,0 +1,22 @@
package xsbti;
/**
* Enumeration of existing dependency contexts.
* Dependency contexts represent the various kind of dependencies that
* can exist between symbols.
*/
public enum DependencyContext {
/**
* Represents a direct dependency between two symbols :
* object Foo
* object Bar { def foo = Foo }
*/
DependencyByMemberRef,
/**
* Represents an inheritance dependency between two symbols :
* class A
* class B extends A
*/
DependencyByInheritance
}