plugins {
    id "maven-publish"
    id "java-gradle-plugin"
    id "com.gradle.plugin-publish"
}

description = "A plugin for executing specified code generators"

dependencies {
    implementation 'io.github.classgraph:classgraph:4.8.181'
    api project(':code-generator-api')
    testImplementation project(':test-common')

}

task copyTestGenerator(type: Copy, dependsOn: ':test-code-generator:jar'){
    from  tasks.getByPath(':test-code-generator:jar').outputs
    into 'src/test/resources/'
    eachFile {
        name = "test-code-generator.jar"
    }
}

processTestResources.dependsOn(copyTestGenerator)

gradlePlugin {
    plugins {
        codeGenerator {
            id = "io.freefair.code-generator"
            implementationClass = "io.freefair.gradle.plugin.codegenerator.CodeGeneratorPlugin"
            displayName = "Code Generator Plugin"
            description = "A plugin for executing specified code generators"
            tags.set(['code', 'generation', 'codegeneration', 'generate'])
        }
    }
}
