Configuration Reference¶
The nmk-base plugin handles the configuration items listed in this page.
All of them are initiliazed with convenient default values, so that you don’t need to setup them for a default working behavior. You can anyway override them in your projet if you need to fine tune the plugin behavior. Some items are specifically designed to be extended by nmk projects and plugins.
Paths and files¶
sourceDir – source base directory¶
Type |
Default value |
|---|---|
str |
${PROJECTDIR}/src |
Main source directory for the project (containing source files; used by other plugins).
outputDir – output base directory¶
Type |
Default value |
|---|---|
str |
${PROJECTDIR}/out |
Output folder used to generate build artifacts, temporary files, tools reports, etc…
Helper contributions¶
projectName – project name¶
Type |
Default value |
|---|---|
str |
MyProject |
Name of the project
nmkPluginsVersions – referenced plugins versions¶
Type |
Default value |
|---|---|
dict[str,str] |
{“nmk-base”: ${nmkBasePluginVersion}} |
Plugins versions, indexed by names, to be displayed by version task
nmkPluginsDocs – referenced plugins help pages¶
Type |
Default value |
|---|---|
dict[str,str] |
{“nmk-base”: “https://nmk-base.readthedocs.io/”} |
Plugins help pages URLs indexed by names, to be displayed by help task.
requestFunction – request function for download tasks¶
Type |
Default value |
|---|---|
str |
requests.get |
Canonical path to a requests-like function, that should be passed as request_function parameter for nmk_base.common.DownloadBuilder based
download tasks. The specified function must behave like requests.get function (same input/output parameters).
Added in version 1.3.0
Git¶
The nmk-base plugin handles some git related configuration items, listed in this chapter.
gitVersion – git version¶
Type |
Default value |
|---|---|
str |
Generated by |
Version read from git for the current project, using git describe --tags --dirty command.
gitVersionStamp – git version resolution stamp file¶
Type |
Default value |
|---|---|
str |
${outputDir}/.gitversion |
Get version stamp file, updated by git.version task each time ${gitVersion} value changes. Can be used as input by tasks expecting to be triggered when git version changes.
gitIgnore – generated .gitignore file¶
Type |
Default value |
|---|---|
str |
“${PROJECTDIR}/.gitignore” |
Target generated .gitignore file.
gitIgnoreTemplate – .gitignore template file¶
Type |
Default value |
|---|---|
str |
“${BASEDIR}/templates/gitignore” |
Template used by git.ignore task to generate .gitignore fragment.
gitIgnoreStamp – .gitignore generated stamp file¶
Type |
Default value |
|---|---|
str |
${outputDir}/.gitignore |
Stamp file for generated .gitignore fragment.
gitIgnoredFiles – git ignored files list¶
Type |
Default value |
|---|---|
list[str] |
[ “${PROJECTDIR_NMK}/”, “${outputDir}”, “${venvName}”, “${buildenvFolder}” ] |
List of files/folders to be added when generating .gitignore file.
gitAttributes – generated .gitattributes file¶
Type |
Default value |
|---|---|
str |
“${PROJECTDIR}/.gitattributes” |
Target generated .gitattributes file.
gitAttributesTemplate – .gitattributes template file¶
Type |
Default value |
|---|---|
str |
“${BASEDIR}/templates/gitattributes” |
Template used by git.attributes task to generate .gitattributes fragment.
gitAttributesStamp – .gitattributes generated stamp file¶
Type |
Default value |
|---|---|
str |
${outputDir}/.gitattributes |
Stamp file for generated .gitattributes fragment.
linuxLineEndings – files with Linux line endings¶
Type |
Default value |
|---|---|
list[str] |
[ “.sh” ] |
List of files extensions (“.xxx” format) with Linux line endings; will be declared with “text eol=lf” attribute in generated .gitattributes fragment.
windowsLineEndings – files with Windows line endings¶
Type |
Default value |
|---|---|
list[str] |
[ “.bat”, “.cmd” ] |
List of files extensions (“.xxx” format) with Windows line endings; will be declared with “text eol=crlf” attribute in generated .gitattributes fragment.
gitEnableDirtyCheck – enable git dirty folder check¶
Type |
Default value |
|---|---|
bool |
${isCIBuild} |
Enablement flag for git.dirty task (by default, returns True if the CI environment variable is defined).
Python venv¶
venvPkgDeps – venv packages dependencies list¶
Type |
Default value |
|---|---|
list[str] |
${PACKAGESREFS} |
List of python packages references to be installed in python venv (using pip requirement specifiers syntax).
venvArchiveDeps – venv archives dependencies list¶
Type |
Default value |
|---|---|
list[str] |
[] |
List of local python module archive paths to be installed in python venv.
venvFileDeps – venv requirement files list¶
Type |
Default value |
|---|---|
list[str] |
[] |
List of pip requirement files to be installed in python venv.
venvName – venv name¶
Type |
Default value |
|---|---|
str |
Resolved by |
Name of the python venv folder, depending on the current environment backend (may be “venv” or “.venv”).
venvRoot – venv root folder¶
Type |
Default value |
|---|---|
str |
Resolved by |
Root python venv folder, depending on the current environment backend (may be a project subfolder, a parent project subfolder or a temporary folder).
Added in version 1.2.0
venvRequirements – generated requirements file name¶
Type |
Default value |
|---|---|
str |
“requirements.txt” |
Name of the generated merged requirements file for python venv (relative to ${PROJECTDIR}).
venvState – output requirements file name¶
Type |
Default value |
|---|---|
str |
“${outputDir}/requirements.txt” |
Name of the generated requirements file, containing a dump off all installed package versions in python venv.
venvRequirementsTemplate – generated requirements file template¶
Type |
Default value |
|---|---|
str |
“${BASEDIR}/templates/requirements.txt” |
Template used to generate ${venvRequirements} merged requirements file.
venvBin – venv executables folder¶
Type |
Default value |
|---|---|
str |
Generated by |
Path of the executables installed in current project venv.
venvPython – venv python executable¶
Type |
Default value |
|---|---|
str |
Generated by |
Path of the python executable in current project venv.
venvUpdateInput – input file for venv update task¶
Type |
Default value |
|---|---|
str |
${PROJECTDIR}/${venvRequirements} |
Overridable input file pointer for py.venv task.
Added in version 1.2.0
backendUseRequirements – is backend using requirements?¶
Type |
Default value |
|---|---|
bool |
Generated by |
State if current environment backend uses a requirements file or not.
Added in version 1.2.0
backendLegacy – is backend a legacy one?¶
Type |
Default value |
|---|---|
bool |
Generated by |
State if current environment backend is a legacy implementation (i.e. using buildenv version < 2) or not.
Added in version 1.2.0
buildenvFolder – legacy buildenv folder¶
Type |
Default value |
|---|---|
str |
Generated by |
Gets the folder for legacy buildenv implementation (empty string if using an environment backend version >= 2).
Added in version 1.2.0
buildenvRefresh – trigger for legacy buildenv scripts generation¶
Type |
Default value |
|---|---|
str |
“${backendLegacy}” |
Enablement condition for buildenv task.
System dependencies¶
systemDeps – system dependencies description¶
Type |
Default value |
|---|---|
dict[str,dict[str,str]] |
Map of system required commands + instructions |
This maps lists required system commands (dependencies) + install instructions.
Map keys are commands that are expected to be found on the system path.
Map values are maps containing install instructions, indexed by the install method key:
if the key is apt, the instruction value is a list of apt packages to be installed to provide this command at system level. The corresponding instruction is displayed only if apt command is available on the system (e.g. on Ubuntu linux or any other Debian-like Linux distribution).
if the key is url, the instruction value is an URL string, pointing to a web page describing how to install this command.
Example:
systemDeps:
git:
apt: ["git"]
url: https://git-scm.com/downloads
Build context¶
isLocalBuild – is the current build running locally?¶
Type |
Default value |
|---|---|
bool |
Generated by |
Checks if the current build is running in local (returns True if the CI environment variable is not defined).
Added in version 1.1.0
isCIBuild – is the current build running in CI?¶
Type |
Default value |
|---|---|
bool |
Generated by |
Checks if the current build is running in CI (returns True if the CI environment variable is defined).
Added in version 1.1.0
Java runtime¶
Some tools need the java runtime to be available; following items help to resolve this command for nmk tasks.
javaRuntime – resolved java command path¶
Type |
Default value |
|---|---|
str |
Generated by |
Resolves the java command, from provided custom path (in ${javaRuntimeCustomPath}) or from system path.
Note
Resolved path is empty if the command is not found on system path, and if provided custom path is missing or doesn’t exist.
Added in version 1.3.0
javaRuntimeCustomPath – java command custom path¶
Type |
Default value |
|---|---|
str |
“” |
Provides a custom path for java command to be used instead of the system command.
Added in version 1.3.0