forbid

fun forbid(configure: ForbiddenDependencySpec.() -> Unit)(source)

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.

aalekh {
forbid {
from(":core:domain")
toModuleType(ModuleType.ANDROID_LIBRARY)
because("the domain layer stays platform-agnostic")
}
}