ViddikExtension

interface ViddikExtension

Configuration for the ru.workinprogress.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 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 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 ru.workinprogress.viddik.ViddikShowroom — an Android app module, typically. Becomes the viddik.generateTests KSP argument.

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 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 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.5% — which exists to absorb cross-OS rasterizer differences. A project that records and verifies on the same machine can afford to tighten this considerably. 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 ru.workinprogress: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.