ClassesRuleBuilder

class ClassesRuleBuilder(graph: ProjectGraph = Konture.projectGraph)

A builder for compiling and verifying architectural rules on Kotlin classes.

Accumulates filtering conditions (that()) and assertions (should()), which are verified against all project classes by calling check.

Constructors

Link copied to clipboard
constructor(graph: ProjectGraph = Konture.projectGraph)

Functions

Link copied to clipboard

Configures this builder to allow empty selections (i.e. if no classes match the that() filter, the rule will pass instead of throwing an AssertionError).

Link copied to clipboard

Logical AND operator for chaining filter conditions.

Link copied to clipboard

Logical AND operator for chaining assertion conditions.

Link copied to clipboard
fun check(g: ProjectGraph = graph)

Executes the built class rules against the specified project graph.

Link copied to clipboard

Logical NOT operator for negating the next filter condition.

Link copied to clipboard

Logical NOT operator for negating the next assertion condition.

Link copied to clipboard

Logical OR operator for chaining filter conditions.

Link copied to clipboard

Logical OR operator for chaining assertion conditions.

Link copied to clipboard

Starts adding assertion rules that the selected classes must satisfy.

Link copied to clipboard

Asserts rules on filtered classes using a lambda block that provides a ClassDeclarationShouldContext receiver.

Link copied to clipboard

Starts adding filtering conditions to select which classes to verify.

Link copied to clipboard

Filters classes in this rule using a concise lambda predicate evaluated on each ClassDeclaration.

Link copied to clipboard

Logical XOR (Exclusive OR) operator for chaining filter conditions.

Link copied to clipboard

Logical XOR (Exclusive OR) operator for chaining assertion conditions.