At this point, vala is still unstable, so do not expect this tool to be too stable either (apis, etc)
Compile a vala file and bind the task to self.valatask. If an existing vala task is already set, add the node to its inputs. The typical example is:
def build(bld):
bld.program(
packages = 'gtk+-2.0',
target = 'vala-gtk-example',
uselib = 'GTK GLIB',
source = 'vala-gtk-example.vala foo.vala',
vala_defines = ['DEBUG']
# the following arguments are for libraries
#gir = 'hello-1.0',
#gir_path = '/tmp',
#vapi_path = '/tmp',
#pkg_name = 'hello'
# disable installing of gir, vapi and header
#install_binding = False
)
Parameters: | node (waflib.Node.Node) – vala file |
---|
Bases: waflib.Task.Task
Task to compile vala files.
Configuration Method bound to waflib.Configure.ConfigurationContext
Find the valac program, and execute it to store the version number in conf.env.VALAC_VERSION
Parameters: |
|
---|
Configuration Method bound to waflib.Configure.ConfigurationContext
Check if vala compiler from a given branch exists of at least a given version.
Parameters: |
|
---|
Configuration Method bound to waflib.Configure.ConfigurationContext
Load the gobject and gthread packages if they are missing.
Use the following to enforce minimum vala version:
def configure(conf):
conf.load('vala', funs='')
conf.check_vala(min_version=(0,10,0))
Decorator: attach new configuration functions to waflib.Build.BuildContext and waflib.Configure.ConfigurationContext. The methods bound will accept a parameter named ‘mandatory’ to disable the configuration errors:
def configure(conf):
conf.find_program('abc', mandatory=False)
Parameters: | f (function) – method to bind |
---|
Decorator: register a task generator method which will be invoked during the processing of source files for the extension given:
from waflib import Task
class mytask(Task):
run_str = 'cp ${SRC} ${TGT}'
@extension('.moo')
def create_maa_file(self, node):
self.create_task('mytask', node, node.change_ext('.maa'))
def build(bld):
bld(source='foo.moo')
Load the waflib.Tools.gnu_dirs tool and add the --vala-target-glib command-line option