This commit is contained in:
Thomas Nagy 2016-08-20 23:54:35 +02:00
parent ec6b72b0ad
commit 07a01edba8
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
1 changed files with 6 additions and 5 deletions

View File

@ -1,10 +1,11 @@
The feature system enables binding new behaviours to task generators instances by scheduling class methods for execution. The methods are weaved in an order that this specified on the method definition (after/before constraints). One major benefit is that additional behaviours can be weaved onto existing targets without modifying the build scripts. This approach is comparable to the CSS class declations in the web design context.
The Waf features are names linked to specific functions by the decorator The Waf features are declared by annotating functions with a decorators
:py:func:`waflib.TaskGen.feature`. The functions :py:func:`waflib.TaskGen.feature`. These functions are then mapped
are mapped to the class :py:class:`waflib.TaskGen.task_gen` as methods. as class methods onto :py:class:`waflib.TaskGen.task_gen` with the name given.
The association between feature names and methods is *many-to-many*, which means The association between feature names and methods is *many-to-many*; in other words
that a method may be involved in several features, and that a feature may be bound a method may be used by in several features, and that a feature may reference
to several methods. to several methods.
Here is how to create and use a new feature named **foo**:: Here is how to create and use a new feature named **foo**::