2015-05-19 00:23:35 -04:00
|
|
|
/*
|
|
|
|
* Hibernate, Relational Persistence for Idiomatic Java
|
|
|
|
*
|
|
|
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
|
|
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
|
|
|
*/
|
2024-02-24 14:45:38 -05:00
|
|
|
description = 'Hibernate compile-time tooling'
|
2020-04-06 13:21:11 -04:00
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
2013-10-25 15:27:45 -04:00
|
|
|
apply plugin: 'version-injection'
|
|
|
|
|
2023-11-07 12:38:20 -05:00
|
|
|
java {
|
|
|
|
sourceCompatibility = jdks.versions.getBaseline( )
|
|
|
|
targetCompatibility = 17
|
2013-10-25 15:27:45 -04:00
|
|
|
}
|
|
|
|
|
2023-11-07 12:38:20 -05:00
|
|
|
//configurations {
|
|
|
|
// modelImplementation {
|
|
|
|
// extendsFrom implementation
|
|
|
|
// }
|
|
|
|
// modelAnnotationProcessor {
|
|
|
|
// extendsFrom annotationProcessor
|
|
|
|
// }
|
|
|
|
// testImplementation {
|
|
|
|
// extendsFrom modelImplementation
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
2024-02-26 09:33:13 -05:00
|
|
|
sourceSets {
|
|
|
|
quarkusOrmPanache {
|
|
|
|
java {
|
|
|
|
srcDirs = ['src/quarkusOrmPanache/java']
|
|
|
|
}
|
|
|
|
resources {
|
2024-05-30 08:23:38 -04:00
|
|
|
srcDirs sourceSets.main.resources
|
2024-02-26 09:33:13 -05:00
|
|
|
}
|
|
|
|
compileClasspath += sourceSets.main.output + sourceSets.test.output
|
|
|
|
runtimeClasspath += sourceSets.main.output + sourceSets.test.output
|
|
|
|
}
|
|
|
|
quarkusHrPanache {
|
|
|
|
java {
|
|
|
|
srcDirs = ['src/quarkusHrPanache/java']
|
|
|
|
}
|
|
|
|
resources {
|
2024-05-30 08:23:38 -04:00
|
|
|
srcDirs sourceSets.main.resources
|
2024-02-26 09:33:13 -05:00
|
|
|
}
|
|
|
|
compileClasspath += sourceSets.main.output + sourceSets.test.output
|
|
|
|
runtimeClasspath += sourceSets.main.output + sourceSets.test.output
|
|
|
|
}
|
2024-03-01 14:04:13 -05:00
|
|
|
jakartaData {
|
|
|
|
java {
|
|
|
|
srcDirs = ['src/jakartaData/java']
|
|
|
|
}
|
|
|
|
resources {
|
2024-05-30 08:23:38 -04:00
|
|
|
srcDirs sourceSets.main.resources
|
2024-03-01 14:04:13 -05:00
|
|
|
}
|
|
|
|
compileClasspath += sourceSets.main.output + sourceSets.test.output
|
|
|
|
runtimeClasspath += sourceSets.main.output + sourceSets.test.output
|
|
|
|
}
|
2024-02-28 09:29:25 -05:00
|
|
|
}
|
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
dependencies {
|
2023-11-17 14:11:24 -05:00
|
|
|
// api - ewww... but Maven needs them this way
|
|
|
|
api project( ':hibernate-core' )
|
2024-03-24 06:40:16 -04:00
|
|
|
api libs.hcann
|
|
|
|
api libs.jandex
|
2023-11-16 06:54:58 -05:00
|
|
|
api jakartaLibs.jaxbApi
|
|
|
|
api jakartaLibs.jaxb
|
|
|
|
api jakartaLibs.validation
|
|
|
|
api jakartaLibs.annotation
|
|
|
|
api libs.antlrRuntime
|
|
|
|
api libs.byteBuddy
|
2024-03-24 06:40:16 -04:00
|
|
|
api libs.logging
|
2018-10-15 04:55:56 -04:00
|
|
|
|
2024-02-26 09:33:13 -05:00
|
|
|
quarkusOrmPanacheImplementation "io.quarkus:quarkus-hibernate-orm-panache:3.6.2"
|
|
|
|
quarkusHrPanacheImplementation "io.quarkus:quarkus-hibernate-reactive-panache:3.6.2"
|
2024-06-12 04:40:19 -04:00
|
|
|
jakartaDataImplementation "jakarta.data:jakarta.data-api:1.0.0"
|
2024-03-25 09:41:55 -04:00
|
|
|
jakartaDataImplementation "org.hibernate.reactive:hibernate-reactive-core:2.2.2.Final"
|
2024-04-18 09:43:27 -04:00
|
|
|
jakartaDataImplementation "io.quarkus:quarkus-hibernate-orm-panache:3.6.2"
|
2024-02-26 09:33:13 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// The source set gets a custom configuration which extends the normal test implementation config
|
|
|
|
configurations {
|
|
|
|
quarkusOrmPanacheImplementation.extendsFrom(testImplementation)
|
|
|
|
quarkusOrmPanacheRuntimeOnly.extendsFrom(testRuntimeOnly)
|
|
|
|
quarkusOrmPanacheCompileOnly.extendsFrom(testCompileOnly)
|
|
|
|
quarkusHrPanacheImplementation.extendsFrom(testImplementation)
|
|
|
|
quarkusHrPanacheRuntimeOnly.extendsFrom(testRuntimeOnly)
|
|
|
|
quarkusHrPanacheCompileOnly.extendsFrom(testCompileOnly)
|
2024-03-01 14:04:13 -05:00
|
|
|
jakartaDataImplementation.extendsFrom(testImplementation)
|
|
|
|
jakartaDataRuntimeOnly.extendsFrom(testRuntimeOnly)
|
|
|
|
jakartaDataCompileOnly.extendsFrom(testCompileOnly)
|
2024-02-28 09:29:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
def quarkusOrmPanacheTestTask = tasks.register( 'quarkusOrmPanacheTest', Test ) {
|
|
|
|
description = 'Runs the Quarkus ORM Panache tests.'
|
|
|
|
group = 'verification'
|
|
|
|
|
2024-02-26 09:33:13 -05:00
|
|
|
testClassesDirs = sourceSets.quarkusOrmPanache.output.classesDirs
|
|
|
|
classpath = sourceSets.quarkusOrmPanache.runtimeClasspath
|
2024-02-28 09:29:25 -05:00
|
|
|
shouldRunAfter test
|
|
|
|
}
|
|
|
|
|
|
|
|
def quarkusHrPanacheTestTask = tasks.register( 'quarkusHrPanacheTest', Test ) {
|
|
|
|
description = 'Runs the Quarkus HR Panache tests.'
|
|
|
|
group = 'verification'
|
|
|
|
|
2024-02-26 09:33:13 -05:00
|
|
|
testClassesDirs = sourceSets.quarkusHrPanache.output.classesDirs
|
|
|
|
classpath = sourceSets.quarkusHrPanache.runtimeClasspath
|
2024-02-28 09:29:25 -05:00
|
|
|
shouldRunAfter test
|
2018-01-10 16:06:58 -05:00
|
|
|
}
|
|
|
|
|
2024-03-01 14:04:13 -05:00
|
|
|
def jakartaDataTestTask = tasks.register( 'jakartaDataTest', Test ) {
|
|
|
|
description = 'Runs the Jakarta Data tests.'
|
|
|
|
group = 'verification'
|
|
|
|
|
|
|
|
testClassesDirs = sourceSets.jakartaData.output.classesDirs
|
|
|
|
classpath = sourceSets.jakartaData.runtimeClasspath
|
|
|
|
shouldRunAfter test
|
|
|
|
}
|
|
|
|
|
2024-02-28 09:29:25 -05:00
|
|
|
check.dependsOn quarkusHrPanacheTestTask
|
|
|
|
check.dependsOn quarkusOrmPanacheTestTask
|
2024-02-29 05:55:14 -05:00
|
|
|
test.dependsOn quarkusHrPanacheTestTask
|
|
|
|
test.dependsOn quarkusOrmPanacheTestTask
|
2024-02-28 09:29:25 -05:00
|
|
|
|
2013-10-25 15:27:45 -04:00
|
|
|
sourceSets.main {
|
2023-11-07 12:38:20 -05:00
|
|
|
java.srcDir xjcTargetDir
|
2013-11-24 16:16:12 -05:00
|
|
|
resources.srcDir xsdDir
|
2013-10-25 15:27:45 -04:00
|
|
|
}
|
|
|
|
|
2013-11-22 20:46:05 -05:00
|
|
|
compileTestJava {
|
2023-11-07 12:38:20 -05:00
|
|
|
options.compilerArgs += [
|
|
|
|
"-proc:none",
|
|
|
|
"-AsuppressJakartaDataMetamodel=true"
|
2013-11-22 20:46:05 -05:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2023-04-03 04:37:58 -04:00
|
|
|
// Tests with records
|
2023-08-07 21:05:47 -04:00
|
|
|
if ( jdkVersions.test.release.asInt() >= 17 && jdkVersions.explicit ) {
|
2023-04-03 04:37:58 -04:00
|
|
|
// We need to configure the source and target version to 17
|
2024-03-05 03:44:12 -05:00
|
|
|
def testCompilerConfig = {
|
|
|
|
javaCompiler = javaToolchains.compilerFor {
|
|
|
|
languageVersion = jdkVersions.test.compile
|
|
|
|
}
|
|
|
|
sourceCompatibility = 17
|
|
|
|
targetCompatibility = 17
|
|
|
|
}
|
|
|
|
|
2023-04-03 04:37:58 -04:00
|
|
|
compileTestJava {
|
2024-03-05 03:44:12 -05:00
|
|
|
configure testCompilerConfig
|
2023-04-03 04:37:58 -04:00
|
|
|
}
|
|
|
|
|
2024-03-05 03:44:12 -05:00
|
|
|
compileQuarkusOrmPanacheJava {
|
|
|
|
configure testCompilerConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
compileQuarkusHrPanacheJava {
|
|
|
|
configure testCompilerConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
compileJakartaDataJava {
|
|
|
|
configure testCompilerConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
def testLauncherConfig = {
|
|
|
|
javaLauncher = javaToolchains.launcherFor {
|
|
|
|
languageVersion = jdkVersions.test.launcher
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-03 04:37:58 -04:00
|
|
|
test {
|
2024-03-05 03:44:12 -05:00
|
|
|
configure testLauncherConfig
|
2023-04-03 04:37:58 -04:00
|
|
|
}
|
2024-03-05 03:44:12 -05:00
|
|
|
|
|
|
|
quarkusOrmPanacheTest {
|
|
|
|
configure testLauncherConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
quarkusHrPanacheTest {
|
|
|
|
configure testLauncherConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
jakartaDataTest {
|
|
|
|
configure testLauncherConfig
|
|
|
|
}
|
2024-02-24 14:45:38 -05:00
|
|
|
}
|
|
|
|
else {
|
2023-04-03 04:37:58 -04:00
|
|
|
sourceSets {
|
|
|
|
test {
|
|
|
|
java {
|
|
|
|
exclude '**/records/*.java'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-10-25 15:27:45 -04:00
|
|
|
task jaxb {
|
2023-11-07 12:38:20 -05:00
|
|
|
// 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.processor.xml.jaxb',
|
|
|
|
extension: 'true'
|
|
|
|
) {
|
|
|
|
project.ant.arg line: '-no-header'
|
|
|
|
project.ant.arg line: '-npa'
|
|
|
|
schema( dir: xsdDir.path, includes: "*.xsd" )
|
|
|
|
}
|
|
|
|
}
|
2013-10-25 15:27:45 -04:00
|
|
|
}
|
2023-11-07 12:38:20 -05:00
|
|
|
|
2023-08-03 09:38:03 -04:00
|
|
|
tasks.sourcesJar.dependsOn ':hibernate-core:generateHqlParser'
|
|
|
|
tasks.sourcesJar.dependsOn ':hibernate-core:generateSqlScriptParser'
|
2015-04-09 22:42:42 -04:00
|
|
|
tasks.compileJava.dependsOn jaxb
|
2013-10-25 15:27:45 -04:00
|
|
|
|
|
|
|
checkstyleMain.exclude '**/jaxb/**'
|
|
|
|
|