Trigger hot reload manually?

Answered

When using Gradle, building the project triggers the `classes` and `testClasses` tasks for the root project and all sub-projects. We require a custom task that disables another task which is called down the task graph of `classes` on one of our sub-projects. The problem is, since this task is executed as a run, not a build, IntelliJ does not hot reload the changes in debug mode.

Is there a way to manually trigger the hot swap, without executing the `classes` and `testClasses` tasks?

0
2 comments

I created this custom task:

create("buildWithoutVaadin") {
    doFirst {
        vaadinPrepareFrontend {
            enabled = false
        }
    }
    finalizedBy(":classes", ":webapp:classes", ":webapp:webappResourceClasses")
}

If I run with JRebel debug, after I run the task, JRebel performs the hot reload. This obviously works because JRebel watches the Gradle build directory for changes.

Is there a way to accomplish the same with IntelliJ's debugger?

0
Does it help if you switch to using IntelliJ IDEA to build and run the code instead of Gradle, from File | Settings | Build, Execution, Deployment | Build Tools | Gradle settings?

See also https://stackoverflow.com/questions/6402162/how-to-enable-intellij-hot-code-swap
0

Please sign in to leave a comment.