MSBuild Integration (Windows / MSVC)
1
Clean and inject SeaLights build targets
# Clean first — required so all objects recompile with /Gh
msbuild MySolution.sln /t:Clean /p:Configuration=Release
# Inject SeaLights MSBuild targets
SL.Agent.Cpp.exe integrateMsBuild `
--dir . `
--tokenFile ./sltoken.txt `
--gtest- task: PowerShell@2
displayName: Clean and inject SeaLights build targets
env:
SL_TOKEN: $(SL_TOKEN)
inputs:
targetType: inline
script: |
msbuild MySolution.sln /t:Clean /p:Configuration=Release
SL.Agent.Cpp.exe integrateMsBuild --dir . --token $env:SL_TOKEN --gtest2
3
Create a build session
SL.Agent.Cpp.exe config `
--tokenFile ./sltoken.txt `
--appName MyCppApp `
--buildName $(git rev-parse --short HEAD) `
--branchName main `
--buildSessionIdFile buildSessionId.txt- task: PowerShell@2
displayName: Create a SeaLights build session
env:
SL_TOKEN: $(SL_TOKEN)
inputs:
targetType: inline
script: |
SL.Agent.Cpp.exe config `
--token $env:SL_TOKEN `
--appName MyCppApp `
--buildName $(Build.BuildNumber) `
--branchName main `
--buildSessionIdFile buildSessionId.txt4
Scan the build and upload the coverage map
SL.Agent.Cpp.exe scan `
--tokenFile ./sltoken.txt `
--buildSessionIdFile buildSessionId.txt `
--binDir .\bin\Release `
--srcRootDir .- task: PowerShell@2
displayName: Scan the build and upload the coverage map
env:
SL_TOKEN: $(SL_TOKEN)
inputs:
targetType: inline
script: |
SL.Agent.Cpp.exe scan `
--token $env:SL_TOKEN `
--buildSessionIdFile buildSessionId.txt `
--binDir .\bin\Release `
--srcRootDir .Last updated
Was this helpful?

