2
0
Fork 0
mirror of https://github.com/ethauvin/rife2-hello.git synced 2025-04-25 15:37:10 -07:00

Updated for RIFE2 1.1.1.

Added RIFE2 agent and relevant instructions.
Improved README.
This commit is contained in:
Geert Bevin 2023-02-13 08:30:34 -05:00
parent 1c93546fd7
commit 44637cc6fc
3 changed files with 42 additions and 10 deletions

View file

@ -2,8 +2,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
application
java
}
base {
@ -28,7 +27,8 @@ sourceSets.main {
}
dependencies {
implementation("com.uwyn.rife2:rife2:1.1.0")
implementation("com.uwyn.rife2:rife2:1.1.1")
runtimeOnly("com.uwyn.rife2:rife2:1.1.1:agent")
runtimeOnly("org.eclipse.jetty:jetty-server:11.0.13")
runtimeOnly("org.eclipse.jetty:jetty-servlet:11.0.13")
runtimeOnly("org.slf4j:slf4j-simple:2.0.5")
@ -37,11 +37,6 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.9.1")
}
application {
// Define the main class for the application.
mainClass.set("hello.App")
}
tasks {
named<Test>("test") {
useJUnitPlatform()
@ -72,6 +67,16 @@ tasks {
dependsOn("precompileTemplates")
}
// Replace the run task with one that uses the RIFE2 agent
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")
}
// These two tasks create a self-container UberJar
register<Copy>("copyWebapp") {
from("src/main/")
@ -89,6 +94,7 @@ tasks {
}
val dependencies = configurations
.runtimeClasspath.get()
.exclude("**/rife2*-agent.jar")
.map(::zipTree)
from(dependencies, "$buildDir/webapp")
with(jar.get())