BuildService Singleton

Thanks for the quick response. I think that explains most of the behavior I was seeing. I had a private static final AtomicInteger variable that was incrementing every time the build service constructor is called. If I run successive builds, it increased by 1 with each build. However, if I run gradle --stop followed by the build command, it never goes above 1.

So it seems like I was only getting one instance of my build service per build, but the class was remaining in the daemon’s classloader and being re-used from one run to the next. Neat.

Question: suppose I want something akin to a build service, but I want just one per project. How do I do that? Are project extensions the best way to implement this?