spl-core 4.1.2__tar.gz → 4.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. {spl_core-4.1.2 → spl_core-4.3.0}/PKG-INFO +14 -2
  2. {spl_core-4.1.2 → spl_core-4.3.0}/README.md +1 -1
  3. {spl_core-4.1.2 → spl_core-4.3.0}/pyproject.toml +19 -18
  4. spl_core-4.3.0/src/spl_core/__init__.py +1 -0
  5. spl_core-4.3.0/src/spl_core/__run.py +12 -0
  6. {spl_core-4.1.2 → spl_core-4.3.0}/src/spl_core/common/command_line_executor.py +3 -1
  7. spl_core-4.3.0/src/spl_core/kickstart/create.py +66 -0
  8. spl_core-4.3.0/src/spl_core/kickstart/templates/application/.vscode/cmake-variants.json +20 -0
  9. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/application}/KConfig +2 -2
  10. spl_core-4.3.0/src/spl_core/kickstart/templates/application/src/greeter/CMakeLists.txt +3 -0
  11. spl_core-4.3.0/src/spl_core/kickstart/templates/application/src/greeter/doc/_images/screenshot.png +0 -0
  12. spl_core-4.3.0/src/spl_core/kickstart/templates/application/src/greeter/doc/index.rst +26 -0
  13. spl_core-4.3.0/src/spl_core/kickstart/templates/application/src/greeter/src/greeter.c +24 -0
  14. spl_core-4.3.0/src/spl_core/kickstart/templates/application/src/greeter/src/greeter.h +6 -0
  15. spl_core-4.3.0/src/spl_core/kickstart/templates/application/src/greeter/test/test_greeter.cc +27 -0
  16. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/doc/index.rst → spl_core-4.3.0/src/spl_core/kickstart/templates/application/src/main/doc/index.rst +6 -2
  17. spl_core-4.3.0/src/spl_core/kickstart/templates/application/src/main/src/main.c +13 -0
  18. spl_core-4.3.0/src/spl_core/kickstart/templates/application/test/EnglishVariant/test__EnglishVariant.py +16 -0
  19. spl_core-4.3.0/src/spl_core/kickstart/templates/application/test/German/test__GermanVariant.py +16 -0
  20. spl_core-4.3.0/src/spl_core/kickstart/templates/application/variants/EnglishVariant/parts.cmake +2 -0
  21. spl_core-4.3.0/src/spl_core/kickstart/templates/application/variants/GermanVariant/config.cmake +1 -0
  22. spl_core-4.3.0/src/spl_core/kickstart/templates/application/variants/GermanVariant/config.txt +13 -0
  23. spl_core-4.3.0/src/spl_core/kickstart/templates/application/variants/GermanVariant/parts.cmake +2 -0
  24. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/.gitignore +3 -0
  25. spl_core-4.3.0/src/spl_core/kickstart/templates/project/.vscode/extensions.json +20 -0
  26. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/.vscode/tasks.json +24 -4
  27. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/CMakeLists.txt +9 -1
  28. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/build.ps1 +47 -17
  29. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/conf.py +8 -6
  30. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/doc/Doxyfile.in +2 -2
  31. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/doc/common/index.rst +1 -1
  32. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/doc/components/index.rst +2 -3
  33. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/doc/doxygen-awesome/doxygen-awesome.css +16 -16
  34. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/doc/test_report_template.txt +0 -2
  35. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/index.rst +1 -0
  36. spl_core-4.3.0/src/spl_core/kickstart/templates/project/pipfile +6 -0
  37. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/pytest.ini +2 -1
  38. spl_core-4.3.0/src/spl_core/kickstart/templates/project/scoopfile.json +14 -0
  39. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_tools -%} tools {%- endif %}/toolchains/clang/toolchain.cmake → spl_core-4.3.0/src/spl_core/kickstart/templates/project/tools/toolchains/clang/toolchain.cmake +1 -1
  40. spl_core-4.3.0/src/spl_core/main.py +44 -0
  41. spl_core-4.1.2/src/spl_core/__init__.py +0 -1
  42. spl_core-4.1.2/src/spl_core/common/cmake.py +0 -52
  43. spl_core-4.1.2/src/spl_core/project_creator/creator.py +0 -133
  44. spl_core-4.1.2/src/spl_core/project_creator/templates/project/cookiecutter.json +0 -14
  45. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.flake8 +0 -2
  46. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/cmake-variants.json +0 -18
  47. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/extensions.json +0 -18
  48. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/LICENSE +0 -21
  49. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/Pipfile +0 -30
  50. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/README.md +0 -7
  51. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/install-mandatory.bat +0 -1
  52. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/scoopfile.json +0 -47
  53. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/test_build.py +0 -39
  54. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/test_unittests.py +0 -28
  55. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/utils.py +0 -26
  56. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/tools/setup/git-config.ps1 +0 -8
  57. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/CMakeLists.txt +0 -3
  58. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/_images/screenshot.png +0 -0
  59. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/design.rst +0 -25
  60. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/index.rst +0 -8
  61. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/src/component.c +0 -31
  62. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/src/component.h +0 -1
  63. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/test/test_component.cc +0 -60
  64. spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/src/main.c +0 -17
  65. spl_core-4.1.2/src/spl_core/project_creator/templates/variant/cookiecutter.json +0 -4
  66. spl_core-4.1.2/src/spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/config.txt +0 -1
  67. spl_core-4.1.2/src/spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/parts.cmake +0 -2
  68. spl_core-4.1.2/src/spl_core/project_creator/variant.py +0 -23
  69. spl_core-4.1.2/src/spl_core/project_creator/workspace_artifacts.py +0 -36
  70. {spl_core-4.1.2 → spl_core-4.3.0}/LICENSE +0 -0
  71. {spl_core-4.1.2 → spl_core-4.3.0}/src/spl_core/common/__init__.py +0 -0
  72. {spl_core-4.1.2 → spl_core-4.3.0}/src/spl_core/common/path.py +0 -0
  73. {spl_core-4.1.2 → spl_core-4.3.0}/src/spl_core/gcov_maid/__init__.py +0 -0
  74. {spl_core-4.1.2 → spl_core-4.3.0}/src/spl_core/gcov_maid/gcov_maid.py +0 -0
  75. {spl_core-4.1.2 → spl_core-4.3.0}/src/spl_core/kconfig/__init__.py +0 -0
  76. {spl_core-4.1.2 → spl_core-4.3.0}/src/spl_core/kconfig/kconfig.py +0 -0
  77. {spl_core-4.1.2/src/spl_core/project_creator → spl_core-4.3.0/src/spl_core/kickstart}/__init__.py +0 -0
  78. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %} → spl_core-4.3.0/src/spl_core/kickstart/templates/application/src}/main/CMakeLists.txt +0 -0
  79. {spl_core-4.1.2/src/spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}} → spl_core-4.3.0/src/spl_core/kickstart/templates/application/variants/EnglishVariant}/config.cmake +0 -0
  80. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/.vscode/cmake-kits.json +0 -0
  81. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/.vscode/launch.json +0 -0
  82. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/.vscode/settings.json +0 -0
  83. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/build.bat +0 -0
  84. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/doc/doxygen-awesome/LICENSE +0 -0
  85. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/doc/software_architecture/index.rst +0 -0
  86. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}} → spl_core-4.3.0/src/spl_core/kickstart/templates/project}/doc/software_requirements/index.rst +0 -0
  87. {spl_core-4.1.2/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_tools -%} tools {%- endif %} → spl_core-4.3.0/src/spl_core/kickstart/templates/project/tools}/toolchains/gcc/toolchain.cmake +0 -0
  88. {spl_core-4.1.2 → spl_core-4.3.0}/src/spl_core/test_utils/base_variant_test_runner.py +0 -0
  89. {spl_core-4.1.2 → spl_core-4.3.0}/src/spl_core/test_utils/spl_build.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spl-core
3
- Version: 4.1.2
3
+ Version: 4.3.0
4
4
  Summary: Software Product Line Support for CMake
5
5
  Home-page: https://github.com/avengineers/spl-core
6
6
  License: MIT
@@ -17,10 +17,22 @@ Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
18
18
  Classifier: Topic :: Software Development :: Libraries
19
19
  Requires-Dist: cookiecutter (==2.1.1)
20
+ Requires-Dist: doxysphinx (>=3.3.7,<4.0.0)
20
21
  Requires-Dist: gcovr
21
22
  Requires-Dist: hammocking
22
23
  Requires-Dist: kconfiglib
23
24
  Requires-Dist: py-app-dev (>=2.1.0,<3.0.0)
25
+ Requires-Dist: sphinx (>=7.3.5,<8.0.0)
26
+ Requires-Dist: sphinx-copybutton (>=0.5.2,<0.6.0)
27
+ Requires-Dist: sphinx-needs (>=2.0.0,<3.0.0)
28
+ Requires-Dist: sphinx-new-tab-link (>=0.4.0,<0.5.0)
29
+ Requires-Dist: sphinx-rtd-size (>=0.2.0,<0.3.0)
30
+ Requires-Dist: sphinx-rtd-theme (>=2.0.0,<3.0.0)
31
+ Requires-Dist: sphinx-test-reports (>=1.0.2,<2.0.0)
32
+ Requires-Dist: sphinxcontrib-datatemplates (>=0.11.0,<0.12.0)
33
+ Requires-Dist: sphinxcontrib-mermaid (>=0.9.2,<0.10.0)
34
+ Requires-Dist: sphinxcontrib-plantuml (>=0.29,<0.30)
35
+ Requires-Dist: typer[all] (>=0.12.3,<0.13.0)
24
36
  Project-URL: Bug Tracker, https://github.com/avengineers/spl-core/issues
25
37
  Project-URL: Changelog, https://github.com/avengineers/spl-core/blob/develop/CHANGELOG.md
26
38
  Project-URL: Documentation, https://spl-core.readthedocs.io
@@ -55,7 +67,7 @@ _SPL Core_ is our CMake module to support multiple projects as variants of one S
55
67
  With the integrated project creator you can create a new SPL workspace, e.g.:
56
68
 
57
69
  ```powershell
58
- pipenv run python src/project_creator/creator.py workspace --name MyProject --variant FLV1/SYS1 --out_dir C:\dev
70
+ pipenv run python src/project_creator/creator.py workspace --name MyProject --variant MyVariant --out_dir C:\dev
59
71
  ```
60
72
 
61
73
  Note: one can use the `--variant` argument several times to create a project with multiple variants.
@@ -26,7 +26,7 @@ _SPL Core_ is our CMake module to support multiple projects as variants of one S
26
26
  With the integrated project creator you can create a new SPL workspace, e.g.:
27
27
 
28
28
  ```powershell
29
- pipenv run python src/project_creator/creator.py workspace --name MyProject --variant FLV1/SYS1 --out_dir C:\dev
29
+ pipenv run python src/project_creator/creator.py workspace --name MyProject --variant MyVariant --out_dir C:\dev
30
30
  ```
31
31
 
32
32
  Note: one can use the `--variant` argument several times to create a project with multiple variants.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "spl-core"
3
- version = "4.1.2"
3
+ version = "4.3.0"
4
4
  description = "Software Product Line Support for CMake"
5
5
  authors = ["Avengineers <karsten.guenther@kamg.de>"]
6
6
  license = "MIT"
@@ -18,6 +18,9 @@ packages = [
18
18
  { include = "spl_core", from = "src" },
19
19
  ]
20
20
 
21
+ [tool.poetry.scripts]
22
+ please = "spl_core.main:main"
23
+
21
24
  [tool.poetry.urls]
22
25
  "Bug Tracker" = "https://github.com/avengineers/spl-core/issues"
23
26
  "Changelog" = "https://github.com/avengineers/spl-core/blob/develop/CHANGELOG.md"
@@ -29,6 +32,18 @@ cookiecutter = {version="==2.1.1"}
29
32
  gcovr = "*"
30
33
  hammocking = "*"
31
34
  kconfiglib = "*"
35
+ typer = {extras = ["all"], version = "^0.12.3"}
36
+ doxysphinx = "^3.3.7"
37
+ sphinx = "^7.3.5"
38
+ sphinx-rtd-theme = "^2.0.0"
39
+ sphinxcontrib-mermaid = "^0.9.2"
40
+ sphinx-needs = "^2.0.0"
41
+ sphinx-test-reports = "^1.0.2"
42
+ sphinx-rtd-size = "^0.2.0"
43
+ sphinxcontrib-datatemplates = "^0.11.0"
44
+ sphinxcontrib-plantuml = "^0.29"
45
+ sphinx-copybutton = "^0.5.2"
46
+ sphinx-new-tab-link = "^0.4.0"
32
47
 
33
48
  [tool.poetry.group.dev.dependencies]
34
49
  pytest = "^7.0"
@@ -43,17 +58,6 @@ mashumaro = "*"
43
58
  loguru = "*"
44
59
  m2r = "*"
45
60
  flake8 = "*"
46
- sphinx = "*"
47
- sphinx-rtd-theme = "*"
48
- sphinxcontrib-mermaid = "*"
49
- sphinx-needs = "*"
50
- sphinx-test-reports = "*"
51
- doxysphinx = "*"
52
- sphinx-rtd-size = "*"
53
- sphinxcontrib-datatemplates = "*"
54
- sphinxcontrib-plantuml = "*"
55
- sphinx-copybutton = "*"
56
- sphinx-new-tab-link = "*"
57
61
  pipenv = "*"
58
62
  pypeline-runner = "^0.2.1"
59
63
 
@@ -62,11 +66,7 @@ optional = true
62
66
 
63
67
  [tool.poetry.group.docs.dependencies]
64
68
  myst-parser = ">=0.16"
65
- sphinx = ">=4.0"
66
- sphinxcontrib-mermaid = "^0.8.1"
67
69
  mlx-traceability = "^10.0.0"
68
- sphinx-copybutton = "^0.5.2"
69
- sphinx-new-tab-link = "^0.2.2"
70
70
  sphinx-book-theme = "^1.1.2"
71
71
  sphinx-design = "^0.5.0"
72
72
 
@@ -95,7 +95,7 @@ match = "(?!develop$)"
95
95
  prerelease = true
96
96
 
97
97
  [tool.pytest.ini_options]
98
- addopts = " --verbose --capture=tee-sys --junitxml=out/test-report.xml"
98
+ addopts = " -vv --capture=tee-sys --junitxml=out/test-report.xml"
99
99
  pythonpath = ["src", "tests"]
100
100
  testpaths = ["tests"]
101
101
  junit_logging = "all"
@@ -139,7 +139,8 @@ lint.select = [
139
139
  "RUF", # ruff specific
140
140
  ]
141
141
  exclude = [
142
- "bootstrap.py"
142
+ "bootstrap.py",
143
+ "src/spl_core/kickstart/templates/project/conf.py"
143
144
  ]
144
145
 
145
146
  [tool.ruff.lint.per-file-ignores]
@@ -0,0 +1 @@
1
+ __version__ = "4.3.0"
@@ -0,0 +1,12 @@
1
+ """
2
+ Used to run spl-core from the command line when run from this repository.
3
+
4
+ This is required because the spl-core Python module is not visible when running from the repository.
5
+ """
6
+
7
+ import runpy
8
+ import sys
9
+ from pathlib import Path
10
+
11
+ sys.path.insert(0, Path(__file__).parent.parent.absolute().as_posix())
12
+ runpy.run_module("spl_core.main", run_name="__main__")
@@ -30,7 +30,9 @@ class CommandLineExecutor:
30
30
  command = " ".join([cmd] if isinstance(cmd, str) else cmd)
31
31
  output = ""
32
32
  try:
33
- print(f"Running command: {command}")
33
+ print("=" * 120)
34
+ print(f"= Running command: {command}")
35
+ print("=" * 120)
34
36
  with subprocess.Popen(
35
37
  command,
36
38
  cwd=str(self.current_working_directory or Path.cwd()),
@@ -0,0 +1,66 @@
1
+ import shutil
2
+ from pathlib import Path
3
+ from typing import List, Optional, Union
4
+
5
+ from py_app_dev.core.exceptions import UserNotificationException
6
+ from py_app_dev.core.logging import logger
7
+
8
+
9
+ class ProjectBuilder:
10
+ def __init__(self, project_dir: Path, input_dir: Optional[Path] = None) -> None:
11
+ self.project_dir = project_dir
12
+ self.input_dir = input_dir if input_dir else Path(__file__).parent.joinpath("templates")
13
+
14
+ self.dirs: List[Path] = []
15
+ self.check_target_directory_flag = True
16
+
17
+ def with_disable_target_directory_check(self) -> "ProjectBuilder":
18
+ self.check_target_directory_flag = False
19
+ return self
20
+
21
+ def with_dir(self, dir: Union[Path, str]) -> "ProjectBuilder":
22
+ self.dirs.append(self.resolve_file_path(dir))
23
+ return self
24
+
25
+ def resolve_file_paths(self, files: List[Path | str]) -> List[Path]:
26
+ return [self.resolve_file_path(file) for file in files]
27
+
28
+ def resolve_file_path(self, file: Union[Path, str]) -> Path:
29
+ return self.input_dir.joinpath(file) if isinstance(file, str) else file
30
+
31
+ @staticmethod
32
+ def _check_target_directory(project_dir: Path) -> None:
33
+ if project_dir.is_dir() and any(project_dir.iterdir()):
34
+ raise UserNotificationException(f"Project directory '{project_dir}' is not empty. Use --force to override.")
35
+
36
+ def build(self) -> None:
37
+ if self.check_target_directory_flag:
38
+ self._check_target_directory(self.project_dir)
39
+ for dir in self.dirs:
40
+ shutil.copytree(dir, self.project_dir, dirs_exist_ok=True)
41
+
42
+
43
+ class KickstartProject:
44
+ """Kickstart a new project in the given directory.
45
+
46
+ Args:
47
+ project_dir (Path): The directory where the project should be created.
48
+ force (bool, optional): If True, the project directory will be overridden if it is not empty. Defaults to False.
49
+ no_application (bool, optional): If True, the project will not contain variants and components.
50
+ """
51
+
52
+ def __init__(self, project_dir: Path, force: bool = False, no_application: bool = False) -> None:
53
+ self.logger = logger.bind()
54
+ self.project_dir = project_dir
55
+ self.force = force
56
+ self.no_application = no_application
57
+
58
+ def run(self) -> None:
59
+ self.logger.info(f"Kickstart new project in '{self.project_dir.absolute().as_posix()}'")
60
+ project_builder = ProjectBuilder(self.project_dir)
61
+ if self.force:
62
+ project_builder.with_disable_target_directory_check()
63
+ project_builder.with_dir("project")
64
+ if not self.no_application:
65
+ project_builder.with_dir("application")
66
+ project_builder.build()
@@ -0,0 +1,20 @@
1
+ {
2
+ "variant": {
3
+ "choices": {"EnglishVariant": {
4
+ "buildType": "EnglishVariant",
5
+ "long": "select to build variant 'EnglishVariant'",
6
+ "settings": {
7
+ "VARIANT": "EnglishVariant"
8
+ },
9
+ "short": "EnglishVariant"
10
+ }, "GermanVariant": {
11
+ "buildType": "GermanVariant",
12
+ "long": "select to build variant 'GermanVariant'",
13
+ "settings": {
14
+ "VARIANT": "GermanVariant"
15
+ },
16
+ "short": "GermanVariant"
17
+ }},
18
+ "default": "EnglishVariant"
19
+ }
20
+ }
@@ -17,7 +17,7 @@ menu "Linking"
17
17
  endmenu
18
18
 
19
19
  menu "Feature Model"
20
- config USE_COMPONENT
21
- bool "Enable features of component"
20
+ config LANG_DE
21
+ bool "German language selection"
22
22
  default n
23
23
  endmenu
@@ -0,0 +1,3 @@
1
+ spl_add_source(src/greeter.c)
2
+ spl_add_test_source(test/test_greeter.cc)
3
+ spl_create_component(LONG_NAME "Greeter")
@@ -0,0 +1,26 @@
1
+ Software Detailed Design
2
+ ========================
3
+
4
+ .. figure:: _images/screenshot.png
5
+
6
+ .. mermaid::
7
+
8
+ graph TD
9
+ A[Start] --> B{Language}
10
+ B -->|DE| C[Hallo Welt]
11
+ B -->|EN| D[Hello World]
12
+ C --> E[End]
13
+ D --> E
14
+
15
+ Requirements
16
+ ------------
17
+
18
+ .. spec:: Say Hello
19
+ :id: SWDD_GREETER-001
20
+ :integrity: QM
21
+
22
+ {% if config.LANG_DE %}
23
+ It shall greet the user with ``Hallo Welt``.
24
+ {% else %}
25
+ It shall greet the user with ``Hello World``.
26
+ {% endif %}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @file greeter.c
3
+ * @brief Greeter implementation.
4
+ */
5
+
6
+
7
+ #include "greeter.h"
8
+ #include "autoconf.h"
9
+
10
+ /*!
11
+ * @rst
12
+ *
13
+ * .. impl:: Select the greeting message
14
+ * :id: SWIMPL_GREETER-001
15
+ * :implements: SWDD_GREETER-001
16
+ * @endrst
17
+ */
18
+ const char* get_greeting() {
19
+ #if defined(CONFIG_LANG_DE) && CONFIG_LANG_DE == 1
20
+ return "Hallo, Welt!";
21
+ #else
22
+ return "Hello, world!";
23
+ #endif
24
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef GREETER_H
2
+ #define GREETER_H
3
+
4
+ extern const char* get_greeting();
5
+
6
+ #endif // GREETER_H
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @file
3
+ */
4
+ #include <gtest/gtest.h>
5
+
6
+ extern "C" {
7
+ #include "greeter.h"
8
+ #include "autoconf.h"
9
+ }
10
+
11
+ #if defined(CONFIG_LANG_DE) && CONFIG_LANG_DE == 1
12
+ const char *greeting = "Hallo, Welt!";
13
+ #else
14
+ const char *greeting = "Hello, world!";
15
+ #endif
16
+ /*!
17
+ * @rst
18
+ *
19
+ * .. test:: greeter.test_get_greeting
20
+ * :id: TS_GREETER-001
21
+ * :tests: SWDD_GREETER-001
22
+ *
23
+ * @endrst
24
+ */
25
+ TEST(greeter, test_get_greeting) {
26
+ EXPECT_STREQ(greeting, get_greeting());
27
+ }
@@ -9,6 +9,10 @@ Introduction
9
9
 
10
10
  This is the documentation for the ``Main`` component.
11
11
 
12
- {% if config.USE_COMPONENT %}
13
- ``USE_COMPONENT`` is enabled. Therefore ``Main`` shall call ``Component``.
12
+ The application will say
13
+ {% if config.LANG_DE %}
14
+ ``Hallo Welt``
15
+ {% else %}
16
+ ``Hello World``
14
17
  {% endif %}
18
+ .
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @file main.c
3
+ * @brief Main file for the greeter application.
4
+ */
5
+
6
+ #include <stdio.h>
7
+ #include "greeter.h"
8
+
9
+ int main(int argc, char *argv[])
10
+ {
11
+ printf("%s\n", get_greeting());
12
+ return 0;
13
+ }
@@ -0,0 +1,16 @@
1
+ from pathlib import Path
2
+ from typing import List
3
+
4
+ from spl_core.test_utils.base_variant_test_runner import BaseVariantTestRunner
5
+
6
+
7
+ class Test_EnglishVariant(BaseVariantTestRunner):
8
+ @property
9
+ def component_paths(self) -> List[Path]:
10
+ return [
11
+ Path("src/greeter"),
12
+ ]
13
+
14
+ @property
15
+ def expected_build_artifacts(self) -> List[Path]:
16
+ return [Path("my_main.exe"), Path("compile_commands.json")]
@@ -0,0 +1,16 @@
1
+ from pathlib import Path
2
+ from typing import List
3
+
4
+ from spl_core.test_utils.base_variant_test_runner import BaseVariantTestRunner
5
+
6
+
7
+ class Test_GermanVariant(BaseVariantTestRunner):
8
+ @property
9
+ def component_paths(self) -> List[Path]:
10
+ return [
11
+ Path("src/greeter"),
12
+ ]
13
+
14
+ @property
15
+ def expected_build_artifacts(self) -> List[Path]:
16
+ return [Path("my_main.exe"), Path("compile_commands.json")]
@@ -0,0 +1,2 @@
1
+ spl_add_component(src/main)
2
+ spl_add_component(src/greeter)
@@ -0,0 +1 @@
1
+ set(CMAKE_TOOLCHAIN_FILE tools/toolchains/clang/toolchain.cmake CACHE PATH "toolchain file")
@@ -0,0 +1,13 @@
1
+
2
+ #
3
+ # Linking
4
+ #
5
+ CONFIG_LINKER_OUTPUT_FILE="my_main.exe"
6
+ CONFIG_LINKER_BYPRODUCTS_EXTENSIONS="map"
7
+ # end of Linking
8
+
9
+ #
10
+ # Feature Model
11
+ #
12
+ CONFIG_LANG_DE=y
13
+ # end of Feature Model
@@ -0,0 +1,2 @@
1
+ spl_add_component(src/main)
2
+ spl_add_component(src/greeter)
@@ -1,3 +1,6 @@
1
+ # Python virtual environment
2
+ .venv
3
+
1
4
  # Binary output dir, not recommended to push binary results to Git.
2
5
  /build
3
6
 
@@ -0,0 +1,20 @@
1
+ {
2
+ "recommendations": [
3
+ "mhutchie.git-graph",
4
+ "ms-vscode.cmake-tools",
5
+ "twxs.cmake",
6
+ "ms-vscode.cpptools",
7
+ "ms-vscode.cpptools-themes",
8
+ "visualstudioexptteam.intellicode-api-usage-examples",
9
+ "visualstudioexptteam.vscodeintellicode",
10
+ "haugerbr.project-tasks",
11
+ "avengineers.show-link-list",
12
+ "ms-python.vscode-pylance",
13
+ "ms-python.python",
14
+ "donjayamanne.python-environment-manager",
15
+ "felipecaputo.git-project-manager",
16
+ "ms-vscode.powershell",
17
+ "waderyan.gitblame",
18
+ "sandcastle.vscode-open"
19
+ ]
20
+ }
@@ -69,13 +69,25 @@
69
69
  "label": "Configure variant",
70
70
  "detail": "Feature configuration using KConfig",
71
71
  "type": "shell",
72
- "command": "pipenv run guiconfig",
72
+ "command": ".venv/Scripts/poetry run guiconfig",
73
73
  "options": {
74
74
  "env": {
75
75
  "KCONFIG_CONFIG": "variants/${input:variant}/config.txt"
76
76
  }
77
77
  },
78
78
  "problemMatcher": []
79
+ },
80
+ {
81
+ "label": "open report html",
82
+ "command": "${workspaceFolder}/build/${input:variant}/test/src/${input:component}/reports/html/index.html",
83
+ "type": "shell",
84
+ "presentation": {
85
+ "reveal": "always"
86
+ },
87
+ "group": {
88
+ "kind": "build",
89
+ "isDefault": false
90
+ }
79
91
  }
80
92
  ],
81
93
  "inputs": [
@@ -84,9 +96,17 @@
84
96
  "id": "variant",
85
97
  "description": "Which variant do you want to select?",
86
98
  "options": [
87
- {%- for variant in cookiecutter.variants.values() -%}
88
- "{{ variant["flavor"] }}/{{ variant["subsystem"] }}",
89
- {%- endfor -%}
99
+ "EnglishVariant",
100
+ "GermanVariant"
101
+ ]
102
+ },
103
+ {
104
+ "type": "pickString",
105
+ "id": "component",
106
+ "description": "Which component do you want to select?",
107
+ "options": [
108
+ "greeter",
109
+ "main"
90
110
  ]
91
111
  }
92
112
  ]
@@ -2,15 +2,23 @@
2
2
  cmake_minimum_required(VERSION 3.24.0)
3
3
  cmake_policy(VERSION 3.24)
4
4
 
5
+ # configure the current variant to be build
5
6
  set(BUILD_KIT prod CACHE STRING "Target Group to build.")
6
7
 
7
8
  include(${CMAKE_SOURCE_DIR}/variants/${VARIANT}/config.cmake)
8
9
 
9
10
  if(BUILD_KIT STREQUAL prod)
10
11
  project(${VARIANT} C ASM)
12
+ set(VARIANT_ADDITIONAL_COMPILE_C_FLAGS -Dstatic_scope_file=static)
11
13
  else()
14
+ # In case of test the project is a C++ project due to GTest usage
12
15
  project(${VARIANT} C ASM CXX)
13
- set(VARIANT_ADDITIONAL_COMPILE_C_FLAGS -Dstatic= -save-temps)
16
+
17
+ # define static to nothing on file scope to allow access to
18
+ # static variables and function in unit test cases.
19
+ # Furthermore store temporary files during compilation to
20
+ # get preprocessed files.
21
+ set(VARIANT_ADDITIONAL_COMPILE_C_FLAGS -Dstatic_scope_file= -save-temps)
14
22
  endif()
15
23
 
16
24
  # Fetch all external dependencies into modules directory
@@ -15,6 +15,8 @@ https://go.microsoft.com/fwlink/?LinkID=135170
15
15
  param(
16
16
  [Parameter(Mandatory = $false, HelpMessage = 'Install all dependencies required to build. (Switch, default: false)')]
17
17
  [switch]$install = $false,
18
+ [Parameter(Mandatory = $false, HelpMessage = 'Build the target.')]
19
+ [switch]$build = $false,
18
20
  [Parameter(Mandatory = $false, HelpMessage = 'Clean build, wipe out all build artifacts. (Switch, default: false)')]
19
21
  [switch]$clean = $false,
20
22
  [Parameter(Mandatory = $false, HelpMessage = 'Build kit to be used. (String, default: "prod")')]
@@ -74,6 +76,38 @@ function Test-RunningInCIorTestEnvironment {
74
76
  return [Boolean]($Env:JENKINS_URL -or $Env:PYTEST_CURRENT_TEST -or $Env:GITHUB_ACTIONS)
75
77
  }
76
78
 
79
+ # Consider CI environment variables (e.g. on Jenkins BRANCH_NAME and CHANGE_TARGET) to filter tests in release branch builds
80
+ function Get-ReleaseBranchPytestFilter {
81
+ $ChangeId = $env:CHANGE_ID
82
+ $BranchName = $env:BRANCH_NAME
83
+ $ChangeTarget = $env:CHANGE_TARGET
84
+
85
+ $targetBranch = ''
86
+
87
+ if (-not $ChangeId -and $BranchName -and $BranchName.StartsWith("release/")) {
88
+ $targetBranch = $BranchName
89
+ }
90
+
91
+ if ($ChangeId -and $ChangeTarget -and $ChangeTarget.StartsWith("release/") ) {
92
+ $targetBranch = $ChangeTarget
93
+ }
94
+
95
+ $filter = ''
96
+ if ($targetBranch -and ($targetBranch -match 'release/([^/]+/[^/]+)(.*)')) {
97
+ $filter = $Matches[1]
98
+ }
99
+
100
+ return $filter
101
+ }
102
+
103
+ function Invoke-Bootstrap {
104
+ # Download bootstrap scripts from external repository
105
+ Invoke-RestMethod https://raw.githubusercontent.com/avengineers/bootstrap-installer/v1.5.0/install.ps1 | Invoke-Expression
106
+ # Execute bootstrap script
107
+ . .\.bootstrap\bootstrap.ps1
108
+ }
109
+
110
+
77
111
  # Build with given parameters
78
112
  Function Invoke-Build {
79
113
  param (
@@ -110,9 +144,9 @@ Function Invoke-Build {
110
144
 
111
145
  # Filter pytest test cases
112
146
  $filterCmd = ''
113
- # Consider environment variable BRANCH_NAME (e.g. on Jenkins) to filter tests in release branch builds
114
- if ($Env:BRANCH_NAME -and ($Env:BRANCH_NAME -match 'release/([^/]+/[^/]+)(.*)')) {
115
- $filterCmd = "-k " + $Matches[1]
147
+ $releaseBranchFilter = Get-ReleaseBranchPytestFilter
148
+ if ($releaseBranchFilter) {
149
+ $filterCmd = "-k '$releaseBranchFilter'"
116
150
  }
117
151
  # otherwise consider command line option '-filter' if given
118
152
  elseif ($filter) {
@@ -135,7 +169,7 @@ Function Invoke-Build {
135
169
  $dirs = Get-Childitem -Include config.cmake -Path variants -Recurse | Resolve-Path -Relative
136
170
  $variantsList = @()
137
171
  Foreach ($dir in $dirs) {
138
- $variant = (get-item $dir).Directory.Parent.BaseName + "/" + (get-item $dir).Directory.BaseName
172
+ $variant = (get-item $dir).Directory.BaseName
139
173
  $variantsList += $variant
140
174
  }
141
175
  $variantsSelected = @()
@@ -158,7 +192,7 @@ Function Invoke-Build {
158
192
  }
159
193
 
160
194
  # Select 'test' build kit based on target
161
- if ($target.Contains("unittests") -or $target.Contains("reports")) {
195
+ if ($target.Contains("unittests") -or $target.Contains("reports") -or $target.Contains("docs")) {
162
196
  $buildKit = "test"
163
197
  }
164
198
 
@@ -211,21 +245,17 @@ Push-Location $PSScriptRoot
211
245
  Write-Output "Running in ${pwd}"
212
246
 
213
247
  try {
248
+ if (Test-RunningInCIorTestEnvironment -or $Env:USER_PATH_FIRST) {
249
+ Initialize-EnvPath
250
+ }
251
+
214
252
  if ($install) {
215
- # Installation of Scoop, Python and pipenv via bootstrap
216
- if (-Not (Test-Path -Path '.bootstrap')) {
217
- New-Item -ItemType Directory '.bootstrap'
218
- }
219
- Invoke-RestMethod "https://raw.githubusercontent.com/avengineers/bootstrap/v1.3.0/bootstrap.ps1" -OutFile ".\.bootstrap\bootstrap.ps1"
220
- Invoke-CommandLine ". .\.bootstrap\bootstrap.ps1" -Silent $true
221
- Write-Output "For installation changes to take effect, please close and re-open your current shell."
253
+ # bootstrap environment
254
+ Invoke-Bootstrap
222
255
  }
223
- else {
256
+
257
+ if ($build) {
224
258
  # Call build system
225
- if (Test-RunningInCIorTestEnvironment -or $Env:USER_PATH_FIRST) {
226
- Initialize-EnvPath
227
- }
228
- # Call CMake
229
259
  Invoke-Build `
230
260
  -target $target `
231
261
  -buildKit $buildKit `