[Gambas-user] Development cycle and component vs library

Patrik Karlsson pata.karlsson at ...626...
Sun Jun 15 08:25:41 CEST 2014


2014-06-15 1:06 GMT+02:00 B Bruen <bbruen at ...2308...>:

> On Sat, 14 Jun 2014 07:26:46 +0200
> Patrik Karlsson <pata.karlsson at ...626...> wrote:
>
> > I'm working on a dice game and I'm thinking of separating "the dice part"
> > from the game itself so I and others could reuse it, and for separation.
> >
> > The main reason for not doing this earlier is that I could not understand
> > how to make the game development cycle easy in the sense that:
> > 1. libraries have to be made executables and copied to my game project
> Yes, but there is an alternative to "copy". Make an executable of the
> library in its development project, lets call it "pkdice". Then create a
> symbolic link in your game project directory to that executable
> (pkdice.gambas in the library source project). Then every time you compile
> pkdice, the game will be using the latest version of the library.


> > 2. components have to installed to the system.
> Yes. As a matter of fact libraries can also be installed to the system.
> For that matter, at the end of the development cycle you will also want to
> install the game to the system (Unless you always want to run the game from
> it's development project?). So consider your development cycle and check
> that it includes a "deploy" step.
>
> Making and installing libraries, components and programs is actually very
> easy in Gambas, using the Project|Make|Installation Package route. We have
> found that the autotools packager works best for us, allowing installation
> across many different distros. Also, understanding it will help you to
> understand the distro specific installs. So I suggest you start with
> autotoools.  Once the package is built, it can be installed with the normal
> .config/make/make install cycle.
> >
> > Is this correct?
> > Is it possible to make the development cycle easier? e.g. Make changes in
> > my dice library/component propagate automatically in to my game project?
> >
> >  And finally, should I make it a library or a component?
> In short, initially as a library.  From the help:
>         "Gambas components are shared libraries written in C, C++ or
> directly in gambas that add new classes to the gambas interpreter.
>         They are shared between all Gambas programs running on your
> system, and can be seen as part of the language."
> and
>         "Gambas libraries are Gambas executables that can be used by a
> project almost exactly like a component."
> This is a bit hard to understand and I'm probably only about 90% correct
> here, but.  There is actually very little difference and the differences
> are fairly unimportant to a new gambas developer.  Suffice to say, until
> you understand that help above, libraries are the way to go.
>
>
> >
> > /Patrik
>
> hth
> Bruce
>
> --
> B Bruen <bbruen at ...2308...>
>

It helped, thanks!
Now I can easily make changes to my library and instantly test it in my app.

After reading your answer I did some testing and found that adding a
library to a project is a IDE thing only, I still have to deploy and
install the library in order for my installed app to use it.

As an alternative to sym linking I found ExecPath in .project allows me to
build it directly to my "game project" that uses the library in question.
When having two or more apps using the library, sym links is the best way
to go.

/Patrik



More information about the User mailing list