domaframework / doma-compile-plugin

Allows annotation processors to read Doma resources at compile-time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doma Compile Plugin

Doma compile plugin is a gradle plugin.
It allows annotation processors to read Doma resources at compile-time.

The plugin supports Java and Kotlin.

Java CI with Gradle project chat Twitter

How to use

See Gradle Plugin Portal.

What does the plugin do ?

The plugin is equivalent to the following gradle script:

def domaResources = ['doma.compile.config', 'META-INF/**/*.sql', 'META-INF/**/*.script']

task copyDomaResourcesJava(type: Copy) {
    from sourceSets.main.resources.srcDirs
    into compileJava.destinationDir
    include domaResources
}

compileJava {
    dependsOn copyDomaResourcesJava
}

processResources {
    exclude domaResources
}

task copyDomaResourcesKotlin(type: Copy) {
    from sourceSets.main.resources.srcDirs
    into compileKotlin.destinationDir
    include domaResources
}

compileKotlin {
    dependsOn copyDomaResourcesKotlin
}

kapt {
    arguments {
        arg('doma.resources.dir', compileKotlin.destinationDir)
    }
}

Example build.gradle

About

Allows annotation processors to read Doma resources at compile-time

License:Apache License 2.0


Languages

Language:Java 68.7%Language:Kotlin 17.4%Language:Groovy 13.9%