wtools
ESOwaftools
 All Classes Namespaces Functions Pages
wtools.module Namespace Reference

Functions

def declare_custom
 
def declare_cshlib
 
def declare_cobjects
 
def declare_cstlib
 
def declare_cprogram
 
def declare_cprotobuf
 
def declare_crtidds
 
def declare_qt5cshlib
 
def declare_qt5cprogram
 
def declare_pypackage
 
def declare_pyqt5package
 
def declare_pyprogram
 
def declare_pyqt5program
 
def declare_pyprotobuf
 
def declare_jar
 
def declare_jrtidds
 
def declare_jprotobuf
 
def declare_config
 
def declare_malicd
 
def declare_malicd_topics
 

Variables

dictionary STANDARD_COMMANDS
 

Detailed Description

Macro-like declaration of module.

The declare_* functions will register the standard commands if not supplied,
so if necessary e.g. the build command can be implemented manually
if customizations require it.

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.

kwargs:
    target: Name for these objects
def wtools.module.declare_config (   kwargs)
Declare a configuration module.
Installs files from <module>/config/* to $PREFIX/config/[package/]module.

Args:
    source: List of sources or an ant_glob object.
            Defaults to config/**/*.*
    dest:   Destination 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.

kwargs:
    target: Canonical 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.

kwargs:
    target: Canonical name of library
def wtools.module.declare_custom (   provides = None,
  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.

Args:
    provides: List of task generator names that this module provides. The names
              should be in the fully qualified name form ('foo.bar.baz').
    depends: List 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_jprotobuf (   target,
  kwargs 
)
Declare Java protobuffer files generation (.proto file to .java)

Files .proto in interface are transformed into .java and built into
a JAR 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_jrtidds (   target,
  kwargs 
)
Declare a Java RTI DDS IDL compilation

Files .idl in interface are transformed into .java and built into a 
JAR file

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_malicd (   kwargs)
Declare a MAL ICD module.

A single XML definition file should be in source. Libraries for languages
and transports available in the configuration will be generated.

Args:
  use = dependency on other ICDs
  rtidds_flags = custom flags to add to rtiddsgen invocation
def wtools.module.declare_malicd_topics (   kwargs)
Declare a MAL ICD topics module.

A single XML definition file should be in source. The filename must be ending 
with Topics as by convention (ie. blablablaTopics.xml)  Libraries for languages
available in the configuration will be generated.

Args:
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_pyprotobuf (   target,
  kwargs 
)
Declare a Python protobuffer module package
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

:param str target: Canonical name of library,
:param bool qt5_plugin: True if module is a Qt5 plugin false otherwise.

Variable Documentation

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