mirror of https://github.com/sbt/sbt.git
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:
parent
b2c2ff698e
commit
deda8eee70
|
|
@ -5,6 +5,7 @@ package sbt
|
|||
package inc
|
||||
|
||||
import xsbti.api.Source
|
||||
import xsbti.DependencyContext._
|
||||
import java.io.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],
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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._
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
Loading…
Reference in New Issue