| plugins { |
| id 'com.github.jacobono.jaxb' version '1.3.5' |
| id 'groovy' |
| id 'java' |
| } |
| |
| repositories { |
| jcenter() |
| mavenCentral() |
| } |
| |
| dependencies { |
| compile gradleApi() |
| compile localGroovy() |
| compile 'junit:junit:4.12' |
| compile 'com.google.truth:truth:0.27' |
| |
| jaxb 'com.sun.xml.bind:jaxb-xjc:2.2.7-b41' |
| jaxb 'com.sun.xml.bind:jaxb-impl:2.2.7-b41' |
| jaxb 'javax.xml.bind:jaxb-api:2.2.7' |
| } |
| |
| def jaxbOutputPath = 'generated-src/main/java' |
| |
| sourceCompatibility = '1.7' |
| targetCompatibility = '1.7' |
| |
| jaxb { |
| xsdDir = 'src/main/xsd' |
| |
| xjc { |
| destinationDir = jaxbOutputPath |
| generatePackage = 'io.v.generated' |
| } |
| } |
| |
| sourceSets.main.java.srcDirs += jaxbOutputPath |
| |
| clean { |
| delete 'generated-src' |
| } |
| |
| tasks.'compileJava'.dependsOn(tasks.'xjc') |
| |