|
wtools
ESO waf tools
|
Functions | |
| def | node_names |
| def | get_module_name |
| def | get_module_namespace_path |
| def | auto_cunit |
| def | auto_qt5unit |
| def | auto_pyunit |
| def | auto_install_source |
| def | auto_cprogram |
| def | auto_cprotobuf |
| def | auto_crtidds |
| def | auto_cstlib |
| def | auto_cobjects |
| def | auto_cshlib |
| def | auto_qt5cshlib |
| def | auto_qt5cprogram |
| def | auto_pypackage |
| def | auto_pyprogram |
| def | auto_pyprotobuf |
| def | auto_jar |
| def | auto_javatest |
| def | auto_jrtidds |
| def | auto_jprotobuf |
| def | auto_config |
| def | auto_sphinx |
| def | ext_sys_clib |
| def | ext_proj_clib |
| def | auto_malicd |
| def | auto_malicd_topics |
Variables | |
| list | STD_EXCL = ['**/*~', '**/.*'] |
| dictionary | sanitizer_flags |
Provides auto_cprogram, auto_cstlib, auto_cshlib aliases in the build context
to automate creation using project standardized directory structure::
module # Target node, also serves as the target name by default
src # Source files
src/include # Public includes (exportable)
test # Test files
wscript # build script that may use auto_*.
Enable by loading module in options::
def options(opt):
opt.load('auto', tooldir='wtools')
See `waflib/Tools/c_aliases.py` for implementation of bld.program, bld.stlib
and bld.shlib.
| def wtools.auto.auto_cobjects | ( | bld, | |
| target, | |||
| kw | |||
| ) |
Declare C/C++ objects (collection of source and/or header files).
The following preprocessor definitions are automatically added:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
Kwargs:
target: Name of target
Returns:
Primary artefact taskgen
| def wtools.auto.auto_config | ( | bld, | |
| kw | |||
| ) |
Declare configuration tasks that copies config/** (backwards compatibility) and resource/** or files passed via kwargs in source. Destination is either $PREFIX or directory specified by install_path in kwargs. Files are copied with full directory if rel in kwargs is True (default), otherwise if False
| def wtools.auto.auto_cprogram | ( | bld, | |
| target, | |||
| kw | |||
| ) |
Declare C/C++ program (.c and .cpp files)
The following preprocessor definitions are automatically added:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
Kwargs:
target: Name of target
Returns:
Primary artefact taskgen
| def wtools.auto.auto_cprotobuf | ( | bld, | |
| target, | |||
| kw | |||
| ) |
Declare C/C++ protobuffer files generation (.proto file to pb.h/.pb.cc)
and create a dynamic library.
If a static library is preferred an option "features=cxxstlib" can be passed
Kwargs:
target: Name of target
| def wtools.auto.auto_crtidds | ( | bld, | |
| target, | |||
| kw | |||
| ) |
Declare C/C++ RTI DDS files generation (.idl file to .h/.cxx) and create
a dynamic library.
If a static library is preferred an option "features=cxxstlib" can be passed
Make sure that the project is configured (use) with 'rtidds' (and rtiddsgen
tool is in the $PATH).
Kwargs:
target: Name of target
rtidds_extincludes: (Optional) List of directories external to project to include for searching included files
rtidds_flags: (Optional) List of custom command line parameters to pass to rtiddsgen
(ie. ['-unboundedSupport', '-sequenceSize', '1024'] )
| def wtools.auto.auto_cshlib | ( | bld, | |
| target, | |||
| kw | |||
| ) |
Declare C/C++ shared library.
The following preprocessor definitions are automatically added:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
Kwargs:
target: Name of target
Returns:
Primary artefact taskgen
| def wtools.auto.auto_cstlib | ( | bld, | |
| target, | |||
| kw | |||
| ) |
Declare C/C++ static library.
The following preprocessor definitions are automatically added:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
Kwargs:
target: Name of target
Returns:
Primary artefact taskgen
| def wtools.auto.auto_cunit | ( | bld, | |
| target, | |||
test_tg = None, |
|||
| kw | |||
| ) |
Creates a cprogram task generator for the local unit test.
The following preprocessor definisions are defined by default:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
`UNIT_TEST=1`
Kwargs:
target: target name for unit test (must end in '_test' or '_cunit' or '_qt5unit').
If the name ends in _qt5unit it is supposed to be a QT5 unit test and a few
additional rules are applied (addition also of QT generated files as source,
additional libraries linked ...)
test_tg: (optional) The task generator for the software under test. Sources will
be copied from this task generator.
source: (optional) list of test source files defaults to test/**/*.cpp.
extra_source: (optional) list of additional source files, used to e.g.
build also primary artefact sources.
The file src/main.{cpp,c} will be removed if it exists to not
introduce another main() in the test artefact.
with_ut_lib: (optional) Unit test library to be used to execute the unit test
Supported values:
- gtest (default): Google test (https://github.com/google/googletest)
- qt5test: QT5 unit test (https://doc.qt.io/qt-5/qtest-overview.html)
- catch2 : catch2 (https://github.com/catchorg/Catch2)
- gbench : google test + benchmark (https://github.com/google/benchmark)
| def wtools.auto.auto_install_source | ( | bld, | |
| kw | |||
| ) |
Install source files to $PREFIX/sources
Kwargs:
source: list of source files. Globs everything in src/**/* by default.
| def wtools.auto.auto_jar | ( | bld, | |
| k, | |||
| kw | |||
| ) |
Declare Java JAR taskgenerator
Compiles all the .java files in src and generated relative .class files
that are then packed in the JAR from the build directory.
Files present in src/resources are recursively included in the JAR along
with all the generated .class files.
JAR files generated are installed in ${PREFIX}/lib
Kwargs:
target: (Mandatory) Name of task generator and generated JAR file
manifest: (Optional) Manifest file to be used (path relative from module)
| def wtools.auto.auto_javatest | ( | bld, | |
| k, | |||
| kw | |||
| ) |
Declare Java TestNG test taskgenerator Test configuration is read from TestNG XML configuration files that are searched recursively under test/ for files that finish in testng.xml Files present in test/resources are recursively copied to the build along with all the generated .class files and can be therefore used by the test. If coverage is enabled the tests will be run through jacoco and at the end jacococli will be executed to generate the HTML reports from the jacoco binary data.
| def wtools.auto.auto_jprotobuf | ( | bld, | |
| k, | |||
| kw | |||
| ) |
Declare Java protobuf files generation (.pb2 file to .java) and create
a JAR
Kwargs:
target: (Mandatory) Name of task generator and generated JAR file
manifest: (Optional) Manifest file to be used (path relative from module)
protoc_extincludes: (Optional) List of directories external to project to include for searching included files
| def wtools.auto.auto_jrtidds | ( | bld, | |
| k, | |||
| kw | |||
| ) |
Declare Java RTI DDS files generation (.idl file to .java) and create
a JAR
Kwargs:
target: (Mandatory) Name of task generator and generated JAR file
manifest: (Optional) Manifest file to be used (path relative from module)
rtipackage: (Optional) Package name to pass to rtiddsgen (-package option)
rtidds_extincludes: (Optional) List of directories external to project to include for searching included files
rtidds_flags: (Optional) List of custom command line parameters to pass to rtiddsgen
(ie. ['-unboundedSupport', '-sequenceSize', '1024'] )
| def wtools.auto.auto_pypackage | ( | bld, | |
| target, | |||
| with_unit_test, | |||
| kw | |||
| ) |
Declare a Python package and unit tests.
| def wtools.auto.auto_pyprogram | ( | bld, | |
| target, | |||
| with_unit_test, | |||
| kw | |||
| ) |
Declare a Python program, optional package and unit tests.
It assumes that there will be:
- A single `src/<target>.py` file representing the program executable. The script will be
installed without the `.py` extension
- An optional `src/<target>/` 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.
Kwargs:
target: (Mandatory) Name of task generator (must match target filename)
| def wtools.auto.auto_pyprotobuf | ( | bld, | |
| target, | |||
| kw | |||
| ) |
Declare a Python module containing protobuffer interface (as a module, as protoc does)
target: (Mandatory) Name of task generator
protoc_extincludes: (Optional) List of directories external to project to include for searching included files
| def wtools.auto.auto_pyunit | ( | bld, | |
| target, | |||
| kw | |||
| ) |
Creates a Python unit test runner task
It executes a python test runner on all sources in src/ test/ from in the build dir test
directory.
The PYTHONPATH is populated so that dependent Python modules and packages from use
list are found before any installed version.
Kwargs:
with_doctest: boolean flag to enable/disable doctests.
with_ut_lib: Unit test library to be used to execute the unit test
Supported values:
- nosetests: Nosetests (https://nose.readthedocs.io/en/latest/)
- pytest: PyTest (https://docs.pytest.org/en/latest/)
| def wtools.auto.auto_qt5cprogram | ( | bld, | |
| target, | |||
| kw | |||
| ) |
Declare C/C++ program and unit test using Qt5 (.c and .cpp files) The following preprocessor definitions are automatically added: `WAF_MODULE_PATH = absolute path to the module root` `WAF_MODULE_NAME = fully qualified module name`
| def wtools.auto.auto_qt5cshlib | ( | bld, | |
| target, | |||
| kw | |||
| ) |
Declare C/C++ shared library and unit test using Qt5 (.c and .cpp files) The following preprocessor definitions are automatically added: `WAF_MODULE_PATH = absolute path to the module root` `WAF_MODULE_NAME = fully qualified module name`
| def wtools.auto.auto_qt5unit | ( | bld, | |
| target, | |||
test_tg = None, |
|||
| kw | |||
| ) |
Creates a cprogram task generator for the local unit test using Qt5Test.
Warning: QT5 unit test management has now been incorporated in standard C++ Unit test,
this is just a wrapper setting some default values. Please see auto_cunit definition for
complete details
The following preprocessor definitions are defined by default:
`WAF_MODULE_PATH = absolute path to the module root`
`WAF_MODULE_NAME = fully qualified module name`
`UNIT_TEST=1`
Kwargs:
target: target name for unit test (should end in _qt5unit)
test_tg: (optional) The task generator for the software under test. Sources will
be copied from this task generator.
source: (optional) list of test source files defaults to test/**/*.cpp.
extra_source: (optional) list of additional source files, used to e.g.
build also primary artefact sources.
The file src/main.{cpp,c} will be removed if it exists to not
introduce another main() in the test artefact.
with_ut_lib: (optional) Unit test library to be used to execute the unit test
Supported values:
- gtest: Google test (https://github.com/google/googletest)
- qt5test (default): QT5 unit test (https://doc.qt.io/qt-5/qtest-overview.html)
- catch2 : catch2 (https://github.com/catchorg/Catch2)
| def wtools.auto.auto_sphinx | ( | bld, | |
| kw | |||
| ) |
Declare Sphinx documentation build.
| def wtools.auto.ext_proj_clib | ( | cnf, | |
| name, | |||
libs = None, |
|||
prefix = None |
|||
| ) |
Declare external project C/C++ library.
Kwargs:
name: Canonical library name. I.e. 'mod' for library 'libmod.so'/'libmod.a'
prefix: The prefix is automatically picked up from
| def wtools.auto.ext_sys_clib | ( | cnf, | |
| name, | |||
| libs, | |||
| libpath, | |||
| incpath | |||
| ) |
Declare external system C/C++ library
| def wtools.auto.get_module_name | ( | ctx, | |
submodule = None |
|||
| ) |
Get fully qualified module name using the standard convention that the wscript located in a directory named after the module and intermediate packages.
| def wtools.auto.get_module_namespace_path | ( | ctx | ) |
Returns the current module namespace as a path element. Example: "module" if module is in the global module namespace or, "package1/package2/module" if the module is ordered inside package.
| dictionary wtools.auto.sanitizer_flags |