Skip to content

Commit

Permalink
define xjc input/ouput dir (subsequent builds will be faster) (#1628)
Browse files Browse the repository at this point in the history
Execute task only when input/output dir changed.
  • Loading branch information
chriba authored and Siedlerchr committed Jul 26, 2016
1 parent 0853734 commit 653c8a9
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions medline.gradle
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 653c8a9

Please sign in to comment.