spl-core 7.4.0__tar.gz → 7.5.1__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 (71) hide show
  1. {spl_core-7.4.0 → spl_core-7.5.1}/PKG-INFO +6 -6
  2. {spl_core-7.4.0 → spl_core-7.5.1}/pyproject.toml +9 -7
  3. spl_core-7.5.1/src/spl_core/__init__.py +1 -0
  4. spl_core-7.5.1/src/spl_core/kickstart/templates/application/test/EnglishVariant/test__EnglishVariant.py +56 -0
  5. spl_core-7.5.1/src/spl_core/kickstart/templates/application/test/German/test__GermanVariant.py +56 -0
  6. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/test_utils/base_variant_test_runner.py +16 -6
  7. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/test_utils/spl_build.py +71 -25
  8. spl_core-7.4.0/src/spl_core/__init__.py +0 -1
  9. spl_core-7.4.0/src/spl_core/kickstart/templates/application/test/EnglishVariant/test__EnglishVariant.py +0 -16
  10. spl_core-7.4.0/src/spl_core/kickstart/templates/application/test/German/test__GermanVariant.py +0 -16
  11. {spl_core-7.4.0 → spl_core-7.5.1}/LICENSE +0 -0
  12. {spl_core-7.4.0 → spl_core-7.5.1}/README.md +0 -0
  13. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/__run.py +0 -0
  14. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/common/__init__.py +0 -0
  15. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/common/command_line_executor.py +0 -0
  16. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/common/path.py +0 -0
  17. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/common.cmake +0 -0
  18. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/conan.cmake +0 -0
  19. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/config/KConfig +0 -0
  20. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/gcov_maid/__init__.py +0 -0
  21. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/gcov_maid/gcov_maid.py +0 -0
  22. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kconfig/__init__.py +0 -0
  23. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kconfig/kconfig.py +0 -0
  24. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kconfig.cmake +0 -0
  25. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/__init__.py +0 -0
  26. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/create.py +0 -0
  27. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/.vscode/cmake-variants.json +0 -0
  28. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/KConfig +0 -0
  29. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/src/greeter/CMakeLists.txt +0 -0
  30. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/src/greeter/doc/_images/screenshot.png +0 -0
  31. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/src/greeter/doc/index.rst +0 -0
  32. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/src/greeter/src/greeter.c +0 -0
  33. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/src/greeter/src/greeter.h +0 -0
  34. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/src/greeter/test/test_greeter.cc +0 -0
  35. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/src/main/CMakeLists.txt +0 -0
  36. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/src/main/doc/index.rst +0 -0
  37. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/src/main/src/main.c +0 -0
  38. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/variants/EnglishVariant/config.cmake +0 -0
  39. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/variants/EnglishVariant/parts.cmake +0 -0
  40. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/variants/GermanVariant/config.cmake +0 -0
  41. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/variants/GermanVariant/config.txt +0 -0
  42. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/application/variants/GermanVariant/parts.cmake +0 -0
  43. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/.gitignore +0 -0
  44. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/.vscode/cmake-kits.json +0 -0
  45. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/.vscode/extensions.json +0 -0
  46. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/.vscode/launch.json +0 -0
  47. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/.vscode/settings.json +0 -0
  48. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/.vscode/tasks.json +0 -0
  49. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/CMakeLists.txt +0 -0
  50. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/README.md +0 -0
  51. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/bootstrap.json +0 -0
  52. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/build.bat +0 -0
  53. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/build.ps1 +0 -0
  54. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/conf.py +0 -0
  55. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/doc/Doxyfile.in +0 -0
  56. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/doc/common/index.rst +0 -0
  57. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/doc/components/index.rst +0 -0
  58. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/doc/doxygen-awesome/LICENSE +0 -0
  59. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/doc/doxygen-awesome/doxygen-awesome.css +0 -0
  60. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/doc/software_architecture/index.rst +0 -0
  61. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/doc/software_requirements/index.rst +0 -0
  62. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/doc/test_report_template.txt +0 -0
  63. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/index.rst +0 -0
  64. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/pypeline.yaml +0 -0
  65. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/pyproject.toml +0 -0
  66. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/pytest.ini +0 -0
  67. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/scoopfile.json +0 -0
  68. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/tools/toolchains/clang/toolchain.cmake +0 -0
  69. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/kickstart/templates/project/tools/toolchains/gcc/toolchain.cmake +0 -0
  70. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/main.py +0 -0
  71. {spl_core-7.4.0 → spl_core-7.5.1}/src/spl_core/spl.cmake +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: spl-core
3
- Version: 7.4.0
3
+ Version: 7.5.1
4
4
  Summary: Software Product Line Support for CMake
5
5
  License: MIT
6
6
  Author: Avengineers
@@ -15,10 +15,10 @@ Classifier: Programming Language :: Python :: 3
15
15
  Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Topic :: Software Development :: Libraries
18
- Requires-Dist: cookiecutter (==2.1.1)
18
+ Requires-Dist: cookiecutter (==2.6.0)
19
19
  Requires-Dist: doxysphinx (>=3.3,<4.0)
20
20
  Requires-Dist: gcovr (>=8.3,<9.0)
21
- Requires-Dist: hammocking (>=0.8,<0.9)
21
+ Requires-Dist: hammocking (>=0.8,<0.10)
22
22
  Requires-Dist: kconfiglib (>=14.1,<15.0)
23
23
  Requires-Dist: mlx-traceability (>=10.0,<11.0)
24
24
  Requires-Dist: myst-parser (>=0.16)
@@ -26,15 +26,15 @@ Requires-Dist: py-app-dev (>=2.1,<3.0)
26
26
  Requires-Dist: sphinx (>=7.3,<8.0)
27
27
  Requires-Dist: sphinx-book-theme (>=1.1,<2.0)
28
28
  Requires-Dist: sphinx-copybutton (>=0.5,<0.6)
29
- Requires-Dist: sphinx-design (>=0.5,<0.6)
29
+ Requires-Dist: sphinx-design (>=0.5,<0.7)
30
30
  Requires-Dist: sphinx-needs (>=2.0,<3.0)
31
- Requires-Dist: sphinx-new-tab-link (>=0.4,<0.5)
31
+ Requires-Dist: sphinx-new-tab-link (>=0.4,<0.9)
32
32
  Requires-Dist: sphinx-rtd-size (>=0.2,<0.3)
33
33
  Requires-Dist: sphinx-rtd-theme (>=2.0,<3.0)
34
34
  Requires-Dist: sphinx-test-reports (>=1.0,<2.0)
35
35
  Requires-Dist: sphinxcontrib-datatemplates (>=0.11,<0.12)
36
36
  Requires-Dist: sphinxcontrib-mermaid (>=0.9,<0.10)
37
- Requires-Dist: sphinxcontrib-plantuml (>=0.29,<0.30)
37
+ Requires-Dist: sphinxcontrib-plantuml (>=0.29,<0.31)
38
38
  Requires-Dist: typer (>=0,<1)
39
39
  Project-URL: Bug Tracker, https://github.com/avengineers/spl-core/issues
40
40
  Project-URL: Changelog, https://github.com/avengineers/spl-core/blob/develop/CHANGELOG.md
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "spl-core"
3
- version = "7.4.0"
3
+ version = "7.5.1"
4
4
  description = "Software Product Line Support for CMake"
5
5
  authors = ["Avengineers <karsten.guenther@kamg.de>"]
6
6
  license = "MIT"
@@ -26,9 +26,9 @@ please = "spl_core.main:main"
26
26
  [tool.poetry.dependencies]
27
27
  python = ">=3.10,<3.12"
28
28
  py-app-dev = "^2.1"
29
- cookiecutter = "==2.1.1"
29
+ cookiecutter = "==2.6.0"
30
30
  gcovr = "^8.3"
31
- hammocking = "^0.8"
31
+ hammocking = ">=0.8,<0.10"
32
32
  kconfiglib = "^14.1"
33
33
  typer = "^0"
34
34
  doxysphinx = "^3.3"
@@ -39,19 +39,19 @@ sphinx-needs = "^2.0"
39
39
  sphinx-test-reports = "^1.0"
40
40
  sphinx-rtd-size = "^0.2"
41
41
  sphinxcontrib-datatemplates = "^0.11"
42
- sphinxcontrib-plantuml = "^0.29"
42
+ sphinxcontrib-plantuml = ">=0.29,<0.31"
43
43
  sphinx-copybutton = "^0.5"
44
- sphinx-new-tab-link = "^0.4"
44
+ sphinx-new-tab-link = ">=0.4,<0.9"
45
45
  myst-parser = ">=0.16"
46
46
  mlx-traceability = "^10.0"
47
47
  sphinx-book-theme = "^1.1"
48
- sphinx-design = "^0.5"
48
+ sphinx-design = ">=0.5,<0.7"
49
49
 
50
50
  [tool.poetry.group.dev.dependencies]
51
51
  pytest = "^7.0"
52
52
  pytest-cov = "^4.0"
53
53
  pre-commit = "^3.1.1"
54
- ruff = "^0.5"
54
+ ruff = ">=0.5,<0.13"
55
55
  jinja2 = "*"
56
56
  testfixtures = "*"
57
57
  junitparser = "*"
@@ -138,6 +138,8 @@ exclude = ["bootstrap.py", "src/spl_core/kickstart/templates/project/conf.py"]
138
138
  "setup.py" = ["D100"]
139
139
  "conftest.py" = ["D100"]
140
140
  "docs/conf.py" = ["D100"]
141
+ "**/test_*.py" = ["S101"]
142
+ "src/spl_core/test_utils/base_variant_test_runner.py" = ["S101"]
141
143
 
142
144
  [tool.ruff.lint.isort]
143
145
  known-first-party = ["spl_core", "tests"]
@@ -0,0 +1 @@
1
+ __version__ = "7.5.1"
@@ -0,0 +1,56 @@
1
+ from typing import ClassVar
2
+
3
+ import pytest
4
+
5
+ from spl_core.test_utils.spl_build import SplBuild
6
+
7
+
8
+ class Test_EnglishVariant:
9
+ variant: str = "EnglishVariant"
10
+ components: ClassVar[list[str]] = ["src/greeter"]
11
+
12
+ @pytest.mark.unittests
13
+ def test_unittests(self) -> None:
14
+ # Arrange
15
+ spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="test", build_type="Debug", target="unittests")
16
+
17
+ # Act
18
+ result = spl_build.execute()
19
+
20
+ # Assert
21
+ assert result == 0, "Building unittests failed"
22
+ for artifact in spl_build.get_components_artifacts(self.components):
23
+ assert artifact.exists(), f"Artifact {artifact} does not exist"
24
+
25
+ @pytest.mark.reports
26
+ def test_reports(self) -> None:
27
+ # Arrange
28
+ spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="test", build_type="Debug", target="reports")
29
+
30
+ # Act
31
+ result = spl_build.execute()
32
+
33
+ # Assert
34
+ assert result == 0, "Building reports failed"
35
+ for artifact in spl_build.get_components_artifacts(self.components):
36
+ assert artifact.exists(), f"Artifact {artifact} does not exist"
37
+
38
+ @pytest.mark.build
39
+ @pytest.mark.parametrize(
40
+ ("build_type"),
41
+ [
42
+ pytest.param("Debug", marks=pytest.mark.debug),
43
+ pytest.param("Release", marks=pytest.mark.release),
44
+ ],
45
+ )
46
+ def test_build(self, build_type: str) -> None:
47
+ # Arrange
48
+ spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="prod", build_type=build_type, target="all")
49
+
50
+ # Act
51
+ result = spl_build.execute()
52
+
53
+ # Assert
54
+ assert result == 0, "Building failed"
55
+ for artifact in [spl_build.build_dir / "main.exe", *spl_build.get_variant_artifacts()]:
56
+ assert artifact.exists(), f"Artifact {artifact} does not exist"
@@ -0,0 +1,56 @@
1
+ from typing import ClassVar
2
+
3
+ import pytest
4
+
5
+ from spl_core.test_utils.spl_build import SplBuild
6
+
7
+
8
+ class Test_GermanVariant:
9
+ variant: str = "GermanVariant"
10
+ components: ClassVar[list[str]] = ["src/greeter"]
11
+
12
+ @pytest.mark.unittests
13
+ def test_unittests(self) -> None:
14
+ # Arrange
15
+ spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="test", build_type="Debug", target="unittests")
16
+
17
+ # Act
18
+ result = spl_build.execute()
19
+
20
+ # Assert
21
+ assert result == 0, "Building unittests failed"
22
+ for artifact in spl_build.get_components_artifacts(self.components):
23
+ assert artifact.exists(), f"Artifact {artifact} does not exist"
24
+
25
+ @pytest.mark.reports
26
+ def test_reports(self) -> None:
27
+ # Arrange
28
+ spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="test", build_type="Debug", target="reports")
29
+
30
+ # Act
31
+ result = spl_build.execute()
32
+
33
+ # Assert
34
+ assert result == 0, "Building reports failed"
35
+ for artifact in spl_build.get_components_artifacts(self.components):
36
+ assert artifact.exists(), f"Artifact {artifact} does not exist"
37
+
38
+ @pytest.mark.build
39
+ @pytest.mark.parametrize(
40
+ ("build_type"),
41
+ [
42
+ pytest.param("Debug", marks=pytest.mark.debug),
43
+ pytest.param("Release", marks=pytest.mark.release),
44
+ ],
45
+ )
46
+ def test_build(self, build_type: str) -> None:
47
+ # Arrange
48
+ spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="prod", build_type=build_type, target="all")
49
+
50
+ # Act
51
+ result = spl_build.execute()
52
+
53
+ # Assert
54
+ assert result == 0, "Building failed"
55
+ for artifact in [spl_build.build_dir / "main.exe", *spl_build.get_variant_artifacts()]:
56
+ assert artifact.exists(), f"Artifact {artifact} does not exist"
@@ -55,14 +55,14 @@ class BaseVariantTestRunner(ABC):
55
55
 
56
56
  def assert_artifact_exists(self, dir: Path, artifact: Path) -> None:
57
57
  if artifact.is_absolute():
58
- assert artifact.exists(), f"Artifact {artifact} does not exist" # noqa: S101
58
+ assert artifact.exists(), f"Artifact {artifact} does not exist"
59
59
  else:
60
- assert Path.joinpath(dir, artifact).exists(), f"Artifact {Path.joinpath(dir, artifact)} does not exist" # noqa: S101
60
+ assert Path.joinpath(dir, artifact).exists(), f"Artifact {Path.joinpath(dir, artifact)} does not exist"
61
61
 
62
62
  @pytest.mark.build
63
63
  def test_build(self, build_type: Optional[str] = None) -> None:
64
64
  spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="prod", build_type=build_type)
65
- assert 0 == spl_build.execute(target="all") # noqa: S101
65
+ assert 0 == spl_build.execute(target="all")
66
66
  for artifact in self.expected_build_artifacts:
67
67
  self.assert_artifact_exists(dir=spl_build.build_dir, artifact=artifact)
68
68
  if self.create_artifacts_archive:
@@ -74,16 +74,26 @@ class BaseVariantTestRunner(ABC):
74
74
  @pytest.mark.unittests
75
75
  def test_unittests(self, build_type: Optional[str] = None) -> None:
76
76
  spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="test", build_type=build_type)
77
- assert 0 == spl_build.execute(target="unittests") # noqa: S101
77
+ assert 0 == spl_build.execute(target="unittests")
78
78
  for artifact in self.expected_test_artifacts:
79
79
  self.assert_artifact_exists(dir=spl_build.build_dir, artifact=artifact)
80
80
 
81
81
  @pytest.mark.reports
82
82
  def test_reports(self, build_type: Optional[str] = None) -> None:
83
83
  spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="test", build_type=build_type)
84
- assert 0 == spl_build.execute(target="reports") # noqa: S101
84
+ assert 0 == spl_build.execute(target="reports")
85
85
  for artifact in self.expected_variant_report_artifacts:
86
86
  self.assert_artifact_exists(dir=spl_build.build_dir, artifact=artifact)
87
87
  for component in self.component_paths:
88
88
  for artifact in self.expected_component_report_artifacts:
89
- self.assert_artifact_exists(dir=Path.joinpath(spl_build.build_dir, "reports", "html", spl_build.build_dir, component, "reports"), artifact=artifact)
89
+ self.assert_artifact_exists(
90
+ dir=Path.joinpath(
91
+ spl_build.build_dir,
92
+ "reports",
93
+ "html",
94
+ spl_build.build_dir,
95
+ component,
96
+ "reports",
97
+ ),
98
+ artifact=artifact,
99
+ )
@@ -3,7 +3,7 @@ import time
3
3
  import zipfile
4
4
  from dataclasses import dataclass
5
5
  from pathlib import Path
6
- from typing import List, Optional
6
+ from typing import Callable, ClassVar, List, Optional
7
7
 
8
8
  from py_app_dev.core.logging import time_it
9
9
 
@@ -39,54 +39,76 @@ class ArtifactsCollection:
39
39
 
40
40
 
41
41
  class SplBuild:
42
- """Class for building an SPL repository."""
43
-
44
- def __init__(self, variant: str, build_kit: str, build_type: Optional[str] = None) -> None:
45
- """
46
- Initialize a SplBuild instance.
47
-
48
- Args:
49
- variant (str): The build variant.
50
- build_kit (str): The build kit.
51
- build_type (str, optional): The build type. Defaults to None.
52
-
53
- """
42
+ """
43
+ Class for building an SPL repository.
44
+
45
+ Relies on build.bat in the root of the SPL repository.
46
+ """
47
+
48
+ @dataclass
49
+ class BuildArtifacts:
50
+ artifacts: list[str]
51
+ # callable to resolve the path to the component artifacts specific to the build target
52
+ path_resolver: Callable[[Path, str], Path]
53
+
54
+ TARGET_VARIANT_BUILD_ARTIFACTS: ClassVar[dict[str, list[str]]] = {"prod/all": ["compile_commands.json"]}
55
+
56
+ TARGET_COMPONENT_BUILD_ARTIFACTS: ClassVar[dict[str, "SplBuild.BuildArtifacts"]] = {
57
+ "test/unittests": BuildArtifacts(
58
+ [
59
+ "coverage.json",
60
+ "junit.xml",
61
+ "reports/coverage/index.html",
62
+ ],
63
+ lambda build_dir, component_name: build_dir / component_name,
64
+ ),
65
+ "test/reports": BuildArtifacts(
66
+ [
67
+ "coverage.html",
68
+ "coverage/index.html",
69
+ "doxygen/html/index.html",
70
+ "unit_test_results.html",
71
+ "unit_test_spec.html",
72
+ ],
73
+ lambda build_dir, component_name: build_dir / "reports" / "html" / build_dir / component_name / "reports",
74
+ ),
75
+ }
76
+
77
+ def __init__(self, variant: str, build_kit: str, build_type: Optional[str] = None, target: Optional[str] = None) -> None:
54
78
  self.variant = variant
55
79
  self.build_kit = build_kit
56
80
  self.build_type = build_type
81
+ self.target = target
57
82
 
58
83
  @property
59
84
  def build_dir(self) -> Path:
60
85
  """
61
- Get the build directory.
62
-
63
- Returns:
64
- Path: The build directory path.
65
-
86
+ Output directory of all build artifacts.
66
87
  """
67
88
  if self.build_type:
68
89
  return Path(f"build/{self.variant}/{self.build_kit}/{self.build_type}")
69
90
  return Path(f"build/{self.variant}/{self.build_kit}")
70
91
 
71
92
  @time_it()
72
- def execute(self, target: str, additional_args: Optional[List[str]] = None) -> int:
93
+ def execute(self, target: Optional[str] = None, additional_args: Optional[List[str]] = None) -> int:
73
94
  """
74
- Build the target
95
+ Execute an SPL build (of a given target).
75
96
 
76
97
  Args:
77
- target (str): The build target.
78
- additional_args (List[str], optional): Additional arguments for building. Defaults to ["-build"].
98
+ target: The target to build, optional, defaults to value given in the constructor.
99
+ additional_args: Additional arguments to pass to the build command.
79
100
 
80
101
  Returns:
81
102
  int: 0 in case of success.
82
103
 
83
104
  """
84
- if additional_args is None:
85
- additional_args = ["-build"]
105
+ if target is None:
106
+ target = self.target if self.target else "all"
86
107
  return_code = -1
87
108
  while True:
88
109
  cmd = [
89
110
  "build.bat",
111
+ "-build",
90
112
  "-buildKit",
91
113
  self.build_kit,
92
114
  "-variants",
@@ -97,7 +119,8 @@ class SplBuild:
97
119
  ]
98
120
  if self.build_type:
99
121
  cmd.extend(["-buildType", self.build_type])
100
- cmd.extend(additional_args)
122
+ if additional_args:
123
+ cmd.extend(additional_args)
101
124
  result = CommandLineExecutor().execute(cmd)
102
125
  return_code = result.returncode
103
126
  if result.returncode:
@@ -113,6 +136,29 @@ class SplBuild:
113
136
  break
114
137
  return return_code
115
138
 
139
+ def get_component_artifacts(self, component_name: str) -> list[Path]:
140
+ if not self.target:
141
+ return []
142
+ target_data = self.TARGET_COMPONENT_BUILD_ARTIFACTS.get(self.build_kit + "/" + self.target)
143
+ if not target_data:
144
+ return []
145
+
146
+ return [target_data.path_resolver(self.build_dir, component_name) / artifact for artifact in target_data.artifacts]
147
+
148
+ def get_components_artifacts(self, component_names: list[str]) -> list[Path]:
149
+ artifacts = []
150
+ for component_name in component_names:
151
+ artifacts.extend(self.get_component_artifacts(component_name))
152
+ return artifacts
153
+
154
+ def get_variant_artifacts(self) -> list[Path]:
155
+ if not self.target:
156
+ return []
157
+ target_data = self.TARGET_VARIANT_BUILD_ARTIFACTS.get(self.build_kit + "/" + self.target)
158
+ if not target_data:
159
+ return []
160
+ return [self.build_dir / artifact for artifact in target_data]
161
+
116
162
  def create_artifacts_archive(self, expected_artifacts: List[Path]) -> Path:
117
163
  """
118
164
  Create a zip file containing the collected artifacts.
@@ -1 +0,0 @@
1
- __version__ = "7.4.0"
@@ -1,16 +0,0 @@
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")]
@@ -1,16 +0,0 @@
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")]
File without changes
File without changes
File without changes
File without changes