xjc task config

This commit is contained in:
Steve Ebersole 2021-08-05 15:27:04 -05:00
parent a532445e35
commit 83ac9d5d3d
1 changed files with 13 additions and 31 deletions

View File

@ -16,9 +16,6 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' )
apply plugin: 'org.hibernate.orm.antlr' apply plugin: 'org.hibernate.orm.antlr'
apply plugin: 'org.hibernate.matrix-test' apply plugin: 'org.hibernate.matrix-test'
ext {
jaxbTargetDir = file( "${buildDir}/generated/sources/jaxb/main" )
}
configurations { configurations {
tests { tests {
@ -30,27 +27,6 @@ configurations {
} }
} }
sourceSets {
main {
// add the XJC generated JAXB classes to the main source-set
java.srcDir project.jaxbTargetDir
}
// resources inherently exclude sources
test {
resources {
setSrcDirs( ['src/test/java','src/test/resources','src/test/bundles'] )
}
}
testJavassist {
// define the testJavassist source-set
java {
compileClasspath += main.output + test.output + configurations.javassist
runtimeClasspath += main.output + test.output + configurations.javassist
}
}
}
dependencies { dependencies {
api libraries.jpa api libraries.jpa
@ -168,26 +144,32 @@ jar {
} }
ext { ext {
jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" ) jaxbTargetDir = project.file( "${buildDir}/generated/sources/xjc/main" )
} }
sourceSets { sourceSets {
main { main {
java { // add the XJC generated JAXB classes to the main source-set
java{
srcDir project.jaxbTargetDir srcDir project.jaxbTargetDir
} }
} }
// resources inherently exclude sources
test { test {
resources { resources {
// resources inherently exclude Java sources
srcDir 'src/test/java' srcDir 'src/test/java'
srcDir 'src/test/resources'
srcDir 'src/test/bundles'
} }
} }
}
idea { testJavassist {
module { // define the testJavassist source-set
sourceDirs += file( "${buildDir}/generated-src/antlr/main" ) java {
compileClasspath += main.output + test.output + configurations.javassist
runtimeClasspath += main.output + test.output + configurations.javassist
}
} }
} }