This message was deleted.
# community-support
s
This message was deleted.
w
What kind of loop? Does the finalizer task change something of the original tasks’ output?
v
Kind of, see his thread right above this one. He now has a task that copies project dependency compile output to the dependee compile output directory and makes
build
finalized by that task. 😕 The question is, what is the proper way to get ktor hot-reload working properly.
w
Is it possible to have a different location where both compile outputs can be copied to and ktor picks up those changes?
v
Given the work-around in the issue @David Smith linked to the place where ktor looks at seems to be configurable.
d
I could not see any way to configure the root location that ktor picks up though, their docs only say you can advise what locations inside the
build
directory, not where this
build
directory is
I imagine it’s possible but I couldn’t find any guidance @Vampire
v
I just assumed the
ktor.deployment.watch = [ /build/classes/ ]
in
application.conf
in the work-around in the issue you mentioned would do that. But as I said, I'm not using ktor, so I don't know
d
the thing is that it wants
Copy code
ktor.deployment.watch = [ classes ]
i.e. not the
/build/
part
so if I want to put these files somewhere else, I suppose I could copy them into
/build/dev
or something
v
Did you try? Maybe it works because of the
/
in the beginning. As I said, I'm just guessing here from what I see in that issue work-around. But yeah, if it has to be something in
build
, that's not too bad either, as I wouldn't put build output anywhere else anyway. 🙂
d
ok, I had a try and it seems that either it doesn’t like and ignores entries like
../../../mymodule/build/libs
or doesn’t reload jar files (since the module is packaged up into a jar file)
I just checked and the jar file does get updated correctly but I guess ktor doesn’t reload jars
v
I'd guess you then need something like
../../../mymodule/build/classes/
or similar
d
I tried that but I think the issue is that it still doesn’t reload the jar, so I think there might be no escape from doing something like what I’ve done and manually provide the class files etc instead of the jar. If I put these files somewhere other than the build directory then I guess I can just add it to the classpath in the JavaExec job?
yes, that worked!
so I added the following to my ktor config
Copy code
val watchPaths = listOf("classes", "resources", "$workingDirectory/output")
and in gradle I changed my copy task to copy the files to an “output” directory which is not in the build directory
added it to the classpath in the JavaExec task and voila!
thanks for your help and encouragement @Vampire and @wolfs
👌 1