diff --git a/build.gradle b/build.gradle index 7ca1984b185..3883c22f676 100644 --- a/build.gradle +++ b/build.gradle @@ -382,14 +382,20 @@ dependencies { xjc group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: '2.2.4-1' } + def schemaTargetDir = new File ('src/main/gen') + +task createDirs () { + schemaTargetDir.mkdirs() +} -task xjc () { +task xjc () { ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.xjc.asPath) ant.xjc( - destdir: 'src/main/gen', + destdir: schemaTargetDir, schema: 'src/main/resources/xjc/medline.xsd' ) } -compileJava.dependsOn xjc + xjc.dependsOn createDirs + compileJava.dependsOn xjc