代码拉取完成,页面将自动刷新
jobs:
- job: VS_Latest
timeoutInMinutes: 600
pool:
vmImage: windows-2022
steps:
- checkout: self
clean: true
- powershell: |
if($env:System_PullRequest_TargetBranch -eq $null) { $TargetBranch = "master" } else { $TargetBranch = $env:System_PullRequest_TargetBranch; }
$dict = New-Object 'System.Collections.Generic.Dictionary[String,System.Collections.Generic.Dictionary[String,String]]'
$samples = Get-ChildItem -Path **\*.sln -Recurse | Where-Object {$_.FullName -notmatch "\\ArchivedProjects\\"}
foreach($sample in $samples){
$solutionPath=[System.IO.Path]::GetDirectoryName($sample.FullName);
Write-Host "$solutionPath"
git diff --quiet HEAD "origin/$TargetBranch" -- "$solutionPath"
# Only build if there a change in the solution path for the current PR, if we're not in a PR
if( ("$env:System_PullRequest_PullRequestId" -eq '') -or ($global:LASTEXITCODE -ne 0)) {
Write-Host "Adding $solutionPath"
$item = New-Object 'System.Collections.Generic.Dictionary[String,String]'
$item.Add("solutionPath", $sample.FullName)
$name = $sample.Name.Split(".")[0]
if(!$dict.ContainsKey($name)){
$dict.Add($name, $item)
}
}
$global:LASTEXITCODE = 0
}
$SolutionsJson = $dict | ConvertTo-Json -Compress
Write-Host $SolutionsJson
Write-Host "##vso[task.setvariable variable=samplesJson;isOutput=true]$SolutionsJson"
name: generateJson
displayName: Generate Json of Samples
- template: .azure-pipelines.BuildMatrix.yml
# - task: PublishBuildArtifacts@1
# inputs:
# pathtoPublish: $(Build.ArtifactStagingDirectory)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。