This message was deleted.
# community-support
s
This message was deleted.
d
before:
Copy code
val buildDurationService = gradle.sharedServices.registerIfAbsent("build-duration-service", BuildDurationService::class.java) { }
after:
Copy code
val buildDurationService = gradle.sharedServices.registerIfAbsent("build-task-duration", BuildDurationService::class.java) { }
After changing name it works, so strange
v
Well, maybe it is related to that blog post being very bad? But hard to say definitley without a closer look. But you really shouldn't do what that blog post tells you. Using shared build service instead of build listeners, yes. But not by using various internal classes like that blog post instructs. It for example uses
BuildOperationListener
which is an internal class instead of
OperationCompletionListener
and also uses
DefaultGradle
which also is an implementation detail, ....
d
Not sure if it good or bad article, im not that familiar on writing custom plugin and still learn about it. Very confuse with this naming behavior can causing a bug
v
Not sure if it good or bad article
I only had a very cursory look, but it is a bad article. It recommends using internal classes, which is always a bad idea. And especially in this case where there are proper public alternatives.
Very confuse with this naming behavior can causing a bug
I don't think it does. It might be coincidence that it worked with the one name but not with the other. Maybe something else you are not aware of changed too or similar.