Skip to content

Debugging

Jason Penilla edited this page Mar 22, 2024 · 5 revisions

IntelliJ IDEA

IntelliJ's Gradle integration allows running Gradle tasks with debugging out of the box, and it will automatically attach to the correct JVM.

Hotswap

Using the JetBrains runtime we can take advantage of runtime code redefinition or "hot swapping" code.

settings.gradle.kts

plugins {
  // add toolchain resolver
  id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

build.gradle.kts

tasks.withType(xyz.jpenilla.runtask.task.AbstractRun::class) {
  javaLauncher = javaToolchains.launcherFor { 
    vendor = JvmVendorSpec.JETBRAINS
    languageVersion = JavaLanguageVersion.of(17)
  }
  jvmArgs("-XX:+AllowEnhancedClassRedefinition", "-XX:+AllowRedefinitionToAddDeleteMethods")
}

Clone this wiki locally