[Vala] Dependency scanner



Hello!  I'm from Ubuntuland and am working on a Vala template for
quickly [1].

One neat thing that our Python template does via python-distutils-extra
is that it scans all the Python source for imports and determines the
run time dependencies from that.

I wanted a similar thing for the Vala template, so that a novice user
does not need to know the vapi names of all the packages they want to
use.  I would need to know the vapi names for build time as well as
determining run time dependency information.

I started looking into this and have a very rough draft of a program to
do it (only supports 'using' statements so far, as I haven't worked on
namespace prefix scanning yet).

It is super gross though.  It uses libvala to scan the code for 'using'
statements, scans all the vapi files for any declared namespaces, then
notes the different vapi files that declare the namespaces that are
being 'used'.  This includes pulling in multiple vapi files that declare
the same namespace (like gio-2.0 and glib-2.0) as well as resolving
conflicts (like gtk+-3.0 and gtk+-2.0).

So, (A) Does such a thing have merit?  Or am I trying to do something
that will inherently never work right or is just a bad idea?

(B) Do you have better ways?

(C) I see some gross uses of namespaces.  Like right now, mozembed
declares it is part of the Gtk namespace, when I suspect it shouldn't.
This causes me to try to use mozembed when I don't need to.  I suspect
that using Gir files instead of vapi will help here, but I don't believe
Gir are ready for primetime, right?

I'm emailing this list since the answers may involve some detailed
information about the compiler, but if I should move over to vala-list,
let me know.

[1] Quickly (https://launchpad.net/quickly) is a program which makes it
really easy to write/share/publish an app.  It uses program templates,
and we have one for Python applications, but I'd love to see one for
Vala too.

Thank you!
-mt



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