Change DestinationDir

I’ve this task:

task generateMetamodel(type: JavaCompile, group: 'build', description: 'Generates the QueryDSL query types') {
    source =
    classpath = configurations.compile + configurations.jpamodelgen
    options.compilerArgs = [
    destinationDir =
compileJava.dependsOn generateMetamodel

I need to change destinationDir in order to set generated files in a subfolder So I’d need to set them in + /metamodel

I guess it’s absolutly possible, however I’m not quite figuring out how to do it.

Thanks for all.

I’d go for
destinationDir = file(’/metamodel’)

Note the use of groovy first() method, available on all Iterable, which is less dodgy than iterator().next()