It seems that with the update to new development m...
# ktor
p
It seems that with the update to new development mode in ktor 1.5.x the possibility of auto-reloading using an unlinkable extension method (Application::myInit) disappeared and only initialization using the module name is working (“io.ktor.application.modules = [..]). I can reproduce this on mac os using multiple jdk versions. the responsible source code seems to confirm this:
Copy code
private fun instantiateAndConfigureApplication(currentClassLoader: ClassLoader): Application {
    val newInstance = Application(this)
    safeRiseEvent(ApplicationStarting, newInstance)

    avoidingDoubleStartup {
        configModulesNames.forEach { name ->
     // COMMENT: this works and properly reloads the application
            launchModuleByName(name, currentClassLoader, newInstance)
        }
    }

  // COMMENT: functions like Application#initApp are initialized here and do not seem to reload (they also are not loaded by the 'currentClassLoader')
  modules.forEach { it(newInstance) }

    safeRiseEvent(ApplicationStarted, newInstance)
    return newInstance
}

// source for configModuleNames:
    private val configModulesNames: List<String> = run {
        config.propertyOrNull("ktor.application.modules")?.getList() ?: emptyList()
    }