mirror of
https://github.com/ethauvin/rife2-hello.git
synced 2025-04-25 07:27:12 -07:00
Made tests use the java agent
This commit is contained in:
parent
44637cc6fc
commit
d375b99c48
1 changed files with 11 additions and 8 deletions
|
@ -38,7 +38,14 @@ dependencies {
|
|||
}
|
||||
|
||||
tasks {
|
||||
named<Test>("test") {
|
||||
val dependencies = configurations
|
||||
.runtimeClasspath.get().files;
|
||||
val rifeAgentJar = dependencies
|
||||
.filter { it.toString().contains("rife2") }
|
||||
.filter { it.toString().endsWith("-agent.jar") }[0]
|
||||
|
||||
test {
|
||||
jvmArgs = listOf("-javaagent:$rifeAgentJar")
|
||||
useJUnitPlatform()
|
||||
testLogging {
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
|
@ -71,9 +78,6 @@ tasks {
|
|||
register<JavaExec>("run") {
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
mainClass.set("hello.App")
|
||||
val rifeAgentJar = configurations.runtimeClasspath.get().files
|
||||
.filter { it.toString().contains("rife2") }
|
||||
.filter { it.toString().endsWith("-agent.jar") }[0]
|
||||
jvmArgs = listOf("-javaagent:$rifeAgentJar")
|
||||
}
|
||||
|
||||
|
@ -92,11 +96,10 @@ tasks {
|
|||
manifest {
|
||||
attributes["Main-Class"] = "hello.AppUber"
|
||||
}
|
||||
val dependencies = configurations
|
||||
.runtimeClasspath.get()
|
||||
.exclude("**/rife2*-agent.jar")
|
||||
val uberDependencies = dependencies
|
||||
.filter { !it.toString().matches("rife2-.*agent\\.jar".toRegex()) }
|
||||
.map(::zipTree)
|
||||
from(dependencies, "$buildDir/webapp")
|
||||
from(uberDependencies, "$buildDir/webapp")
|
||||
with(jar.get())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue