LayerConfig
Configures a single architectural layer inside the layers { } block.
aalekh {
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")
}
}
}Module patterns support a single * wildcard matching one path segment, and ** matching any number of segments.
Parameters
The layer name, unique within the block.
Zero-based position of this layer in the layers { } block. Gradle's named container iterates alphabetically, which would make an overlapping-pattern resolution - and the order the report draws the swimlanes in - depend on layer spelling rather than on how the architecture was written down. Aalekh sorts by this instead, so domain, data, presentation stays in that order everywhere.
Properties
Layer names this layer is permitted to depend on. Empty means no restriction.
Whether allowedDependencyLayers is an allowlist (true) or unrestricted (false).
Glob patterns identifying which modules belong to this layer.