spl-core 7.2.3rc1__tar.gz → 7.2.5__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 (69) hide show
  1. {spl_core-7.2.3rc1 → spl_core-7.2.5}/PKG-INFO +2 -2
  2. {spl_core-7.2.3rc1 → spl_core-7.2.5}/pyproject.toml +2 -2
  3. spl_core-7.2.5/src/spl_core/__init__.py +1 -0
  4. spl_core-7.2.5/src/spl_core/kickstart/templates/project/bootstrap.json +4 -0
  5. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/build.ps1 +271 -275
  6. spl_core-7.2.5/src/spl_core/kickstart/templates/project/pipfile +8 -0
  7. spl_core-7.2.3rc1/src/spl_core/__init__.py +0 -1
  8. spl_core-7.2.3rc1/src/spl_core/kickstart/templates/project/pipfile +0 -6
  9. {spl_core-7.2.3rc1 → spl_core-7.2.5}/LICENSE +0 -0
  10. {spl_core-7.2.3rc1 → spl_core-7.2.5}/README.md +0 -0
  11. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/__run.py +0 -0
  12. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/common/__init__.py +0 -0
  13. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/common/command_line_executor.py +0 -0
  14. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/common/path.py +0 -0
  15. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/common.cmake +0 -0
  16. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/conan.cmake +0 -0
  17. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/config/KConfig +0 -0
  18. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/gcov_maid/__init__.py +0 -0
  19. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/gcov_maid/gcov_maid.py +0 -0
  20. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kconfig/__init__.py +0 -0
  21. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kconfig/kconfig.py +0 -0
  22. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kconfig.cmake +0 -0
  23. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/__init__.py +0 -0
  24. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/create.py +0 -0
  25. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/.vscode/cmake-variants.json +0 -0
  26. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/KConfig +0 -0
  27. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/src/greeter/CMakeLists.txt +0 -0
  28. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/src/greeter/doc/_images/screenshot.png +0 -0
  29. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/src/greeter/doc/index.rst +0 -0
  30. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/src/greeter/src/greeter.c +0 -0
  31. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/src/greeter/src/greeter.h +0 -0
  32. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/src/greeter/test/test_greeter.cc +0 -0
  33. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/src/main/CMakeLists.txt +0 -0
  34. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/src/main/doc/index.rst +0 -0
  35. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/src/main/src/main.c +0 -0
  36. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/test/EnglishVariant/test__EnglishVariant.py +0 -0
  37. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/test/German/test__GermanVariant.py +0 -0
  38. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/variants/EnglishVariant/config.cmake +0 -0
  39. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/variants/EnglishVariant/parts.cmake +0 -0
  40. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/variants/GermanVariant/config.cmake +0 -0
  41. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/variants/GermanVariant/config.txt +0 -0
  42. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/application/variants/GermanVariant/parts.cmake +0 -0
  43. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/.gitignore +0 -0
  44. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/.vscode/cmake-kits.json +0 -0
  45. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/.vscode/extensions.json +0 -0
  46. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/.vscode/launch.json +0 -0
  47. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/.vscode/settings.json +0 -0
  48. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/.vscode/tasks.json +0 -0
  49. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/CMakeLists.txt +0 -0
  50. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/README.md +0 -0
  51. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/build.bat +0 -0
  52. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/conf.py +0 -0
  53. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/doc/Doxyfile.in +0 -0
  54. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/doc/common/index.rst +0 -0
  55. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/doc/components/index.rst +0 -0
  56. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/doc/doxygen-awesome/LICENSE +0 -0
  57. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/doc/doxygen-awesome/doxygen-awesome.css +0 -0
  58. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/doc/software_architecture/index.rst +0 -0
  59. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/doc/software_requirements/index.rst +0 -0
  60. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/doc/test_report_template.txt +0 -0
  61. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/index.rst +0 -0
  62. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/pytest.ini +0 -0
  63. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/scoopfile.json +0 -0
  64. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/tools/toolchains/clang/toolchain.cmake +0 -0
  65. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/kickstart/templates/project/tools/toolchains/gcc/toolchain.cmake +0 -0
  66. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/main.py +0 -0
  67. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/spl.cmake +0 -0
  68. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/test_utils/base_variant_test_runner.py +0 -0
  69. {spl_core-7.2.3rc1 → spl_core-7.2.5}/src/spl_core/test_utils/spl_build.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: spl-core
3
- Version: 7.2.3rc1
3
+ Version: 7.2.5
4
4
  Summary: Software Product Line Support for CMake
5
5
  License: MIT
6
6
  Author: Avengineers
@@ -18,7 +18,7 @@ Classifier: Topic :: Software Development :: Libraries
18
18
  Requires-Dist: cookiecutter (==2.1.1)
19
19
  Requires-Dist: doxysphinx (>=3.3,<4.0)
20
20
  Requires-Dist: gcovr (>=8.3,<9.0)
21
- Requires-Dist: hammocking (>=0.5,<0.6)
21
+ Requires-Dist: hammocking (>=0.6,<0.7)
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)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "spl-core"
3
- version = "7.2.3-rc.1"
3
+ version = "7.2.5"
4
4
  description = "Software Product Line Support for CMake"
5
5
  authors = ["Avengineers <karsten.guenther@kamg.de>"]
6
6
  license = "MIT"
@@ -28,7 +28,7 @@ python = ">=3.10,<3.12"
28
28
  py-app-dev = "^2.1"
29
29
  cookiecutter = "==2.1.1"
30
30
  gcovr = "^8.3"
31
- hammocking = "^0.5"
31
+ hammocking = "^0.6"
32
32
  kconfiglib = "^14.1"
33
33
  typer = "^0"
34
34
  doxysphinx = "^3.3"
@@ -0,0 +1 @@
1
+ __version__ = "7.2.5"
@@ -0,0 +1,4 @@
1
+ {
2
+ "python_version": "3.11",
3
+ "python_package_manager": "pipenv>=2024.0.3"
4
+ }
@@ -1,275 +1,271 @@
1
- <#
2
- .DESCRIPTION
3
- Wrapper for installing dependencies and building the product.
4
-
5
- .Notes
6
- On Windows, it may be required to call this script with the proper execution policy.
7
- You can do this by issuing the following PowerShell command:
8
-
9
- PS C:\> powershell -ExecutionPolicy Bypass -File .\build.ps1
10
-
11
- For more information on Execution Policies:
12
- https://go.microsoft.com/fwlink/?LinkID=135170
13
- #>
14
-
15
- param(
16
- [Parameter(Mandatory = $false, HelpMessage = 'Install all dependencies required to build. (Switch, default: false)')]
17
- [switch]$install = $false,
18
- [Parameter(Mandatory = $false, HelpMessage = 'Build the target.')]
19
- [switch]$build = $false,
20
- [Parameter(Mandatory = $false, HelpMessage = 'Clean build, wipe out all build artifacts. (Switch, default: false)')]
21
- [switch]$clean = $false,
22
- [Parameter(Mandatory = $false, HelpMessage = 'Build kit to be used. (String, default: "prod")')]
23
- [string]$buildKit = "prod",
24
- [Parameter(Mandatory = $false, HelpMessage = 'Target to be built. (String, default: "all")')]
25
- [string]$target = "all",
26
- [Parameter(Mandatory = $false, HelpMessage = 'Variants (of the product) to be built (List of strings, leave empty to be asked or "all" for automatic build of all variants)')]
27
- [string[]]$variants = $null,
28
- [Parameter(Mandatory = $false, HelpMessage = 'filter for selftests; define in pytest syntax: https://docs.pytest.org/en/6.2.x/usage.html; e.g. "Disco or test_CustA__Disco.py"')]
29
- [string]$filter = "",
30
- [Parameter(Mandatory = $false, HelpMessage = 'Additional build arguments for Ninja (e.g., "-d explain -d keepdepfile" for debugging purposes)')]
31
- [string]$ninjaArgs = "",
32
- [Parameter(Mandatory = $false, HelpMessage = 'Delete CMake cache and reconfigure. (Switch, default: false)')]
33
- [switch]$reconfigure = $false
34
- )
35
-
36
- # Call a command and handle its exit code
37
- Function Invoke-CommandLine {
38
- [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingInvokeExpression', '', Justification = 'Usually this statement must be avoided (https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/avoid-using-invoke-expression?view=powershell-7.3), here it is OK as it does not execute unknown code.')]
39
- param (
40
- [Parameter(Mandatory = $true, Position = 0)]
41
- [string]$CommandLine,
42
- [Parameter(Mandatory = $false, Position = 1)]
43
- [bool]$StopAtError = $true,
44
- [Parameter(Mandatory = $false, Position = 2)]
45
- [bool]$Silent = $false
46
- )
47
- if (-Not $Silent) {
48
- Write-Output "Executing: $CommandLine"
49
- }
50
- $global:LASTEXITCODE = 0
51
- Invoke-Expression $CommandLine
52
- if ($global:LASTEXITCODE -ne 0) {
53
- if ($StopAtError) {
54
- Write-Error "Command line call '$CommandLine' failed with exit code $global:LASTEXITCODE"
55
- }
56
- else {
57
- if (-Not $Silent) {
58
- Write-Output "Command line call '$CommandLine' failed with exit code $global:LASTEXITCODE, continuing ..."
59
- }
60
- }
61
- }
62
- }
63
-
64
- # Update/Reload current environment variable PATH with settings from registry
65
- Function Initialize-EnvPath {
66
- # workaround for system-wide installations
67
- if ($Env:USER_PATH_FIRST) {
68
- $Env:Path = [System.Environment]::GetEnvironmentVariable("Path", "User") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "Machine")
69
- }
70
- else {
71
- $Env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
72
- }
73
- }
74
-
75
- function Test-RunningInCIorTestEnvironment {
76
- return [Boolean]($Env:JENKINS_URL -or $Env:PYTEST_CURRENT_TEST -or $Env:GITHUB_ACTIONS)
77
- }
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
-
111
- # Build with given parameters
112
- Function Invoke-Build {
113
- param (
114
- [Parameter(Mandatory = $false)]
115
- [bool]$clean = $false,
116
- [Parameter(Mandatory = $false)]
117
- [string]$buildKit = "prod",
118
- [Parameter(Mandatory = $true)]
119
- [string]$target = "all",
120
- [Parameter(Mandatory = $false)]
121
- [string[]]$variants = $null,
122
- [Parameter(Mandatory = $false)]
123
- [string]$filter = "",
124
- [Parameter(Mandatory = $false)]
125
- [string]$ninjaArgs = "",
126
- [Parameter(Mandatory = $false)]
127
- [bool]$reconfigure = $false
128
- )
129
- if ("selftests" -eq $target) {
130
- # Run python tests to test all relevant variants and platforms (build kits)
131
- # (normally run in CI environment/Jenkins)
132
- Write-Output "Running all selfstests ..."
133
-
134
- # Build folder for CMake builds
135
- $buildFolder = "build"
136
-
137
- # fresh and clean CMake builds
138
- if ($clean) {
139
- if (Test-Path -Path $buildFolder) {
140
- Write-Output "Removing build folder '$buildFolder' ..."
141
- Remove-Item $buildFolder -Force -Recurse
142
- }
143
- }
144
-
145
- # Filter pytest test cases
146
- $filterCmd = ''
147
- $releaseBranchFilter = Get-ReleaseBranchPytestFilter
148
- if ($releaseBranchFilter) {
149
- $filterCmd = "-k '$releaseBranchFilter'"
150
- }
151
- # otherwise consider command line option '-filter' if given
152
- elseif ($filter) {
153
- $filterCmd = "-k '$filter'"
154
- }
155
-
156
- # Test result of pytest
157
- $pytestJunitXml = "test/output/test-report.xml"
158
-
159
- # Delete any old pytest result
160
- if (Test-Path -Path $pytestJunitXml) {
161
- Remove-Item $pytestJunitXml -Force
162
- }
163
-
164
- # Finally run pytest
165
- Invoke-CommandLine -CommandLine "python -m pipenv run python -m pytest test --junitxml=$pytestJunitXml $filterCmd"
166
- }
167
- else {
168
- if ((-Not $variants) -or ($variants -eq 'all')) {
169
- $dirs = Get-Childitem -Include config.cmake -Path variants -Recurse | Resolve-Path -Relative
170
- $variantsList = @()
171
- Foreach ($dir in $dirs) {
172
- $variant = (get-item $dir).Directory.BaseName
173
- $variantsList += $variant
174
- }
175
- $variantsSelected = @()
176
- if (-Not $variants) {
177
- # variant selection by user if not specified
178
- Write-Information -Tags "Info:" -MessageData "no '--variant <variant>' was given, please select from list:"
179
- Foreach ($variant in $variantsList) {
180
- Write-Information -Tags "Info:" -MessageData ("(" + [array]::IndexOf($variantsList, $variant) + ") " + $variant)
181
- }
182
- $variantsSelected += $variantsList[[int](Read-Host "Please enter selected variant number")]
183
- Write-Information -Tags "Info:" -MessageData "Selected variant is: $variantsSelected"
184
- }
185
- else {
186
- # otherwise build all variants
187
- $variantsSelected = $variantsList
188
- }
189
- }
190
- else {
191
- $variantsSelected = $Variants.Replace('\', '/').Replace('./variant/', '').Replace('./variants/', '').Split(',')
192
- }
193
-
194
- # Select 'test' build kit based on target
195
- if ($target.Contains("unittests") -or $target.Contains("reports") -or $target.Contains("docs")) {
196
- $buildKit = "test"
197
- }
198
-
199
- Foreach ($variant in $variantsSelected) {
200
- Write-Output "Building target '$target' with build kit '$buildKit' for variant '$variant' ..."
201
-
202
- $buildFolder = "build/$variant/$buildKit"
203
- # fresh and clean build
204
- if ($clean) {
205
- if (Test-Path -Path $buildFolder) {
206
- Write-Output "Removing build folder '$buildFolder' ..."
207
- Remove-Item $buildFolder -Force -Recurse
208
- }
209
- }
210
-
211
- # delete CMake cache and reconfigure
212
- if ($reconfigure) {
213
- if (Test-Path -Path "$buildFolder/CMakeCache.txt") {
214
- Remove-Item "$buildFolder/CMakeCache.txt" -Force
215
- }
216
- if (Test-Path -Path "$buildFolder/CMakeFiles") {
217
- Remove-Item "$buildFolder/CMakeFiles" -Force -Recurse
218
- }
219
- }
220
-
221
- # CMake configure
222
- $additionalConfig = "-DBUILD_KIT='$buildKit'"
223
- if ($buildKit -eq "test") {
224
- $additionalConfig += " -DCMAKE_TOOLCHAIN_FILE='tools/toolchains/gcc/toolchain.cmake'"
225
- }
226
- Invoke-CommandLine -CommandLine "python -m pipenv run cmake -B '$buildFolder' -G Ninja -DVARIANT='$variant' $additionalConfig"
227
-
228
- # CMake clean all dead artifacts. Required when running incremented builds to delete obsolete artifacts.
229
- Invoke-CommandLine -CommandLine "python -m pipenv run cmake --build '$buildFolder' --target $target -- -t cleandead"
230
- # CMake build
231
- Invoke-CommandLine -CommandLine "python -m pipenv run cmake --build '$buildFolder' --target $target -- $ninjaArgs"
232
- }
233
- }
234
- }
235
-
236
- ## start of script
237
- # Always set the $InformationPreference variable to "Continue" globally,
238
- # this way it gets printed on execution and continues execution afterwards.
239
- $InformationPreference = "Continue"
240
-
241
- # Stop on first error
242
- $ErrorActionPreference = "Stop"
243
-
244
- Push-Location $PSScriptRoot
245
- Write-Output "Running in ${pwd}"
246
-
247
- try {
248
- if (Test-RunningInCIorTestEnvironment -or $Env:USER_PATH_FIRST) {
249
- Initialize-EnvPath
250
- }
251
-
252
- if ($install) {
253
- # bootstrap environment
254
- Invoke-Bootstrap
255
- }
256
-
257
- if ($build) {
258
- # Call build system
259
- Invoke-Build `
260
- -target $target `
261
- -buildKit $buildKit `
262
- -variants $variants `
263
- -clean $clean `
264
- -reconfigure $reconfigure `
265
- -ninjaArgs $ninjaArgs `
266
- -filter $filter
267
- }
268
- }
269
- finally {
270
- Pop-Location
271
- if (-Not (Test-RunningInCIorTestEnvironment)) {
272
- Read-Host -Prompt "Press Enter to continue ..."
273
- }
274
- }
275
- ## end of script
1
+ <#
2
+ .DESCRIPTION
3
+ Wrapper for installing dependencies, running and testing the project
4
+ #>
5
+
6
+ param(
7
+ [Parameter(Mandatory = $false, HelpMessage = 'Install all dependencies required to build. (Switch, default: false)')]
8
+ [switch]$install = $false,
9
+ [Parameter(Mandatory = $false, HelpMessage = 'Install Visual Studio Code. (Switch, default: false)')]
10
+ [switch]$installVSCode = $false,
11
+ [Parameter(Mandatory = $false, HelpMessage = 'Build the target.')]
12
+ [switch]$build = $false,
13
+ [Parameter(Mandatory = $false, HelpMessage = 'Command to be executed (String)')]
14
+ [string]$command = "",
15
+ [Parameter(Mandatory = $false, HelpMessage = 'Clean build, wipe out all build artifacts. (Switch, default: false)')]
16
+ [switch]$clean = $false,
17
+ [Parameter(Mandatory = $false, HelpMessage = 'Build kit to be used. (String: "prod" or "test", default: "prod")')]
18
+ [string]$buildKit = "prod",
19
+ [Parameter(Mandatory = $false, HelpMessage = 'Target to be built. (String, default: "all")')]
20
+ [string]$target = "all",
21
+ [Parameter(Mandatory = $false, HelpMessage = 'Variants (of the product) to be built. (List of strings, leave empty to be asked or "all" for automatic build of all variants)')]
22
+ [string[]]$variants = $null,
23
+ [Parameter(Mandatory = $false, HelpMessage = 'filter for self tests, e.g. "Disco or test_Disco.py" (see https://docs.pytest.org/en/stable/usage.html).')]
24
+ [string]$filter = "",
25
+ [Parameter(Mandatory = $false, HelpMessage = 'Additional build arguments for Ninja (e.g., "-d explain -d keepdepfile" for debugging purposes)')]
26
+ [string]$ninjaArgs = "",
27
+ [Parameter(Mandatory = $false, HelpMessage = 'Delete CMake cache and reconfigure. (Switch, default: false)')]
28
+ [switch]$reconfigure = $false
29
+ )
30
+
31
+ # Call a command and handle its exit code
32
+ Function Invoke-CommandLine {
33
+ [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingInvokeExpression', '', Justification = 'Usually this statement must be avoided (https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/avoid-using-invoke-expression?view=powershell-7.3), here it is OK as it does not execute unknown code.')]
34
+ param (
35
+ [Parameter(Mandatory = $true, Position = 0)]
36
+ [string]$CommandLine,
37
+ [Parameter(Mandatory = $false, Position = 1)]
38
+ [bool]$StopAtError = $true,
39
+ [Parameter(Mandatory = $false, Position = 2)]
40
+ [bool]$Silent = $false
41
+ )
42
+ if (-Not $Silent) {
43
+ Write-Output "Executing: $CommandLine"
44
+ }
45
+ $global:LASTEXITCODE = 0
46
+ Invoke-Expression $CommandLine
47
+ if ($global:LASTEXITCODE -ne 0) {
48
+ if ($StopAtError) {
49
+ Write-Error "Command line call '$CommandLine' failed with exit code $global:LASTEXITCODE"
50
+ }
51
+ else {
52
+ if (-Not $Silent) {
53
+ Write-Output "Command line call '$CommandLine' failed with exit code $global:LASTEXITCODE, continuing ..."
54
+ }
55
+ }
56
+ }
57
+ }
58
+
59
+ # Update/Reload current environment variable PATH with settings from registry
60
+ Function Initialize-EnvPath {
61
+ # workaround for system-wide installations
62
+ if ($Env:USER_PATH_FIRST) {
63
+ $Env:Path = [System.Environment]::GetEnvironmentVariable("Path", "User") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "Machine")
64
+ }
65
+ else {
66
+ $Env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
67
+ }
68
+ }
69
+
70
+ function Test-RunningInCIorTestEnvironment {
71
+ return [Boolean]($Env:JENKINS_URL -or $Env:PYTEST_CURRENT_TEST -or $Env:GITHUB_ACTIONS)
72
+ }
73
+
74
+ # Consider CI environment variables (e.g. on Jenkins BRANCH_NAME and CHANGE_TARGET) to filter tests in release branch builds
75
+ function Get-ReleaseBranchPytestFilter {
76
+ $ChangeId = $env:CHANGE_ID
77
+ $BranchName = $env:BRANCH_NAME
78
+ $ChangeTarget = $env:CHANGE_TARGET
79
+
80
+ $targetBranch = ''
81
+
82
+ if (-not $ChangeId -and $BranchName -and $BranchName.StartsWith("release/")) {
83
+ $targetBranch = $BranchName
84
+ }
85
+
86
+ if ($ChangeId -and $ChangeTarget -and $ChangeTarget.StartsWith("release/") ) {
87
+ $targetBranch = $ChangeTarget
88
+ }
89
+
90
+ $filter = ''
91
+ if ($targetBranch -and ($targetBranch -match 'release/([^/]+/[^/]+)(.*)')) {
92
+ $filter = $Matches[1].Replace('/', ' and ')
93
+ }
94
+
95
+ return $filter
96
+ }
97
+
98
+ # Build with given parameters
99
+ Function Invoke-Build {
100
+ param (
101
+ [Parameter(Mandatory = $false)]
102
+ [bool]$clean = $false,
103
+ [Parameter(Mandatory = $false)]
104
+ [string]$buildKit = "prod",
105
+ [Parameter(Mandatory = $true)]
106
+ [string]$target = "all",
107
+ [Parameter(Mandatory = $false)]
108
+ [string[]]$variants = $null,
109
+ [Parameter(Mandatory = $false)]
110
+ [string]$filter = "",
111
+ [Parameter(Mandatory = $false)]
112
+ [string]$ninjaArgs = "",
113
+ [Parameter(Mandatory = $false)]
114
+ [bool]$reconfigure = $false
115
+ )
116
+ if ("selftests" -eq $target) {
117
+ # Run python tests to test all relevant variants and platforms (build kits)
118
+ # (normally run in CI environment/Jenkins)
119
+ Write-Output "Running all selfstests ..."
120
+
121
+ # Build folder for CMake builds
122
+ $buildFolder = "build"
123
+
124
+ # fresh and clean CMake builds
125
+ if ($clean) {
126
+ if (Test-Path -Path $buildFolder) {
127
+ Write-Output "Removing build folder '$buildFolder' ..."
128
+ Remove-Item $buildFolder -Force -Recurse
129
+ }
130
+ }
131
+
132
+ # Filter pytest test cases
133
+ $filterCmd = ''
134
+ $releaseBranchFilter = Get-ReleaseBranchPytestFilter
135
+ if ($releaseBranchFilter) {
136
+ $filterCmd = "-k '$releaseBranchFilter'"
137
+ }
138
+ # otherwise consider command line option '-filter' if given
139
+ elseif ($filter) {
140
+ $filterCmd = "-k '$filter'"
141
+ }
142
+
143
+ # Test result of pytest
144
+ $pytestJunitXml = "test/output/test-report.xml"
145
+
146
+ # Delete any old pytest result
147
+ if (Test-Path -Path $pytestJunitXml) {
148
+ Remove-Item $pytestJunitXml -Force
149
+ }
150
+
151
+ # Finally run pytest
152
+ Invoke-CommandLine -CommandLine ".venv\Scripts\pipenv run python -m pytest test --junitxml=$pytestJunitXml $filterCmd"
153
+ }
154
+ else {
155
+ if ((-Not $variants) -or ($variants -eq 'all')) {
156
+ $dirs = Get-Childitem -Include config.cmake -Path variants -Recurse | Resolve-Path -Relative
157
+ $variantsList = @()
158
+ Foreach ($dir in $dirs) {
159
+ $variant = (get-item $dir).Directory.BaseName
160
+ $variantsList += $variant
161
+ }
162
+ $variantsSelected = @()
163
+ if (-Not $variants) {
164
+ # variant selection by user if not specified
165
+ Write-Information -Tags "Info:" -MessageData "no '--variant <variant>' was given, please select from list:"
166
+ Foreach ($variant in $variantsList) {
167
+ Write-Information -Tags "Info:" -MessageData ("(" + [array]::IndexOf($variantsList, $variant) + ") " + $variant)
168
+ }
169
+ $variantsSelected += $variantsList[[int](Read-Host "Please enter selected variant number")]
170
+ Write-Information -Tags "Info:" -MessageData "Selected variant is: $variantsSelected"
171
+ }
172
+ else {
173
+ # otherwise build all variants
174
+ $variantsSelected = $variantsList
175
+ }
176
+ }
177
+ else {
178
+ $variantsSelected = $Variants.Replace('\', '/').Replace('./variant/', '').Replace('./variants/', '').Split(',')
179
+ }
180
+
181
+ # Select 'test' build kit based on target
182
+ if ($target.Contains("unittests") -or $target.Contains("reports") -or $target.Contains("docs")) {
183
+ $buildKit = "test"
184
+ }
185
+
186
+ Foreach ($variant in $variantsSelected) {
187
+ Write-Output "Building target '$target' with build kit '$buildKit' for variant '$variant' ..."
188
+
189
+ $buildFolder = "build/$variant/$buildKit"
190
+ # fresh and clean build
191
+ if ($clean) {
192
+ if (Test-Path -Path $buildFolder) {
193
+ Write-Output "Removing build folder '$buildFolder' ..."
194
+ Remove-Item $buildFolder -Force -Recurse
195
+ }
196
+ }
197
+
198
+ # delete CMake cache and reconfigure
199
+ if ($reconfigure) {
200
+ if (Test-Path -Path "$buildFolder/CMakeCache.txt") {
201
+ Remove-Item "$buildFolder/CMakeCache.txt" -Force
202
+ }
203
+ if (Test-Path -Path "$buildFolder/CMakeFiles") {
204
+ Remove-Item "$buildFolder/CMakeFiles" -Force -Recurse
205
+ }
206
+ }
207
+
208
+ # CMake configure
209
+ $additionalConfig = "-DBUILD_KIT='$buildKit'"
210
+ if ($buildKit -eq "test") {
211
+ $additionalConfig += " -DCMAKE_TOOLCHAIN_FILE='tools/toolchains/gcc/toolchain.cmake'"
212
+ }
213
+ Invoke-CommandLine -CommandLine ".venv\Scripts\pipenv run cmake -B '$buildFolder' -G Ninja -DVARIANT='$variant' $additionalConfig"
214
+
215
+ # CMake clean all dead artifacts. Required when running incremented builds to delete obsolete artifacts.
216
+ Invoke-CommandLine -CommandLine ".venv\Scripts\pipenv run cmake --build '$buildFolder' --target $target -- -t cleandead"
217
+ # CMake build
218
+ Invoke-CommandLine -CommandLine ".venv\Scripts\pipenv run cmake --build '$buildFolder' --target $target -- $ninjaArgs"
219
+ }
220
+ }
221
+ }
222
+
223
+ function Invoke-Bootstrap {
224
+ # Download bootstrap scripts from external repository
225
+ Invoke-RestMethod -Uri https://raw.githubusercontent.com/avengineers/bootstrap-installer/v1.17.0/install.ps1 | Invoke-Expression
226
+ # Execute bootstrap script
227
+ . .\.bootstrap\bootstrap.ps1
228
+ # For incremental build: clean up virtual environment from old dependencies
229
+ Invoke-CommandLine ".venv\Scripts\pipenv clean"
230
+ }
231
+
232
+ ## start of script
233
+ # Always set the $InformationPreference variable to "Continue" globally,
234
+ # this way it gets printed on execution and continues execution afterwards.
235
+ $InformationPreference = "Continue"
236
+
237
+ # Stop on first error
238
+ $ErrorActionPreference = "Stop"
239
+
240
+ Push-Location $PSScriptRoot
241
+ Write-Output "Running in ${pwd}"
242
+
243
+ try {
244
+ if (Test-RunningInCIorTestEnvironment -or $Env:USER_PATH_FIRST) {
245
+ Initialize-EnvPath
246
+ }
247
+
248
+ if ($install) {
249
+ # bootstrap environment
250
+ Invoke-Bootstrap
251
+ }
252
+
253
+ if ($build) {
254
+ # Call build system
255
+ Invoke-Build `
256
+ -target $target `
257
+ -buildKit $buildKit `
258
+ -variants $variants `
259
+ -clean $clean `
260
+ -reconfigure $reconfigure `
261
+ -ninjaArgs $ninjaArgs `
262
+ -filter $filter
263
+ }
264
+ }
265
+ finally {
266
+ Pop-Location
267
+ if (-Not (Test-RunningInCIorTestEnvironment)) {
268
+ Read-Host -Prompt "Press Enter to continue ..."
269
+ }
270
+ }
271
+ ## end of script
@@ -0,0 +1,8 @@
1
+ [packages]
2
+ pytest = ">=8.3"
3
+ pipenv = ">=2024.0.3"
4
+ pip-system-certs = ">=4.0"
5
+ spl-core = "*"
6
+
7
+ [requires]
8
+ python_version = "3.11"
@@ -1 +0,0 @@
1
- __version__ = "7.2.3-rc.1"
@@ -1,6 +0,0 @@
1
- [packages]
2
- pytest = "8.1.1"
3
- spl-core = "*"
4
-
5
- [requires]
6
- python_version = "3.11"
File without changes
File without changes