what is the best way to access a service from a Wo...
# plugin-development
j
what is the best way to access a service from a WorkAction?
p
Just inject it?
👆 2
j
when i tried putting the service as a parameter to the work action, it didnt work, and the error seemed like it was due to not being serializable, but i could be wrong on that
ill take another look, thanks
m
Maybe you've bumped into https://github.com/gradle/gradle/issues/17559? BuildServices and classloaders do not mix super well
j
i have hit that one before, this was something else. I wanted to use StyledTextOutputFactory. I ended up just serializing my data, then reading it back in a separate task that uses StyledTextOutputFactory not within a work action