LayerSpecParser

The single parser for the serialized layers { } declarations that cross the configuration-cache boundary as plain task @Input strings.

Format per entry: "name|pat1,pat2|allowed1,allowed2|hasRestriction". The Gradle plugin writes it; LayerDependencyRule, UncoveredModuleRule, and the HTML report all read it back through here, so there is exactly one definition of what a valid entry is. Entries with fewer than four fields are dropped rather than partially interpreted - a half-parsed layer would silently change which modules a rule constrains.

Functions

Link copied to clipboard
fun layerOf(layers: List<LayerSpec>, modulePath: String): LayerSpec?

The layer a module belongs to, or null when no declared pattern matches it.

Link copied to clipboard
fun parse(entries: List<String>): List<LayerSpec>

Parses serialized layer entries, preserving declaration order and dropping malformed ones.