ViddikExtension

interface ViddikExtension

Configuration for the io.github.youndie.viddik plugin, available as viddik { } in a consumer's build script.

Every property has a default derived from the module itself, so an empty viddik { } block — or no block at all — is the normal case. Reach in here only where the derivation can't know the answer: where the goldens live (snapshotsDir), how strict the comparison should be (tolerancePercent), or whether verification belongs in check (verifyOnCheck).

Properties

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

Whether the plugin adds the viddik dependencies itself — annotations and testing-core on the test source set, the processor on the matching KSP configuration, and the JUnit 5 runtime. true by default.

Link copied to clipboard
abstract val channelTolerance: Property<Int>

How far a single channel may drift before a pixel counts as mismatched. Unset by default. Becomes the viddik.channelTolerance system property.

Link copied to clipboard
abstract val designChannelTolerance: Property<Int>

How far a single channel may drift before a pixel counts as different from the design. Unset by default, leaving viddik's own ±16, which is what anti-aliased edges drawn by two rasterizers measure. Becomes the viddik.designChannelTolerance system property.

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

Where the design references live — PNGs exported from the design the fixtures were built to, named exactly like the goldens (<group>_<name>.png), relative to the module directory. Defaults to design/ under snapshotsDir. Becomes the viddik.designDir system property.

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

Whether viddikDesignParity fails on a fixture outside the design tolerance. false by default: the task is a report, and a screen half-way to its design is the normal state of a screen being built. Turn it on where matching the design is the acceptance criterion, for good here or per run with -Pviddik.designStrict. Either way the run fails when no fixture had a reference at all, which is a misconfiguration and not a result. Becomes the viddik.designStrict system property.

Link copied to clipboard
abstract val designTolerancePercent: Property<Double>

Share of pixels allowed to differ between a fixture and its design reference before the fixture is reported as a mismatch. Unset by default, leaving viddik's own 5% — a design is drawn by a different rasterizer than Compose, so the golden threshold would fail on anti-aliasing alone. Becomes the viddik.designTolerancePercent system property.

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

Whether the module's ordinary test task excludes the generated screenshot tests. true by default: they're owned by the verify task, and running them from both places just does the work twice against goldens the ordinary task has no reason to care about.

Link copied to clipboard
abstract val floorChannelDelta: Property<Int>

The largest single-channel difference a pixel may have and still be absorbed by minMismatchedPixels; one past it fails the comparison however few there are. Unset by default, leaving viddik's own 96 — twice the measured cross-OS residue (delta 47), and well short of a changed glyph (a full stop: 12 px at delta 223). 255 restores a floor that counts pixels only. Becomes the viddik.floorChannelDelta system property.

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

Whether the KSP processor generates the JUnit 5 test class alongside the component registry. true by default; set it to false in a module that only wants the registry for io.github.youndie.viddik.ViddikShowroom — an Android app module, typically. Becomes the viddik.generateTests KSP argument.

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

Whether a capture refuses to photograph text the font cannot draw, instead of letting the host draw it. Unset by default. Becomes the viddik.glyphCheck system property.

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

Path to the font glyphCheck reads, for a module that bundles its own instead of using viddik's Roboto. Becomes the viddik.glyphCheckFont system property.

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

Name of the Kotlin JVM target that carries the screenshot fixtures, e.g. "desktop" for jvm("desktop") or "jvm" for an unnamed jvm().

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

Whether the test source set's KSP run reads a declarations-only snapshot of the main classes — and of the other modules of this build it depends on — instead of the classes themselves. On by default. Applies to JVM targets.

Link copied to clipboard
abstract val minMismatchedPixels: Property<Int>

How many mismatched pixels a comparison absorbs whatever the fixture's size — the floor beside tolerancePercent, which on its own is unfair to small fixtures. Unset by default, leaving viddik's own 16. 0 turns the floor off. Becomes the viddik.minMismatchedPixels system property.

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

Where a failed comparison writes its _DIFF.png, relative to the module directory. Defaults to viddik's own build/reports/screenshots. Becomes the viddik.reportsDir system property.

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

Whether the run serves every capture from one shared scene instead of standing a scene up per fixture. On by default. Becomes the viddik.sceneReuse system property.

Link copied to clipboard
abstract val shards: Property<Int>

How many forks to spread the fixtures over. Two by default.

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

Whether the component registry is generated from commonMain as well as compiled for the JVM, so that every target the module has — Android and iOS included — can open the showroom.

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

Where the golden PNGs live, relative to the module directory.

Link copied to clipboard
abstract val tolerancePercent: Property<Double>

Share of pixels allowed to differ before a comparison fails. Unset by default, leaving viddik's own 0.05% (plus a ±2 per-channel allowance), which is what the residual cross-OS difference measures once fixtures bundle a font. Becomes the viddik.tolerancePercent system property.

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

Whether check depends on the verify task. false by default, so goldens recorded on a CI runner don't redden ./gradlew build on a dev machine with different fonts.

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

Version of the io.github.youndie.viddik:viddik-* artifacts to add when addDependencies is on. Defaults to the plugin's own version, which is what keeps the processor and the engine in step.