Tasks
The nmk-proto plugin defines the tasks described below.
Setup tasks
All tasks in this chapter are dependencies of the base setup task.
proto.gen.py – Generate python code
This task is used to generate python source code from protos files found in ${protoFolder} folder.
Files will be generated in first found python source folder (first element of ${pythonSrcFolders}).
Generated python module(s) folder(s) will be automatically declared to be ignored by ruff tool and source code coverage when running pytest.
Property |
Value/description |
|---|---|
builder |
|
input |
${protoInputFiles} proto files |
output |
${pythonGeneratedSrcFiles} generated files |
if |
${pythonGeneratedSrcFiles} (i.e. only if python generated files are expected) |
The builder is called with the following parameters mapping:
Name |
Value |
|---|---|
init_template |
|
all_input_subdirs |
|
options |
|
src_folders |
|
extra_args |
Test tasks
All tasks in this chapter are dependencies of the base tests task.
proto.check.py – Verify generated python code
This task verifies if generated code can correctly be imported in a python script (e.g. it typically fails if 2 different enums are defining the same constant).
Property |
Value/description |
|---|---|
builder |
|
if |
${pythonGeneratedSrcFiles} (i.e. only if python generated files are expected) |
unless |
The builder is called with the following parameters mapping:
Name |
Value |
|---|---|
src_folders |