Bulid JAXB classes in Gradle usin Kotlin

1.2k views Asked by At

Hi I have a task in groovy:

task generateJAXBClasses() {
    inputs.dir 'src/main/config'
    outputs.dir 'src/main/java/ad/ecs/struct'
    def jaxbSrcDir = file("${projectDir}/src/main/java")
    doLast {
        ant.taskdef(name: 'xjc', classname: 'ad.ecs.structbuild.XJC2Task', 
                classpath: configurations.generateJAXBClasses.asPath)
        ant.jaxbSrcDir = jaxbSrcDir

        ant.xjc(
            destdir: '${jaxbSrcDir}',
            package: 'ad.ecs.struct',
            schema: 'src/main/config/StructsULink.xsd',
            binding: 'src/main/config/MainBindings.xml',
            readonly: true,
            //header: false,
            argument1: '-Xsetters',
            argument2: '-npa',
        )
    }
}

I'm not sure how to reference my class ad.ecs.structbuild.XJC2Task in Kotlin. I was wondering if there is an alternative to the ant in Kotlin?

0

There are 0 answers