AalekhExtension
DSL extension for configuring Aalekh in the root project's build.gradle.kts.
aalekh {
outputDir.set("reports/aalekh")
openBrowserAfterReport.set(false)
layers {
layer("domain") {
modules(":core:domain", ":feature:*:domain")
}
layer("data") {
modules(":core:data", ":feature:*:data")
canOnlyDependOn("domain")
}
layer("presentation") {
modules(":feature:*:ui", ":app")
canOnlyDependOn("domain", "data")
}
}
featureIsolation {
featurePattern = ":feature:**"
allow(from = ":feature:shared", to = ":feature:*")
}
rules {
rule("layer-dependency") {
severity = Severity.WARNING
suppressFor(":legacy:**")
}
}
}Properties
Configures the affected-graph analysis run by aalekhAffected - the git refs to diff for the "what does this change rebuild?" pull-request artefact.
Path (relative to the root project) of the committed violation baseline file. Default: "aalekh-baseline.json".
When true, aalekhReport writes aalekh-metrics.csv alongside index.html. The CSV contains one row per module with timestamp, fan-in/out, instability, transitive dep count, and health score. Default: false.
Fail aalekhDiff when the change makes the architecture structurally worse - a new dependency cycle, or a structural metric that regressed against the snapshot. Default: false.
Configures the feature isolation rule. Feature modules matching the declared pattern must not depend on each other unless explicitly allowed.
Include compileOnly configurations in the dependency graph. Default: false.
Capture external (third-party) dependencies - their group:name:version coordinates and declaration type - so they appear in the module inspector of the HTML report. Default: true.
Include test configurations in the dependency graph. Default: true.
Named container of LayerConfig objects. Each entry declares one architectural layer and optionally restricts which other layers it may depend on.
Configures the graph export run by aalekhMermaid - the focus/exclude filters that keep a large graph's Mermaid and DOT diagrams readable.
Open the HTML report in the default browser after aalekhReport completes. Default: true.
Configures metric-delta quality gates that fail aalekhCheck when a structural metric regressed versus the committed baseline (aalekh-baseline.json).
Configures per-rule severity overrides and module-level suppressions.
Path (relative to the root project) of the committed architecture snapshot. Default: "aalekh-snapshot.json".
Declares which teams own which modules using glob patterns.
Configures the git temporal-coupling analysis run by aalekhTemporal - the commit window and the thresholds for reporting co-change and flagging hidden coupling.
Functions
Configures the affected-graph diff range via the AffectedGraphConfig DSL.
Declares a one-off structural rule inline: modules matching from must not depend on modules matching to. A lightweight alternative to a custom com.aalekh.aalekh.analysis.rules.ArchRule jar for the common "X must not depend on Y" case.
Adds a named layer and configures it. Shorthand for use inside the layers { } block.
Convenience for Kotlin lambda syntax: layers { layer("domain") { ... } }.
Declares architectural layers and their permitted dependency directions.
Configures the Mermaid/DOT export focus and exclude filters via the MermaidConfig DSL.
Configures metric-delta quality gates via the QualityGatesConfig DSL.
Configures team ownership mappings via the TeamOwnershipConfig DSL.
Configures git temporal-coupling analysis via the TemporalCouplingConfig DSL.