hibernate-orm/hibernate-integrationtest-j.../hibernate-integrationtest-j...

54 lines
1.5 KiB
Groovy
Raw Normal View History

/*
* 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 = 'Integration tests for running Hibernate ORM in the Java module path'
apply from: rootProject.file( 'gradle/java-module.gradle' )
java.modularity.inferModulePath = true
// In this module, the "main" code is actually just test code that happens
// to be built independently so as to generate a Java module.
// So, let's override settings for compilation of the main code, just for this particular case.
def testJavaVersions = gradle.ext.javaVersions.test
tasks.compileJava {
if ( !gradle.ext.javaToolchainEnabled ) {
sourceCompatibility = JavaVersion.toVersion( testJavaVersions.release )
targetCompatibility = JavaVersion.toVersion( testJavaVersions.release )
}
else {
javaCompiler = javaToolchains.compilerFor {
languageVersion = testJavaVersions.compiler
}
// Remove JDK8-only options (if any) that are incompatible with options.release
for ( it = options.compilerArgs.listIterator(); it.hasNext(); ) {
if ( it.next() in ['-source', '-target'] ) {
it.remove()
it.next()
it.remove()
}
}
options.release = testJavaVersions.release.asInt()
}
}
// Checkstyle fails for module-info
checkstyleMain.exclude '**/module-info.java'
dependencies {
api project( ':hibernate-core' )
api project( ':hibernate-envers' )
implementation libraries.jpa
}
test {
useJUnit()
}