[Gambas-user] Sharing libraries across projects : new proposal!

Benoît Minisini gambas at ...1...
Sat Jan 30 22:18:48 CET 2016


Le 30/01/2016 21:44, Tobias Boege a écrit :
> On Sat, 30 Jan 2016, Beno??t Minisini wrote:
>> Hi,
>>
>> I'm still thinking about that, especially trying to find the simplest
>> solution.
>>
>
> Good, I still need it :-) ATM I can continue work by having a copy of the
> library in each project that uses it. So we should not rush things. (The
> new project also had me experiment with gb.web.form. It's pretty cool and
> hopefully we can talk about a WebForm_KeyPress event later on gambas-devel.)
>
>> Here is a new proposal, that requires less changes:
>>
>> 1) Add a new project option that allows to indicate the library search
>> directory at runtime. If specified, the libraries are searched in that
>> directory first. (Question: are multiple directories needed?)
>>
>
> Should this value be project-specific? I would imagine that I'd install
> all Gambas libraries in $HOME/bin or so. When I set the library search
> path in my project and give that project to someone else, they still have
> to adjust the path (every time they receive a new version).
>
> That would be solved if it was a global option for the interpreter. Do you
> think a configuration file for the interpreter is a good idea?

It's project specific, and you should be able to put a path relative to 
the executable (for example, "../lib"). It's there only to override the 
default search algorithm.

>
>> 2) Elsewhere, the libraries are searched in the same directory than the
>> components, '<gambas installation prefix>/lib/gambas3'. The difference
>> is that a library has no *.component file, and its name cannot starts
>> with "gb.", which is reserved for gambas components.
>>
>> 3) For backward compatibility, the libraries are finally searched in
>> '<gambas installation prefix>/bin'.
>>
>> 4) At debug time, in the IDE, libraries are searched in the same
>> directories, and will be listed in the project configuration dialog to
>> be checked (the old specific library tab may be removed).
>>
>
> OK.
>
>> 5) The packager will install libraries in '<gambas installation
>> prefix>/lib/gambas3', and prevent the use of 'gb.' at the beginning of
>> project name.
>>
>
> Sounds sensible. Aside from the packager, one would be able to install the
> library by just putting an executable archive into the search path, right?

Yes.

Otherwise, there is something missing: the ability to use libraries 
without having to install them globally. I.e. a user-specific directory 
where libraries are searched only in debug mode. For example 
"~/.local/config/gambas3/lib".

-- 
Benoît Minisini




More information about the User mailing list