ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions | Variables
wtools.module Namespace Reference

Functions

def declare_custom
 Declare custom module. More...
 
def declare_cshlib
 Declare a C/C++ shared library. More...
 
def declare_cobjects
 Declare C/C++ objects (collection of source and/or header files). More...
 
def declare_cstlib
 Declare a C/C++ static library. More...
 
def declare_cprogram
 Declare a C/C++ program main artefact. More...
 
def declare_cprotobuf
 Declare C/C++ protobuffer files generation (.proto file to pb.h/.pb.cc) More...
 
def declare_crtidds
 Declare a C/C++ RTI DDS IDL compilation. More...
 
def declare_qt5cshlib
 Declare a C++ shared library using Qt5 libraries. More...
 
def declare_qt5cprogram
 Declare a C++ program using Qt5 libraries. More...
 
def declare_pypackage
 Declare a Python package. More...
 
def declare_pyqt5package
 Declare a Python package with Qt5 bindings. More...
 
def declare_pyprogram
 Declare a Python program, optional package and unit tests. More...
 
def declare_pyqt5program
 Declare a Python program using Qt5 bindings, optional package and unit tests. More...
 
def declare_jar
 Declares Java archive module. More...
 
def declare_config
 Declare a configuration module. More...
 

Variables

dictionary STANDARD_COMMANDS
 

Function Documentation

def wtools.module.declare_cobjects (   target,
  kwargs 
)

Declare C/C++ objects (collection of source and/or header files).

Additional tasks:

  • unit test
  • install configuration
  • install source files

C.f. waf book (waf.io/book) for supported arguments.

Parameters
targetName for these objects
def wtools.module.declare_config (   kwargs)

Declare a configuration module.

Installs files from <module>/config/* to $PREFIX/config/[package/]module.

Parameters
sourceList of sources or an ant_glob object. Defaults to config/**/*.*
destDestination of sources. Defaults to $PREFIX/config/[<package>]/<module>
def wtools.module.declare_cprogram (   target,
  kwargs 
)

Declare a C/C++ program main artefact.

Note
By convention the main() is assumed to be located in src/main.cpp and will automatically be excluded from the unit test.

Additional tasks:

  • unit test
  • install configuration
  • install source files

C.f. waf book (waf.io/book) for supported arguments.

def wtools.module.declare_cprotobuf (   target,
  kwargs 
)

Declare C/C++ protobuffer files generation (.proto file to pb.h/.pb.cc)

Files .proto in interface are transformed into .pb.h/.pb.cc and built into a static library that can be then used by other modules.

protoc is used for the files generation and is searched for in the configuration stage

def wtools.module.declare_crtidds (   target,
  kwargs 
)

Declare a C/C++ RTI DDS IDL compilation.

Files .idl in interface are transformed into .h/.cxx and built into a static library that can be then used by other modules.

Make sure that the project is configured (use) with 'rtidds', rtiddsgen tool is in the $PATH and the RTI DDS libraries can be configured by the pkg-config utility (therefore a rti_dds.pc file is present in the system or in your private PKG_CONFIG_PATH, see the example configuration file supplied in the wtools reference project).

def wtools.module.declare_cshlib (   target,
  kwargs 
)

Declare a C/C++ shared library.

Additional tasks:

  • unit test
  • install configuration
  • install source files

C.f. waf book (waf.io/book) for supported arguments.

Parameters
targetCanonical name of library
def wtools.module.declare_cstlib (   target,
  kwargs 
)

Declare a C/C++ static library.

Additional tasks:

  • unit test
  • install configuration
  • install source files

C.f. waf book (waf.io/book) for supported arguments.

Parameters
targetCanonical name of library
def wtools.module.declare_custom (   provides,
  depends = [] 
)

Declare custom module.

Allows for customized build method definition while retaining option to automatically track use dependencies in the created config method, although it has to be explicitly specified by the user when usig this method.

Note: The build method must be defined before calling this function.

Parameters
providesList of task generator names that this module provides. The names should be in the fully qualified name form ('foo.bar.baz').
dependsList of task generator use dependencies.
def wtools.module.declare_jar (   target,
  kwargs 
)

Declares Java archive module.

Contents under src/ will be compiled and archived in <module>.jar and installed in ${PREFIX}/lib/.

Additional tasks:

  • Install config
  • TestNG unit test from test/* files (see javatest extra)
  • TODO: jar runner?
def wtools.module.declare_pypackage (   target,
  kwargs 
)

Declare a Python package.

def wtools.module.declare_pyprogram (   target,
  kwargs 
)

Declare a Python program, optional package and unit tests.

wtools assumes that there will be:

  • A single src/<module>.py file representing the program executable. The script will be installed to the $PREFIX/bin directory without the .py extension
  • An optional src/<module>/__init__.py Python package for bigger programs needing multiple files without having to create additional modules.

The unit tests will have the PYTHONPATH populated such that the pyprogram module Python package can be imported in the tests.

def wtools.module.declare_pyqt5package (   target,
  kwargs 
)

Declare a Python package with Qt5 bindings.

def wtools.module.declare_pyqt5program (   target,
  kwargs 
)

Declare a Python program using Qt5 bindings, optional package and unit tests.

Please see declare_pyprogram for details, as this is a derivation of a standard python program

def wtools.module.declare_qt5cprogram (   target,
  kwargs 
)

Declare a C++ program using Qt5 libraries.

Being a C++ application same argument as C++ may apply.

For automatic MOC generation: -) Insert the UI (.ui) or header (.h .hpp) file under includes -) If an UI is used it will be converted first to a header file -) In the interested .cpp file reference a virtual .moc as: #if WAF #include "include/sameNameAsSource.moc" #endif Where the .moc filename is the one the reference file will generate

Resource (.qrc) and language (.ts) files are also supported.

More waf level info: https://waf.io/apidocs/tools/qt5.html

Additional tasks:

  • install configuration
  • install source files
def wtools.module.declare_qt5cshlib (   target,
  kwargs 
)

Declare a C++ shared library using Qt5 libraries.

Being a C++ shared library same argument as C++ may apply.

For automatic MOC generation: -) Insert the UI (.ui) or header (.h .hpp) file under includes -) If an UI is used it will be converted first to a header file -) In the interested .cpp file reference a virtual .moc as: #if WAF #include "include/sameNameAsSource.moc" #endif Where the .moc filename is the one the reference file will generate

Resource (.qrc) and language (.ts) files are also supported.

More waf level info: https://waf.io/apidocs/tools/qt5.html

Additional tasks:

  • install configuration
  • install source files

Variable Documentation

dictionary wtools.module.STANDARD_COMMANDS
Initial value:
1 = {'configure': _noop,
2  'build':_noop,
3  'options':_noop,
4  'docs': _noop
5  }