On Wed, Apr 20, 2011 at 10:34 AM, Spencer Allain <[email protected]>wrote:
> What I was envisioning was possibly also a more generic initProject task > that basically looks at all of the sourceSets for an existing project and > simply generates the missing directory structures (which would pick up > custom adjustments to directories). > > This generic "create directory structures from existing sourceSets" > behavior was what I was trying to convey, as the other create/init tasks > have create/modify build.gradle file functions followed by a create > directory structures operation. > I really like this idea. :) It should be very easy to implement too. I'll add it to the base Templates plugin. > > An initProject task (or possibly a project method) similar to what I've > described seems like something that could easily be folded into gradle core, > and then leveraged by the more specific createJavaProject and > initJavaProject tasks that you have so usefully implemented. > > I could also readily see in the future a createXyzProject type rule that > queries the xyz plugin (or some alternative project type delegate object) as > to what really needs to be inserted into a build.grade file for it to > properly function. > This would be cool. I bet I can create some dynamic methods by asking the project for all the plugins that are applied then creating methods for "init[Plugin name]Project" which creates directories for sourceSets.*.[Plugin Name].srcDirs. Setting up the appropriate build.gradle file would be more difficult because this meta-data isn't really held anywhere ( as far as I can tell anyway). > > What you have right now is extremely useful -- everything else I've > mentioned is just thinking out loud :-) > > Ahh. Good. :) I'm very happy that it's useful, and I'm very grateful for the feedback and ideas. Please keep them coming. Cheers. Eric -- Learn from the past. Live in the present. Plan for the future. Blog: http://eric-berry.blogspot.com jEdit <http://www.jedit.org> - Programmer's Text Editor Bazaar <http://bazaar.canonical.com> - Version Control for Humans
