Best practices for laying out a Directory component project?

The perfectionist (or you may call it “nit-picker” instead, if you prefer) in me is facing a serious problem: How should I lay out a project that’s aiming to be a component in the Directory?

I have a component (server side, client side, and some css) and I have a demo application to go with them. These are in the same project for convenience. When I package this into a .jar, I’d like to have only things related to the component – and nothing more – in the jar. Thus far I have separated the CSS into two files, one for the component, and another for the application which includes the component styles.

But now my problem is the widgetset. How can I create a widgetset that only includes my component, but still being able to compile a widgetset required by the demo application? I tried to use two widgetsets, each having their own WidgetMapGenerators; one that only adds the component, and another one that inherits the component’s widgetset and adds some required widgets on top of that. This, I haven’t got working yet. It seems to include only one widgetmap generators.

A related question: once I get the thing packaged in the jar, how does the CSS-inclusion work? does it use whatever filestructure I have in my current project (e.g. @import url(“…/component/component.css”); ), or is it used in some other way, so that it doesn’t live at the same level as themes (to avoid name collision)? It seems like the theme resources, in the packaged JAR, are located in “WebContent.VAADIN.themes.foo”, which I couldn’t figure out how to reach to. When I manually changed the path to be “VAADIN.themes.foo”, I could include and refer to my component’s styles from the other project. Is this a bug?


Edit:
I seem to have troubles with two widgetsets in the same package to begin with. It always wants to insert a dependency from one to the other, even if there are no explicit linking between them (I suspect the DefaultWidgetSet doing some background-magic). I end up with widgetsets only having the component, even though the WidgetMapGenerator linked to the compiled widgetset explicitly to include more components than the one.


Observation:
Looks like it’s an extremely bad idea to use any kind of widgetmapgenerator in a widget-jar when using that jar in another project, or it will hijack the project’s widgetset.