https://kotlinlang.org logo
#ktor
Title
# ktor
c

csieflyman

08/10/2021, 4:11 AM
Hi I set ktor.deployment.watch in my project with gradle multi-projects build on windows, but I got an error. I use ktor 1.6.2
a

Aleksei Tirman [JB]

08/10/2021, 4:48 PM
Unfortunately, I cannot reproduce it on Windows using a simple server application with watch paths. Could you please file an issue with a sample project attached?
c

csieflyman

08/12/2021, 9:05 AM
@Aleksei Tirman [JB] Here is my side project on Github https://github.com/csieflyman/multi-projects-architecture-with-Ktor It might be somewhat complicated to build it due to lack of document now...
a

Aleksei Tirman [JB]

08/12/2021, 4:30 PM
Unfortunately, I cannot reproduce it. Could you please describe the steps to reproduce an error using your project?
c

csieflyman

08/15/2021, 3:11 AM
@Aleksei Tirman [JB] I check watchUrls function in ApplicationEngineEnvironmentReloading and write following code to reproduce this problem
Copy code
fun main(args: Array<String>) {

    val pathStrings = listOf(
        "file:/F:/github/fanpoll/infra/build/libs/infra-1.0.0-all.jar!/ch",
        "file:/F:/github/fanpoll/projects/ops/build/libs/ops-1.0.0-all.jar!/fanpoll",
        "file:/F:/github/fanpoll/projects/club/build/libs/club-1.0.0-all.jar!/fanpoll",
        "file:/C:/dev/IntelliJ%20IDEA%202020.2/lib/idea_rt.jar!/com",
        "/F:/github/fanpoll/app/out/production/resources/",
    )

    val paths = pathStrings.map { pathString ->
        if (pathString.startsWith("file:")) {
            Paths.get(URL(pathString).toURI())
        } else {
            val decodedPath = URLDecoder.decode(pathString, "utf-8")
            File(decodedPath).toPath()
        }
    }
    println(paths)
}
3 Views