Scripting

Module called for configuring, compiling and installing targets

waflib.Scripting.waf_entry_point(current_directory, version, wafdir)[source]

This is the main entry point, all Waf execution starts here.

Parameters:
  • current_directory (string) – absolute path representing the current directory
  • version (string) – version number
  • wafdir (string) – absolute path representing the directory of the waf library
waflib.Scripting.set_main_module(file_path)[source]

Read the main wscript file into waflib.Context.Context.g_module and bind default functions such as init, dist, distclean if not defined. Called by waflib.Scripting.waf_entry_point() during the initialization.

Parameters:file_path (string) – absolute path representing the top-level wscript file
waflib.Scripting.parse_options()[source]

Parse the command-line options and initialize the logging system. Called by waflib.Scripting.waf_entry_point() during the initialization.

waflib.Scripting.run_command(cmd_name)[source]

Execute a single command. Called by waflib.Scripting.run_commands().

Parameters:cmd_name (string) – command to execute, like build
waflib.Scripting.run_commands()[source]

Execute the commands that were given on the command-line, and the other options Called by waflib.Scripting.waf_entry_point() during the initialization, and executed after waflib.Scripting.parse_options().

waflib.Scripting.distclean_dir(dirname)[source]

Distclean function called in the particular case when:

top == out
Parameters:dirname (string) – absolute path of the folder to clean
waflib.Scripting.distclean(ctx)[source]

removes the build directory

class waflib.Scripting.Dist(**kw)[source]

Bases: waflib.Context.Context

Create an archive containing the project source code:

$ waf dist
execute()[source]

See waflib.Context.Context.execute()

archive()[source]

Create the archive.

get_tar_path(node)[source]

return the path to use for a node in the tar archive, the purpose of this is to let subclases resolve symbolic links or to change file names

add_tar_file(x, tar)[source]

Add a file to the tar archive. Transform symlinks into files if the files lie out of the project tree.

get_arch_name()[source]

Return the name of the archive to create. Change the default value by setting arch_name:

def dist(ctx):
        ctx.arch_name = 'ctx.tar.bz2'
Return type:string
get_base_name()[source]

Return the default name of the main directory in the archive, which is set to appname-version. Set the attribute base_name to change the default value:

def dist(ctx):
        ctx.base_name = 'files'
Return type:string
get_excl()[source]

Return the patterns to exclude for finding the files in the top-level directory. Set the attribute excl to change the default value:

def dist(ctx):
        ctx.excl = 'build **/*.o **/*.class'
Return type:string
get_files()[source]

The files to package are searched automatically by waflib.Node.Node.ant_glob(). Set files to prevent this behaviour:

def dist(ctx):
        ctx.files = ctx.path.find_node('wscript')

The files are searched from the directory ‘base_path’, to change it, set:

def dist(ctx):
        ctx.base_path = path
Return type:list of waflib.Node.Node
waflib.Scripting.dist(ctx)[source]

makes a tarball for redistributing the sources

class waflib.Scripting.DistCheck(**kw)[source]

Bases: waflib.Scripting.Dist

Create an archive of the project, and try to build the project in a temporary directory:

$ waf distcheck
execute()[source]

See waflib.Context.Context.execute()

check()[source]

Create the archive, uncompress it and try to build the project

waflib.Scripting.distcheck(ctx)[source]

checks if the project compiles (tarball from ‘dist’)

waflib.Scripting.update(ctx)[source]

updates the plugins from the waflib/extras directory

waflib.Scripting.autoconfigure(execute_method)[source]

Decorator used to set the commands that can be configured automatically

Previous topic

Runner

Next topic

Task

This Page