
Compiler and ksp plugin generates and validates service providers, utilizing annotations for streamlined integration. Accessible through mavenCentral, supports both compiler and ksp integration methods.
A Kotlin compiler and ksp plugin that generate and validate your service providers.
The Kotlin compiler plugin does not support Java source code. In this case, you need to use the ksp plugin.
The Gradle plugin is uploaded to mavenCentral, so you need to add mavenCentral() to your plugin repositories:
// settings.gradle.kts
pluginManagement {
repositories {
mavenCentral()
}
}Apply the Kotlin compiler plugin via Gradle:
// build.gradle.kts
plugins {
id("app.softwork.serviceloader-compiler") version "LATEST"
}You might also want to enable the compiler plugin in IntelliJ by setting kotlin.k2.only.bundled.compiler.plugins.enabled to false in the registry.
Apply the ksp plugin via Gradle:.
// build.gradle.kts
plugins {
id("com.google.devtools.ksp")
id("app.softwork.serviceloader") version "LATEST"
}And use the app.softwork.serviceloader.ServiceLoader annotation:
import app.softwork.serviceloader.ServiceLoader
interface Service
@ServiceLoader(Service::class)
class Provider : ServiceApache 2.0
A Kotlin compiler and ksp plugin that generate and validate your service providers.
The Kotlin compiler plugin does not support Java source code. In this case, you need to use the ksp plugin.
The Gradle plugin is uploaded to mavenCentral, so you need to add mavenCentral() to your plugin repositories:
// settings.gradle.kts
pluginManagement {
repositories {
mavenCentral()
}
}Apply the Kotlin compiler plugin via Gradle:
// build.gradle.kts
plugins {
id("app.softwork.serviceloader-compiler") version "LATEST"
}You might also want to enable the compiler plugin in IntelliJ by setting kotlin.k2.only.bundled.compiler.plugins.enabled to false in the registry.
Apply the ksp plugin via Gradle:.
// build.gradle.kts
plugins {
id("com.google.devtools.ksp")
id("app.softwork.serviceloader") version "LATEST"
}And use the app.softwork.serviceloader.ServiceLoader annotation:
import app.softwork.serviceloader.ServiceLoader
interface Service
@ServiceLoader(Service::class)
class Provider : ServiceApache 2.0