This message was deleted.
# configuration-cache
s
This message was deleted.
v
How do you do it with a build listener?
v
Using `BuildScanExtension.buildScanPublished`: https://docs.gradle.com/enterprise/gradle-plugin/api/com/gradle/scan/plugin/BuildScanExtension.html#buildScanPublished(org.gradle.api.Action) Sorry I'm not sure if "build listener" is the right word. This is probably a normal (non-serializable) callback
j
Maybe
FlowScope
API?
v
Did you actually try it and have problems? If so, which? I just tried it and it worked just fine.
v
I think this could be more of an issue with how I am using Talaiot plugin than Gradle CC. As part of Talaiot 2.x, the author has removed Gradle scan link capturing capability since it uses a Build listener. I'm trying to implement this as a plugin that in turn depends on Talaiot. This is quite hacky since it is using a custom Talaiot publisher which waits for
buildScanExtension.buildScanPublished
callback that is registered in a BuildService While I'm receiving the build scan URL without any issue, my
CustomPublisher
execution seems to be stopping abruptly. Attaching code gist below. I think it could be because of the way
readObject
and
writeObject
are implemented...
My other suspect is TalaiotBuildService.close() which runs
executor.execute
to run publishers but doesn't wait for their completion, so maybe this build service is shutting down prematurely
cc @Inaki Villar sorry for the abrupt tag, but would be great if you have any suggestions for me here 🙂
v
Well, yeah. No idea what Talaiot is. But if that publisher class is serialized and deserialized, obviously a new latch is created. So - but you need to check with a debugger - you maybe call the latch countdown on one publisher instance and the latch await on a different publisher instance and thus a different latch. Besides that you need to check the return value of
await
. Currently, you just wait up to 10 seconds and then continue, whether
countDown
was called or not. You probably have to get from somewhere a latch to cooperate on that it is not recreated by serilizing and deserializing.
👍 1
v
Thanks for the pointers, @Vampire Yes, I think it might be easier to fork the Talaiot project instead and modify
TalaiotBuildService
to register
buildScanPublished
and run publishers after we get the scan link. (removing the need for any latches in Publisher classes)
👌 1