Kotlin Utils ![Maven Central](https://camo.githubusercontent.com/46da22df3e640d480a93f0b7dd35bf64d444c53bc2ad7391bd3c5be809ebe853/68747470733a2f2f696d672e736869656c64732e696f2f6d6176656e2d63656e7472616c2f762f636f6d2e6769746875622e6d616e6f736261747369732e6b6f746c696e2d7574696c732f6b6f746c696e2d7574696c732d6170692e737667)
Utils API
Commons utilities for code generated by Utils Kapt or Kotlin apps in general.
Utils Kapt
KotlinPoet/Kapt utilities for Kotlin annotation processor (sub)components.
Add to your build:
dependencies {
// ...
api("com.github.manosbatsis.kotlin-utils:kotlin-utils-kapt:$kotlinpoetutils_version")
}
To use, add the ProcessingEnvironmentAware
to your annotation processor:
import javax.annotation.processing.AbstractProcessor.AbstractProcessor
import com.github.manosbatsis.kotlin.utils.ProcessingEnvironmentAware
class MyAnnotationProcessor : AbstractProcessor(), ProcessingEnvironmentAware {
/**
* Implement [ProcessingEnvironmentAware.processingEnvironment]
* for access to a [ProcessingEnvironment]
*/
override val processingEnvironment: ProcessingEnvironment by lazy {
processingEnv
}
}
... or sub-component:
import javax.annotation.processing.AbstractProcessor.AbstractProcessor
import com.github.manosbatsis.kotlin.utils.ProcessingEnvironmentAware
class MyCustomAnnotationProcessingComponent(
override val processingEnvironment: ProcessingEnvironment
) : ProcessingEnvironmentAware {
fun doSometing(){
// Do it!
}
}