I agree that it's not necessarily bad to create empty directories in this case, because than it's also available in the IDE. And because it's the base package it makes sense to put code there too, I don't think it is a broken window in this specific case.

I don't think it's necessary to add a new method to the JavaSourceFacet. It's something that only the NewProjectPlugin will use, while the JavaSourceFacet is very general (many plugins use this facet). Just create the directory in the NewProjectPlugin itself. Prompting the user for this first would be a good idea too :-)

Paul



On Dec 4, 2011, at 12:11 AM, Dan Allen wrote:

On Sat, Dec 3, 2011 at 05:01, Max Rydahl Andersen <max.andersen@redhat.com> wrote:
So you are saying if I type in x.y.z as package name you will create the empty sequence of directories:

<src>/x/y/z ?

If that is the case then I don't see the need for it before there actually is a file to put in there…?

Empty directories is a broken window.

What would be more fun is that forge would actually remember the last package name used for a command so
it would offer it as default (Lincoln - did you get that properties/config stuff in place ? :)

There is a mechanism for this. I'm using it in the Arquillian Extensions plugin.

JavaSourceFacet#getBasePackage()

That's the one that was entered at the prompt...at least it appears that way.

I don't think that creating the directories is necessarily wrong. If they open the project in the IDE immediately after creating it, then the first time they create a class it's necessary to retype the package name. It's far easier to right click on an existing package structure and create a new class.

Perhaps the user can be prompted for this option (or it can be an optional option).

new-project --named myproject --topLevelPackage org.example.myproject --createPackages

-Dan

--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597


_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev