On 07/08/2012, at 1:43 PM, GitHub wrote: > Branch: refs/heads/master > Home: https://github.com/gradle/gradle > Commit: 765df053f3009908e345b0a3ae8334b424a055c3 > > https://github.com/gradle/gradle/commit/765df053f3009908e345b0a3ae8334b424a055c3 > Author: Adam Murdoch <[email protected]> > Date: 2012-08-06 (Mon, 06 Aug 2012) > > Changed paths: > M > subprojects/core/src/main/groovy/org/gradle/api/internal/project/ProjectInternalServiceRegistry.java > M > subprojects/core/src/test/groovy/org/gradle/api/internal/project/ProjectInternalServiceRegistryTest.java > > Log Message: > ----------- > Support jsr-330 style dependency injection into task constructors.
This means we can now inject services into task and plugin constructors, instead of using AbstractProject.getServices() or AbstractTask.getServices(). Currently, there are only internal services available, but this now gives us a place to start providing public services without jamming more stuff onto Project or Task. Some things to note: * Factory<SomeType> doesn't work. You'll end up with an arbitrary factory, rather than one that creates SomeType instances. * Only global and project scoped services are available via injection. * Doesn't work with extensions or any other things that Gradle instantiates (elements in a domain object container, etc). These caveats will go away soon-ish. The getServices() methods will also be deprecated soon. -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com
