On 31/03/2011, at 8:03 AM, Nathan Neff wrote: > Hello, > > I've been working on this issue, and I have > a fix implemented, but would like to hear other devs' opinons. > > I moved the Wrapper and related java classes from the > subprojects/wrapper to the subprojects/core. See this commit: > > https://github.com/NathanNeff/gradle/commit/dc1ec036a6e4b4277c610cc2a4e01b01b2486cfb > > This seems a bit drastic IMHO, but after this move, it was easy to > create a built-in "wrapper" task: > https://github.com/NathanNeff/gradle/commit/892c34686abe6dc1934a1a8dc073a819b728e33f > > I have several questions: > > - What is the consequence of moving the Wrapper Java classes to the > "core" subproject?
They used to live in core, and were split out a while ago. I'd rather not move them back in, particularly as we've been gradually moving things from core. > - Should the tests for the Wrapper Java classes also be moved to the > "core" subproject? > - Should the org.gradle.api.tasks.wrapper.Wrapper class be renamed to > WrapperTask? The convention (in the Gradle codebase at least) is to not add 'Task' to a task implementation class name. > > Thanks for any input/feedback -- it will greatly help me understand the > layout and structure of the Gradle source code. Here's a potential approach to solving this problem: The goal is that we want not just the 'wrapper' task to be implicitly available, but also things like 'idea' and 'eclipse', and our future project archetype equivalent. We don't really want to move all these things to core. Instead, I think we want to have some way for the core to implicitly apply a plugin when a particular task is mentioned on the command-line. So, when you do 'gradle eclipse', and the eclipse plugin has not been applied to the project, the core will implicitly apply it. Same for idea plugin. We could potentially do the same for the wrapper. More specifically: * Add a wrapper plugin, which simply adds a Wrapper task instance. * Change the ImplicitTasksConfigurer to apply the wrapper plugin to the project. Perhaps you could change your patch to take this approach? Once we've done that, we can change things to work better: * Change the ImplicitTasksConfigurer so that it uses task rules, and remove the idea of implicit tasks. We need to rework how rules work a bit, for this to happen. * Add rules for the idea and eclipse plugin. * Maybe move the help tasks into a plugin and out of core. And later: * Maybe add some way for a plugin to register an implicit task rule with the core. This way, the core wouldn't need to know about the plugins, but instead could discover the implicit tasks. * Maybe add some way for the core to use a repository to discover these implicit task rules for external plugins. -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com
