KontureContext

class KontureContext(projectGraph: ProjectGraph)

DSL Context wrapper that allows defining and verifying multiple independent rule suites.

This context lets you specify module, class, function, property, and file assertions together, and verify all of them in a single batch operation via Konture.architecture. All declared suites are executed even when earlier suites fail; violations are aggregated.

Constructors

Link copied to clipboard
constructor(projectGraph: ProjectGraph)

Properties

Link copied to clipboard

Returns a ClassSelector for all classes in the project graph.

Link copied to clipboard

Returns a FileSelector for all files in the project graph.

Link copied to clipboard

Returns a FunctionSelector for all functions in the project graph.

Link copied to clipboard

Returns a ModuleSelector for all modules in the project graph.

Link copied to clipboard

Returns a PropertySelector for all properties in the project graph.

Functions

Link copied to clipboard

Imports and executes a RuleDefinition inside this architecture validation context.

fun apply(ruleSet: RuleSet)

Imports and executes all rules declared inside ruleSet in this architecture validation context.

fun apply(vararg rules: RuleDefinition)

Imports and executes multiple RuleDefinition instances inside this architecture validation context.

fun apply(vararg ruleSets: RuleSet)

Imports and executes multiple RuleSet instances in this architecture validation context.

fun apply(ruleSets: Iterable<RuleSet>)

Imports and executes a collection of RuleSet instances in this architecture validation context.

Link copied to clipboard
fun assertNoCycles(includeTestConfigurations: Boolean = false)

Alias for noCycles.

Link copied to clipboard
fun classes(block: ClassesRuleBuilder.() -> Unit)

Declares a suite of class structure/dependency rules inside this architecture validation context.

fun classes(sourceSets: SourceSetSelector, block: ClassesRuleBuilder.() -> Unit)

Declares a suite of class structure/dependency rules scoped to specific source sets.

Link copied to clipboard
fun files(block: FilesRuleBuilder.() -> Unit)

Declares a suite of file structure/dependency rules inside this architecture validation context.

fun files(sourceSets: SourceSetSelector, block: FilesRuleBuilder.() -> Unit)

Declares a suite of file structure/dependency rules scoped to specific source sets.

Link copied to clipboard

Declares a suite of function structure/dependency rules inside this architecture validation context.

fun functions(sourceSets: SourceSetSelector, block: FunctionsRuleBuilder.() -> Unit)

Declares a suite of function structure/dependency rules scoped to specific source sets.

Link copied to clipboard
fun layer(name: String, block: ArchitectureLayerPolicy.() -> Unit)

Declares a first-class architectural layer with module/package selectors and explicit dependency boundaries inside this architecture validation context.

Link copied to clipboard

Declares a nested, type-safe layered-architecture specification inside this architecture validation context.

Link copied to clipboard

Declares a suite of layered-architecture rules inside this architecture validation context.

Link copied to clipboard
fun modules(block: ModulesRuleBuilder.() -> Unit)

Declares a suite of module structure/dependency rules inside this architecture validation context.

fun modules(sourceSets: SourceSetSelector, block: ModulesRuleBuilder.() -> Unit)

Declares a suite of module structure/dependency rules scoped to specific source sets.

Link copied to clipboard
fun noCycles(includeTestConfigurations: Boolean = false)

Verifies that there are no module dependency cycles in the project.

Link copied to clipboard

Declares a suite of property structure/dependency rules inside this architecture validation context.

Declares a suite of property structure/dependency rules scoped to specific source sets.

Link copied to clipboard
fun rule(id: String, block: RuleBuilder.() -> Unit): RuleDefinition

Declares a named architecture rule with metadata and sub-rules inside this architecture validation context.

Link copied to clipboard
fun slices(block: SlicesRuleBuilder.() -> Unit)

Declares a suite of slice rules inside this architecture validation context.

fun slices(pattern: String): SliceSelector

Returns a SliceSelector for packages matching pattern in the project graph.

fun slices(sourceSets: SourceSetSelector, block: SlicesRuleBuilder.() -> Unit)

Declares a suite of slice rules scoped to specific source sets.

Link copied to clipboard

Declares a first-class source-set architecture policy using a custom SourceSetSelector.

fun sourceSet(vararg names: String, block: ArchitectureSourceSetPolicy.() -> Unit)

Declares a first-class source-set architecture policy for source sets matching any of names.

Declares a first-class source-set architecture policy for source sets matching name.