Skip to content

Latest commit

 

History

History

plugin-processor

Maven

GradlePlugin annotation processor

generates META-INF/gradle-plugins/<pulgin-name>.properties files for classes annotated with GradlePlugin

kotlin example

TransformPlugin.kt:

package com.satori.libs.gradle.transform

import com.satori.libs.gradle.plugin.annotations.*
import org.gradle.api.*

@GradlePlugin(TransformPlugin.name)
open class TransformPlugin : Plugin<Project> {
  override fun apply(project: Project) {
    val conv = TransformPluginConvention(project)
    project.convention.plugins[name] = conv
  }
  companion object {
    const val name = "com.satori.transform"
  }
}

build.gradle:

apply plugin: "kotlin-kapt"

kapt {
  generateStubs = true
  correctErrorTypes = true
}

dependencies {
  compileOnly "com.satori:satori-libs-gradle-plugin-annotations:0.5.82-SNAPSHOT"
  kapt "com.satori:satori-libs-gradle-plugin-processor:0.5.82-SNAPSHOT"
}

Maven (snapshots)

<repository>
  <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<dependency>
    <groupId>com.satori</groupId>
    <artifactId>satori-libs-gradle-plugin-processor</artifactId>
    <version>0.5.82-SNAPSHOT</version>
</dependency>