felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan D. Cabrera" <l...@toolazydogs.com>
Subject Re: Repository/package structure
Date Fri, 02 Dec 2005 09:16:34 GMT
Alex Karasulu wrote, On 12/1/2005 2:46 PM:

> Enrique Rodriguez wrote:
>
>> Thomas Watson wrote:
>>
>>> This is a usecase for fragments, right?  You do not want to package
>>> your testcase code in with your normal bundle.  Your testcase code 
>>> is contained in a fragment of the bundle you are testing.  This will 
>>> give you package level access even though the code is contained in 
>>> another bundle fragment.  Some of junit tests in Eclipse use this 
>>> same approach.  In Eclipse the tests are stored in a completely 
>>> separate project directory.  This is because Eclipse keeps a 1-to-1 
>>> mapping between projects and bundles.
>>
>>
>> ...
>>
>> I agree I don't want to package my testcase code into my bundle.  But 
>> I can achieve this with include/excludes in Ant/Maven.  What do I 
>> gain by adopting a fragment-based strategy?  I am new to fragments so 
>> I am asking to learn more, not question your statements.  I like the 
>> mental picture I'm getting, but the only visible benefit I can come 
>> up with is the simplification of the source folder hierarchy, eg 
>> collapsing the 'src/main/java' and 'src/test/java' of Maven 2 to just 
>> 'src/' by virtue of demarcing code by bundle or fragment.  In lieu of 
>> actually launching into experimental coding with fragments, what 
>> other benefits or use cases can you enumerate?
>
>
> With src/ and test/ folders where would resources for the bundle and 
> test resources go?  I think this drove maven peeps to use src/main and 
> src/test base directories underwhich you can have src/main/resources 
> and src/test/resources.  I worry a bit if we are using maven and yet 
> diverging from it's standard layout.  I've always gotten burnt by 
> doing this. 

I'm glad you brought this up.  Maven 2 is great if you do things the 
maven 2 way.  Things go really bad, if you try to adopt your own 
strategy.  This is a good thing. imho, since maven 2 is kindof a revolt 
against the millions of ways that ant projects can be setup.

Here is what would be a vanilla maven 2 setup:

   trunk/
      felix-framework/
      felix-shell/
      felix-shell-tui/
      felix-bundlerepository/
      felix-http-jetty/
      felix-prefs-jndi/
      felix-upnp/
      felix-log-simple/
      felix-log-postgres/

Each project would have the following structure

src/
    main/
        java/
            org/apache/felix/...
        resources/
    test/
        java/
            org/apache/felix/...
        resources/

Anything that's in test, never makes it into the bundle that's produced.


Regards,
Alan




Mime
View raw message