KotlinxSchemaPlugin

class KotlinxSchemaPlugin : Plugin<Project> (source)

Gradle plugin for generating JSON schemas using KSP.

This plugin automatically:

  • Applies and configures the KSP plugin

  • Adds the kotlinx-schema-ksp processor as a KSP dependency

  • Configures generated source directories

  • Sets up proper task dependencies

The plugin supports both JVM-only and Kotlin Multiplatform projects. For multiplatform projects, schema generation occurs only in commonMain.

Usage:

plugins {
kotlin("jvm") version "2.2.21"
id("org.jetbrains.kotlinx.schema.ksp") version "0.1.0"
}

kotlinxSchema {
enabled.set(true) // Optional, defaults to true
rootPackage.set("com.example") // Optional package filter
}

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun apply(target: Project)