fromConfig

fun fromConfig(layerEntries: List<String>, featurePattern: String, featureAllowedPairs: List<String>, ruleEntries: List<String>, previousCycleCount: Int? = null, forbidEntries: List<String> = emptyList(), reachabilityEntries: List<String> = emptyList(), sourceSetEntries: List<String> = emptyList()): RuleEngine(source)

Builds a fully configured RuleEngine from the serialized DSL inputs passed through Gradle task properties. All parameters are plain strings for configuration-cache safety - no live Gradle objects.

Parameters

layerEntries

Serialized layer declarations. Format per entry: "layerName|pat1,pat2|allowedLayer1,allowedLayer2|hasRestriction".

featurePattern

Glob pattern identifying feature modules, e.g. ":feature:**". Empty string disables the feature isolation rule.

featureAllowedPairs

Serialized allow-pairs. Format: "fromPattern->toPattern".

ruleEntries

Serialized rule overrides. Formats: "ruleId:severity:LEVEL", "ruleId:suppress:pattern", "ruleId:option:preventRegression", "ruleId:threshold:N", "custom:class:fully.qualified.ClassName".

previousCycleCount

Main-code cycle count from the previous run's results JSON. Null when no prior results exist - regression check is skipped in that case.

forbidEntries

Serialized forbid { } predicate rules. Format per entry: "<fromKind>|<fromValue>|<toKind>|<toValue>|<severity>|<reason>|<apiOnly>" where kind is path or type and apiOnly (optional) restricts the match to api edges.

reachabilityEntries

Serialized forbidReachable / mustBeReachableFrom rules. Format per entry: "<kind>|<fromGlob>|<toGlob>|<severity>|<reason>" where kind is forbid (transitive forbidden dependency) or require (must be reachable).