Skip to content

Commit

Permalink
Change the name build wrapper output argument and highlight build com…
Browse files Browse the repository at this point in the history
…mands in logs
  • Loading branch information
luc-guyot-infomaniak committed Oct 16, 2024
1 parent 976282d commit 9a5efa8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvars64.bat"
set COVFILE=%cd%\src\test.cov
call "cov01.exe" -1
powershell ./infomaniak-build-tools/windows/build-drive.ps1 -ci -wo ${{ env.BUILD_WRAPPER_OUT_DIR }}
powershell ./infomaniak-build-tools/windows/build-drive.ps1 -ci -bwod ${{ env.BUILD_WRAPPER_OUT_DIR }}
shell: cmd

- name: Execute tests
Expand Down
18 changes: 11 additions & 7 deletions infomaniak-build-tools/windows/build-drive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Param(
[switch] $ci,

# wo : The path to the build wrapper output directory used by SonarCloud CI Analysis
[string] $wo= $null,
[string] $bwod = $null,

# Upload : Flag to trigger the use of the USB-key signing certificate
[switch] $upload,
Expand Down Expand Up @@ -170,7 +170,7 @@ Parameters :
`t`tremake`t`t: Remove all the files, then rebuild the project
`t-ext`t`t`t: Rebuild and redeploy the windows extension
`t-ci`t`t`t: Build with CI testing
`t-wo`t`t`t: Optional parameter to wrap the build with SonarCloud build-wrapper tool (CI Analysis). Set the path to the build wrapper output directory. The wrapper will be used iff this path is not empty.
`t-bwod`t`t`t: Optional parameter to wrap the build with SonarCloud build-wrapper tool (CI Analysis). Set the path to the build wrapper output directory. The wrapper will be used iff this path is not empty.
`t-upload`t`t: Upload flag to switch between the virtual and physical certificates. Also rebuilds the project
") -f Cyan

Expand Down Expand Up @@ -308,16 +308,20 @@ $args += ("'-H$path'")

$cmake = ('cmake {0}'-f($args -Join ' '))

Write-Host $cmake
Invoke-Expression $cmake

$buildArgs += @('--build', $buildPath, '--target all install')
$buildCall = ('cmake {0}' -f ($buildArgs -Join ' '))

if ($wo) { # Insert the SonarCloud build-wrapper tool for CI Analysis
$buildCall = "build-wrapper-win-x86-64 --out-dir $wo $buildCall"
if ($bwod) { # Insert the SonarCloud build-wrapper tool for CI Analysis
$buid_wrapper = build-wrapper-win-x86-64
$cmake = "$buid_wrapper --out-dir $bwod $cmake"
$buildCall = "$buid_wrapper --out-dir $bwod $buildCall"
}

Write-Host "CMake command:" -f Green
Write-Host $cmake
Invoke-Expression $cmake

Write-Host "Build command:" -f Green
Write-Host $buildCall
Invoke-Expression $buildCall

Expand Down

0 comments on commit 9a5efa8

Please sign in to comment.