assertOnlyDependOnClassesInAnyPackage

fun List<ClassDeclaration>.assertOnlyDependOnClassesInAnyPackage(vararg packagePatterns: String, allClasses: List<ClassDeclaration> = Konture.projectGraph.getAllModules().flatMap { it.classes })

Asserts that the selected classes depend only on classes residing in packages matching the specified patterns.

Example:

repositories.assertOnlyDependOnClassesInAnyPackage("..domain..", "..data..")

Parameters

packagePatterns

Package wildcard patterns representing allowed dependency packages.

allClasses

The complete collection of class declarations used for dependency resolution. Defaults to all classes in the loaded project graph.

Throws

if any target class depends on a class outside the allowed packages.


fun KontureScope.assertOnlyDependOnClassesInAnyPackage(vararg packagePatterns: String, allClasses: List<ClassDeclaration> = Konture.projectGraph.getAllModules().flatMap { it.classes })

Asserts that the selected classes in the scope depend only on classes residing in packages matching the specified patterns.

Parameters

packagePatterns

Package wildcard patterns representing allowed dependency packages.

allClasses

The complete collection of class declarations used for dependency resolution. Defaults to all classes in the loaded project graph.

Throws

if any target class depends on a class outside the allowed packages.