Skip to content

Commit

Permalink
HHH-17377 - Migrate to JPA 3.2
Browse files Browse the repository at this point in the history
https://hibernate.atlassian.net/browse/HHH-17377

XJB changes (JAXB "binding model")
  • Loading branch information
sebersole committed Nov 17, 2023
1 parent 66bdc1c commit 957bdca
Showing 1 changed file with 3 additions and 54 deletions.
57 changes: 3 additions & 54 deletions tooling/metamodel-generator/hibernate-jpamodelgen.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,10 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' )
apply plugin: 'version-injection'

java {
sourceCompatibility = jdks.versions.getBaseline( )
targetCompatibility = 17
sourceCompatibility = jdks.versions.baseline.get()
targetCompatibility = sourceCompatibility
}

//configurations {
// modelImplementation {
// extendsFrom implementation
// }
// modelAnnotationProcessor {
// extendsFrom annotationProcessor
// }
// testImplementation {
// extendsFrom modelImplementation
// }
//}

dependencies {
// api - ewww... but Maven needs them this way
api project( ':hibernate-core' )
Expand All @@ -38,44 +26,5 @@ dependencies {

}

sourceSets.main {
java.srcDir xjcTargetDir
resources.srcDir xsdDir
}

compileTestJava {
options.compilerArgs += [
"-proc:none"
]
}

task jaxb {
// configure Gradle up-to-date checking
inputs.dir( xsdDir ).withPropertyName("xsdDir" ).withPathSensitivity( PathSensitivity.RELATIVE )
outputs.dir( xjcTargetDir )
outputs.cacheIf { true }

// perform actions
doLast {
xjcTargetDir.mkdirs()

ant.taskdef(name: 'xjc', classname: 'org.jvnet.jaxb2_commons.xjc.XJC2Task', classpath: configurations.xjc.asPath)

ant.xjc(
destdir: ( xjcTargetDir as File ).absolutePath,
package: 'org.hibernate.jpamodelgen.xml.jaxb',
extension: 'true'
) {
project.ant.arg line: '-no-header'
project.ant.arg line: '-npa'
schema( dir: xsdDir.path, includes: "*.xsd" )
}
}
}

tasks.sourcesJar.dependsOn ':hibernate-core:generateHqlParser'
tasks.sourcesJar.dependsOn ':hibernate-core:generateSqlScriptParser'
tasks.compileJava.dependsOn jaxb

checkstyleMain.exclude '**/jaxb/**'

tasks.sourcesJar.dependsOn ':hibernate-core:generateSqlScriptParser'

0 comments on commit 957bdca

Please sign in to comment.