mirror of
https://github.com/ethauvin/rife2-hello.git
synced 2025-04-25 15:37:10 -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 {
|
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()
|
useJUnitPlatform()
|
||||||
testLogging {
|
testLogging {
|
||||||
exceptionFormat = TestExceptionFormat.FULL
|
exceptionFormat = TestExceptionFormat.FULL
|
||||||
|
@ -71,9 +78,6 @@ tasks {
|
||||||
register<JavaExec>("run") {
|
register<JavaExec>("run") {
|
||||||
classpath = sourceSets["main"].runtimeClasspath
|
classpath = sourceSets["main"].runtimeClasspath
|
||||||
mainClass.set("hello.App")
|
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")
|
jvmArgs = listOf("-javaagent:$rifeAgentJar")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,11 +96,10 @@ tasks {
|
||||||
manifest {
|
manifest {
|
||||||
attributes["Main-Class"] = "hello.AppUber"
|
attributes["Main-Class"] = "hello.AppUber"
|
||||||
}
|
}
|
||||||
val dependencies = configurations
|
val uberDependencies = dependencies
|
||||||
.runtimeClasspath.get()
|
.filter { !it.toString().matches("rife2-.*agent\\.jar".toRegex()) }
|
||||||
.exclude("**/rife2*-agent.jar")
|
|
||||||
.map(::zipTree)
|
.map(::zipTree)
|
||||||
from(dependencies, "$buildDir/webapp")
|
from(uberDependencies, "$buildDir/webapp")
|
||||||
with(jar.get())
|
with(jar.get())
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue