diff --git a/medline.gradle b/medline.gradle index 6fbce0615c8..919acc0987d 100644 --- a/medline.gradle +++ b/medline.gradle @@ -1,18 +1,22 @@ - configurations { - xjc -} + xjc +} dependencies { - xjc group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: '2.2.4-1' + xjc 'com.sun.xml.bind:jaxb-xjc:2.2.4-1' } -task xjc () << { - ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.xjc.asPath) - - ant.xjc(destdir: 'src/main/gen/', package: 'net.sf.jabref.importer.fileformat.medline'){ - schema(dir: 'src/main/resources/xjc/medline', includes: 'medline.xsd') - } +task xjc { + inputs.dir "src/main/resources/xjc/medline/" + outputs.dir "src/main/gen/net/sf/jabref/importer/fileformat/medline" + + ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.xjc.asPath) + + doLast { + ant.xjc(destdir: 'src/main/gen/', package: 'net.sf.jabref.importer.fileformat.medline') { + schema(dir: 'src/main/resources/xjc/medline', includes: 'medline.xsd') + } + } } -tasks. compileJava.dependsOn xjc +tasks.compileJava.dependsOn xjc