discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Location of bundles


From: Nicola Pero
Subject: Location of bundles
Date: Mon, 11 Dec 2000 21:34:16 +0100 (CET)

Hi

Is there any standardization about where bundles should go ?

I am talking about apps or libraries which use bundles to implement
`loadable modules'.  I think this should be quite standardized between
apps and libraries.


For example - ProjectCenter - I see when installed it is putting his
bundles in

$(GNUSTEP_LOCAL_ROOT)/Library/ProjectCenter/ 

which is fine for me - so I suppose for example I should also put eg
GSTest's bundles in

$(GNUSTEP_XXX_ROOT)/Library/GSTest/

But then - how do I retrieve them in the app ? I think I should get
$GNUSTEP_SYSTEM_ROOT, $GNUSTEP_LOCAL_ROOT, $GNUSTEP_NETWORK_ROOT and
$GNUSTEP_USER_ROOT from the environment and then build from these the
paths and then look for the bundles in each path.

But - my question is - if we agree on some standard location of this kind
- then wouldn't it make more sense to have methods in NSBundle doing the
work for you ?  This would make sure the stuff is centralized, standard,
and easy to use.  <I am willing to just write the code myself to do it if
there is some agreement on the bundle location and the fact that it is
appropriate to write the code.>

Perhaps we need one method to get a list of bundles for a particular path,
something like: 

[NSBundle bundlesWithGNUstepPath: @"GSTest"];

which returns all the bundles in $(GNUSTEP_xxx_ROOT)/Library/GSTest/,
where `xxx' is in turn SYSTEM, LOCAL, NETWORK, and USER.  The typical app
would loop on all these bundles and load them all.  If it has specific
bundles for different things, it can use subpaths, as in:

[NSBundle bundlesWithGNUstepPath: @"GSTest/GenericTests"];
[NSBundle bundlesWithGNUstepPath: @"GSTest/ColorTests"];

The app would load them all but it could use them to do different things. 
[I'm not sure this idea with subpaths is portable though - use an array
of path components perhaps ?]

And a method to retrieve a specific bundle, such as: 

[NSBundle bundleWithName: @"PCAppProj"  
         withGNUstepPath: @"ProjectCenter"];


Any comments ?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]