Packages

t

org.specs2.matcher

DependencyMatchers

trait DependencyMatchers extends DependencyBaseMatchers with DependencyBeHaveMatchers

The dependency matchers trait provides a way to specify the dependencies that should be verified in your project and then to check that there's no unwanted dependency in the code.

It does so by:

  • specifying the dependencies as "layers" where a package name declared in one layer can only be dependent on a package name declared in a lower layer
  • using the scala compiler BuildManager class to recompile the files and get dependency analysis data

Usage:

layers( "package1", layer("package2", "package3", "package4"), layer("package6", "package7") ) must beRespected

Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DependencyMatchers
  2. DependencyBeHaveMatchers
  3. BeHaveMatchers
  4. DependencyBaseMatchers
  5. LayersAnalysis
  6. ClassycleDependencyFinder
  7. DependencyFinder
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class Layer(names: Set[String], prefix: String = "", sourceDir: DirectoryPath = "src" / "main" / "scala", targetDir: DirectoryPath = ..., included: Seq[String] = Seq(), excluded: Seq[String] = Seq()) extends Product with Serializable

    The Layer class represent a list of packages.

    The Layer class represent a list of packages.

    If those packages share a common prefix, it will be stored in the prefix member

    Definition Classes
    LayersAnalysis
  2. case class Layers(layers: Seq[Layer]) extends Product with Serializable

    This class represents an ordered set of layers, where each package on a given layer can only depend on packages defined in lower layers

    This class represents an ordered set of layers, where each package on a given layer can only depend on packages defined in lower layers

    Definition Classes
    LayersAnalysis
  3. class LayersDependenciesMatcher extends Matcher[Layers]

    this matcher checks that dependencies are satisfied for a given Layers definition

    this matcher checks that dependencies are satisfied for a given Layers definition

    Definition Classes
    DependencyBaseMatchers
  4. class LayersResultMatcher extends AnyRef
    Definition Classes
    DependencyBeHaveMatchers

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def be: NeutralMatcher[Any]
    Definition Classes
    BeHaveMatchers
  6. def beRespected: LayersDependenciesMatcher

    matcher for Layers declarations

    matcher for Layers declarations

    Definition Classes
    DependencyBaseMatchers
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. val fs: FilePathReader.type
    Definition Classes
    ClassycleDependencyFinder
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. def getPackageDependents(sourceDir: DirectoryPath, targetDir: DirectoryPath): (String) ⇒ Operation[Seq[Dependency]]

    returns

    the classes depending on the classes of package, given its name

    Definition Classes
    ClassycleDependencyFinderDependencyFinder
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. def have: NeutralMatcher[Any]
    Definition Classes
    BeHaveMatchers
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def layer(names: String*): Layer

    returns

    a new Layer object. If a prefix is defined, it will apply to each given name

    Definition Classes
    LayersAnalysis
  17. def layers(ls: Layer*): Layers

    returns

    a new Layers object, composed of other layers. If a prefix is defined it will apply to each layer

    Definition Classes
    LayersAnalysis
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def not: NotMatcher[Any]
    Definition Classes
    BeHaveMatchers
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. def respected: LayersDependenciesMatcher
    Definition Classes
    DependencyBeHaveMatchers
  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. implicit def toLayer(s: String): Layer

    this implicit definition allows to use a single string instead of a Layer object

    this implicit definition allows to use a single string instead of a Layer object

    Definition Classes
    LayersAnalysis
  25. implicit def toLayersResultMatcher(result: MatchResult[Layers]): LayersResultMatcher
    Definition Classes
    DependencyBeHaveMatchers
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from DependencyBeHaveMatchers

Inherited from BeHaveMatchers

Inherited from DependencyBaseMatchers

Inherited from LayersAnalysis

Inherited from ClassycleDependencyFinder

Inherited from DependencyFinder

Inherited from AnyRef

Inherited from Any

Ungrouped