When I had a quick go at making the 'create' task yesterday, I used the
plugin variables to provide the skeleton structure for me:

Java Plugin: srcDirs, resourceDirs, testSrcDirs, testResourceDirs
Groovy Plugin: groovySrcDirs, groovyTestSrcDirs

- These could easily be redefined in build.gradle before calling the create
task.

But what I was after by using the command line was to be able to also create
a skeleton build.gradle file. I would find it easier to have the file
(build.gradle) created and have to amend/add to it rather than create it
from scratch each time I started a new project (IMHO).

Admittedly I need to spend some time looking at the current Gradle source to
see what approach would be a best fit. Nothing to say both approaches
couldn't work:
 
    1) If there are command line variables and no build.gradle do one
approach
    2) If build.gradle does exist use the defaults defined in that.

R.

Tom Eyckmans wrote:
> 
> I think it would be interesting to have something like the archetypes but
> to
> prevent Gradle from forcing a certain structure on users, we might add a
> Gradle twist to it.
> Lets say you want to start a new project you create the build.gradle file
> with just the basics e.g:
> 
> usePlugin('java')
> 
> + where you want the source / test dirs / libs ... to be, if they are not
> specified the defaults are used and you have the effect of an archetype
> without the extras
> + libraries that you are going to need
> 
> then you run gradle init or something like it and dirs are
> created/libraries
> downloaded/ ... depending on the plugins there can be additional artifacts
> that are created thinking of project files.
> 
> This way we don't force the structure and don't require users to know
> additional command line stuff.
> 
> 2009/2/4 Richard Walker <[email protected]>
> 
>>
>>
>> This is what I was hoping to get away from.
>>
>> At the first hurdle having to manually create the directories and files
>> or
>> having to drop into Maven to get started puts me off.
>>
>> I think it would be a real seller if I could create all the files and
>> directories I needed (including the skeleton gradle.build) from just a
>> command (or two).
>>
>> I only used Maven as an example but I was mindful other projects have the
>> facility to take care of many of these manual tasks (e.g. Grails and
>> scaffolding).
>>
>> After all the gradle motto is:
>> impossible possible, the possible easy, and the easy elegant.
>>
>> Regards, Richard.
>>
>> Ps. I'd be quite happy to write some of this myself - just want to know
>> if
>> it's something that people would go for.
>>
>>
>> Raphaël wrote:
>> >
>> > The maven archetype plugin could help you there.
>> >
>> > It is language agnostic, the only thing needed is a pom.xml (which
>> could
>> > be
>> > minimal if you use graddle)
>> >
>> > What you have to do is just to create a archetype.
>> >
>> > Regards,
>> >
>> > Raphaël
>> >
>> > 2009/2/4 Richard Walker <[email protected]>
>> >
>> >>
>> >> Are there any archetype-like features in gradle that will allow me to
>> >> quickly
>> >> create a project, it's folders and basic dependencies with a command
>> >> similar
>> >> to that I'd find in Maven 2?
>> >>
>> >> eg. gradle -DgroupId=test.com -DprojectName=BasicProject
>> >> -Dproject.type=groovy create
>> >>
>> >> Would there be any interest in creating such a feature?
>> >>
>> >> Cheers, Richard.
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Gradle-Archetypes--tp21826454p21826454.html
>> >> Sent from the gradle-user mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe from this list, please visit:
>> >>
>> >>    http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Gradle-Archetypes--tp21826454p21828622.html
>> Sent from the gradle-user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Gradle-Archetypes--tp21826454p21831735.html
Sent from the gradle-user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to