2021-06-26 09:46:09 -04:00
|
|
|
import org.hibernate.orm.jakarta.JakartaDirectoryTransformation
|
|
|
|
import org.hibernate.orm.jakarta.JakartaJarTransformation
|
2021-04-22 12:15:45 -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>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
description = 'Hibernate\'s entity version (audit/history) support Jakarta edition'
|
|
|
|
|
2021-06-16 10:55:38 -04:00
|
|
|
apply from: rootProject.file( 'gradle/jakarta-java-module.gradle' )
|
2021-04-22 12:15:45 -04:00
|
|
|
|
2021-06-26 09:46:09 -04:00
|
|
|
evaluationDependsOn( ':hibernate-envers' )
|
2021-04-22 12:15:45 -04:00
|
|
|
|
|
|
|
dependencies {
|
2021-06-26 09:46:09 -04:00
|
|
|
api( project( ':hibernate-core-jakarta' ) ) {
|
2021-04-22 12:15:45 -04:00
|
|
|
// Exclude access to this to avoid future use.
|
|
|
|
exclude group: "org.javassist", module: "javassist"
|
|
|
|
}
|
|
|
|
|
2021-06-26 09:46:09 -04:00
|
|
|
testImplementation( project( ':hibernate-envers-jakarta' ) )
|
|
|
|
testImplementation( project( ':hibernate-testing-jakarta' ) )
|
|
|
|
testImplementation( project( path: ':hibernate-core-jakarta', configuration: 'tests' ) )
|
|
|
|
}
|
|
|
|
|
2021-04-22 12:15:45 -04:00
|
|
|
|
2021-06-26 09:46:09 -04:00
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// main jar
|
|
|
|
|
|
|
|
tasks.jar {
|
|
|
|
enabled false
|
2021-04-22 12:15:45 -04:00
|
|
|
}
|
|
|
|
|
2021-06-26 09:46:09 -04:00
|
|
|
task jakartafyJar( type: JakartaJarTransformation ) {
|
|
|
|
sourceJar = project(':hibernate-envers').tasks.jar.archiveFile
|
|
|
|
targetJar = tasks.jar.archiveFile
|
2021-04-22 12:15:45 -04:00
|
|
|
}
|
|
|
|
|
2021-06-26 09:46:09 -04:00
|
|
|
tasks.jar.dependsOn project(':hibernate-envers').tasks.jar
|
|
|
|
tasks.jar.finalizedBy tasks.jakartafyJar
|
|
|
|
tasks.jakartafyJar.dependsOn tasks.jar
|
|
|
|
tasks.jakartafyJar.mustRunAfter tasks.jar
|
|
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// javadoc jar
|
|
|
|
|
|
|
|
tasks.javadocJar {
|
|
|
|
enabled false
|
2021-05-07 03:50:35 -04:00
|
|
|
}
|
|
|
|
|
2021-06-26 09:46:09 -04:00
|
|
|
task jakartafyJavadocJar( type: JakartaJarTransformation ) {
|
|
|
|
sourceJar = project(':hibernate-envers').tasks.javadocJar.archiveFile
|
|
|
|
targetJar = tasks.javadocJar.archiveFile
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.javadocJar.dependsOn project(':hibernate-envers').tasks.javadocJar
|
|
|
|
tasks.javadocJar.finalizedBy tasks.jakartafyJavadocJar
|
|
|
|
tasks.jakartafyJavadocJar.dependsOn tasks.javadocJar
|
|
|
|
tasks.jakartafyJavadocJar.mustRunAfter tasks.javadocJar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// sources jar
|
|
|
|
|
|
|
|
tasks.sourcesJar {
|
|
|
|
enabled false
|
|
|
|
}
|
|
|
|
|
|
|
|
task jakartafySourcesJar( type: JakartaJarTransformation ) {
|
|
|
|
sourceJar = project(':hibernate-envers').tasks.sourcesJar.archiveFile
|
|
|
|
targetJar = tasks.javadocJar.archiveFile
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.sourcesJar.dependsOn project(':hibernate-envers').tasks.sourcesJar
|
|
|
|
tasks.sourcesJar.finalizedBy tasks.jakartafySourcesJar
|
|
|
|
tasks.jakartafySourcesJar.dependsOn tasks.sourcesJar
|
|
|
|
tasks.jakartafySourcesJar.mustRunAfter tasks.sourcesJar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// testing
|
|
|
|
|
|
|
|
project.ext {
|
|
|
|
testClassesUnpackTargetDirectory = project.layout.buildDirectory.dir( 'jakarta/unpack/classes' )
|
|
|
|
testClassesTransformationTargetDirectory = project.layout.buildDirectory.dir( 'jakarta/test/classes' )
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.compileTestJava {
|
|
|
|
enabled false
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.processTestResources {
|
|
|
|
enabled false
|
|
|
|
}
|
|
|
|
|
|
|
|
task unpackTests(type: Copy) {
|
|
|
|
from zipTree( project( ':hibernate-envers' ).tasks.testJar.archiveFile )
|
|
|
|
into project.testClassesUnpackTargetDirectory
|
|
|
|
}
|
|
|
|
|
|
|
|
task jakartafyTests(type: JakartaDirectoryTransformation) {
|
|
|
|
sourceDirectory = project.testClassesUnpackTargetDirectory
|
|
|
|
targetDirectory = project.testClassesTransformationTargetDirectory
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tasks.compileTestJava.dependsOn tasks.unpackTests
|
|
|
|
tasks.compileTestJava.finalizedBy tasks.jakartafyTests
|
|
|
|
|
|
|
|
tasks.unpackTests.dependsOn project(':hibernate-envers').tasks.testJar
|
|
|
|
|
|
|
|
tasks.jakartafyTests.dependsOn tasks.unpackTests
|
|
|
|
|
|
|
|
tasks.test {
|
|
|
|
dependsOn tasks.jakartafyTests
|
|
|
|
testClassesDirs += project.files( tasks.jakartafyTests.targetDirectory )
|
|
|
|
classpath += project.files( tasks.jakartafyTests.targetDirectory )
|
|
|
|
|
2021-05-07 03:50:35 -04:00
|
|
|
systemProperty 'file.encoding', 'utf-8'
|
|
|
|
|
|
|
|
if ( gradle.ext.javaVersions.test.launcher.asInt() >= 9 ) {
|
|
|
|
// See org.hibernate.boot.model.naming.NamingHelperTest.DefaultCharset.set
|
|
|
|
jvmArgs( ['--add-opens', 'java.base/java.nio.charset=ALL-UNNAMED'] )
|
|
|
|
// Weld needs this to generate proxies
|
|
|
|
jvmArgs( ['--add-opens', 'java.base/java.security=ALL-UNNAMED'] )
|
|
|
|
jvmArgs( ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] )
|
|
|
|
}
|
2021-06-26 09:46:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.test.dependsOn project( ':hibernate-transaction-client' ).tasks.jar
|
|
|
|
|
|
|
|
task testJar(type: Jar, dependsOn: testClasses) {
|
|
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
|
|
archiveClassifier.set( 'test' )
|
|
|
|
from sourceSets.test.output
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
tests tasks.testJar
|
|
|
|
}
|