SerialkompatExtension

abstract class SerialkompatExtension @Inject constructor(objects: ObjectFactory)

Configures the serialkompat { … } block (design §6, §9). Policy that can't be inferred from code (direction, baseline ref, scope) stays declared here; the wire config itself is read from the real jsonInstance.

Constructors

Link copied to clipboard
@Inject
constructor(objects: ObjectFactory)

Properties

Link copied to clipboard
abstract val acceptedBreaks: ListProperty<String>

Breaks the team has explicitly sanctioned — each downgraded from failing to acknowledged. Each entry is "<serialName> <RULE> [DIRECTION]", e.g. "com.example.Order PROPERTY_REMOVED" or "com.example.Order PROPERTY_REMOVED FORWARD" (omit the direction to accept both).

Link copied to clipboard
abstract val baselineRef: Property<String>

The git ref the current schema is checked against (e.g. origin/main).

Link copied to clipboard
abstract val direction: Property<CompatibilityDirection>

Direction(s) of compatibility to enforce. Defaults to FULL.

Link copied to clipboard
abstract val discovery: Property<DiscoveryMode>

How checked types are discovered when types is empty (issue #115): EXPLICIT (default) checks only types; OPT_OUT checks every discovered @Serializable type except those carrying @SerialkompatIgnore; OPT_IN checks only types carrying @SerialkompatChecked. A non-empty types list always wins, in every mode.

Link copied to clipboard
abstract val exclude: ListProperty<String>

Serial-name prefixes to exclude from the check.

Link copied to clipboard
abstract val failOnBreaking: Property<Boolean>

Whether a breaking change fails the build. Defaults to true.

Link copied to clipboard
abstract val failOnEmptyBaseline: Property<Boolean>

Whether a baseline that produced zero contracts (while the current schema has some) fails the build. Defaults to true: a degenerate baseline would otherwise diff as "everything added → safe" and silently mask removals. Set false for first-time adoption, where the baseline ref legitimately has no @Serializable types yet.

Link copied to clipboard

Published-schema history for the transitive, persisted-data check (design §5).

Link copied to clipboard
abstract val include: ListProperty<String>

Serial-name prefixes to include in the check (default: everything).

Link copied to clipboard
abstract val jsonInstance: Property<String>

FQN of a Json instance whose configuration describes the wire (e.g. com.acme.WireJson.instance). If it is set but can't be loaded from the runtime classpath, extraction fails.

Link copied to clipboard
abstract val renames: MapProperty<String, String>

Declared serial-name moves, old → new, so a rename is diffed as a moved contract (its contents compared) rather than a spurious remove + add.

Link copied to clipboard

Machine-readable report formats written by the pairwise check (#122).

Link copied to clipboard
abstract val types: ListProperty<String>

Fully-qualified names of the @Serializable root types to check.

Functions

Link copied to clipboard
fun history(action: Action<in SerialkompatHistory>)

Configures the history block: serialkompat { history { dir.set(…) } }.

Link copied to clipboard
fun reports(action: Action<in SerialkompatReports>)

Configures the reports block: serialkompat { reports { sarif { required.set(true) } } }.