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_moduleand bind default functions such asinit,dist,distcleanif not defined. Called bywaflib.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 afterwaflib.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
-
class
waflib.Scripting.Dist(**kw)[source]¶ Bases:
waflib.Context.Contextcreates an archive containing the project source code
-
cmd= 'dist'¶
-
fun= 'dist'¶
-
algo= 'tar.bz2'¶
-
ext_algo= {}¶
-
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
-
__doc__= 'creates an archive containing the project source code'¶
-
__module__= 'waflib.Scripting'¶
-
-
class
waflib.Scripting.DistCheck(**kw)[source]¶ Bases:
waflib.Scripting.DistCreate an archive of the project, and try to build the project in a temporary directory:
$ waf distcheck
-
fun= 'distcheck'¶
-
cmd= 'distcheck'¶
-
__doc__= '\n\tCreate an archive of the project, and try to build the project in a temporary directory::\n\n\t\t$ waf distcheck\n\t'¶
-
__module__= 'waflib.Scripting'¶
-