Fix build script regarding tools.jar inclusion into testCompile configuration

This commit is contained in:
Christian Beikov 2021-09-29 18:50:55 +02:00
parent d5078456a2
commit 7fd3706a18
1 changed files with 29 additions and 7 deletions

View File

@ -122,12 +122,6 @@ dependencies {
testRuntimeOnly libraries.hana
}
// Mac-specific
project.ext.toolsJar = file("${System.getProperty('java.home')}/../lib/tools.jar")
if ( project.toolsJar.exists() ) {
testCompileOnly files( project.toolsJar )
}
annotationProcessor libraries.logging_processor
annotationProcessor libraries.logging
annotationProcessor libraries.logging_annotations
@ -228,6 +222,16 @@ convention.findPlugin( JavaPluginConvention.class ).sourceSets.each { sourceSet
]
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attach tools JAR to the classpath for byteman tests
final File toolsJar = file("${System.getProperty('java.home')}/../lib/tools.jar")
if ( toolsJar.exists() ) {
dependencies{
testCompile files( toolsJar )
}
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -324,7 +328,25 @@ sourceSets {
processTestResources {
inputs.property( "db", db )
filter( ReplaceTokens, tokens: dbBundle[db] )
doLast {
copy {
from( sourceSets.test.java.srcDirs ) {
include '**/*.properties'
include '**/*.xml'
}
into sourceSets.test.java.outputDir
}
copy {
from file( 'src/test/resources' )
into file( "${buildDir}/resources/test" )
exclude 'src/test/resources/hibernate.properties'
}
copy {
from file( 'src/test/resources/hibernate.properties' )
into file( "${buildDir}/resources/test" )
filter( ReplaceTokens, tokens: dbBundle[db] )
}
}
}
// Keep system properties in sync with gradle.properties!