https://kotlinlang.org logo
Title
m

martmists

07/13/2022, 11:34 AM
How would I set up gradle to include resources generated by kapt in the processResources task? My attempt was
tasks {
    val kaptKotlin by named<Kapt>("kaptKotlin") {

    }

    val processResources by named<ProcessResources>("processResources") {
        from(kaptKotlin.outputs)
    }
}
But that gives
Task with name 'kaptKotlin' not found in project ':myproject'
, and I think this would also include any classes generated to resources
t

tapchicoma

07/13/2022, 2:53 PM
probably you need to wrap your script into
plugins.withId("org.jetbrains.kotlin.kapt") { .. }
m

martmists

07/13/2022, 4:01 PM
is that required separate from the
kotlin("kapt")
in the
plugins {}
block at the top of my build.gradle.kts file?
t

tapchicoma

07/13/2022, 5:35 PM
put it inside your
build.gradle.kts
after
plugins {..}
block:
plugins { .. }

plugins.withId("org.jetbrains.kotlin.kapt") {
    tasks....
}