ktorio / ktor

Framework for quickly creating connected applications in Kotlin with minimal effort
https://ktor.io
Apache License 2.0
13k stars 1.06k forks source link

Dependency modules not auto-reloading #1232

Open ScottPierce opened 5 years ago

ScottPierce commented 5 years ago

Ktor Version and Engine Used (client or server and name) 1.2.2, server, Kotlin 1.3.41

Describe the bug Auto-reload works for the primary module with ktor in it, but won't work for dependency modules, even though I've included the paths to those modules in the watch paths.

To Reproduce I have 5 server modules:

/root
  /server
    /edge - module with ktor and the JVM main. Depends on controller and model directly
    /controller - depends on data and model module directly
    /data - depends on persist and model module directly
    /persist
    /model

The :server:edge module has the gradle application plugin attached, and I'm setting the working directory for it to root.

tasks.getByName("run") {
    workingDir = rootDir
}

The server is set to watch the paths of all 5 server modules. When the server is running and I do a build for the edge module, changes for the edge module are updated without an application restart. Changes for other modules are not updated. I have to stop the server, and run it again to get changes in other modules.

Expected behavior When a dependency is updated - auto reload would work for that module as well if it's path is set in the watchPaths list.

This is for a private project. I can invite someone to the private project if need be.

cy6erGn0m commented 5 years ago

Can you see what directories are watched actually? At the debug level all paths should be printed by log.debug("Watching $path for changes.").

oleg-larshin commented 4 years ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.