ProjectReunion/build/AzurePipelinesTemplates/WindowsAppSDK-BuildProject-...

172 строки
7.8 KiB
YAML

parameters:
solutionPath: ''
nugetConfigPath: ''
buildOutputDir: '$(Build.SourcesDirectory)\BuildOutput'
artifactName: 'drop'
channel: 'experimental'
steps:
- template: WindowsAppSDK-PopulateBuildDateAndRevision-Steps.yml
- script: |
echo parameters.solutionPath = '${{ parameters.solutionPath }}'
echo parameters.nugetConfigPath = '${{ parameters.nugetConfigPath }}'
echo parameters.buildOutputDir = '${{ parameters.buildOutputDir }}'
displayName: 'BuildProject: Display parameters'
- template: WindowsAppSDK-InstallWindowsSDK-Steps.yml
- template: WindowsAppSDK-InstallNuget-Steps.yml
# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
- script: |
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt
set /p _VSINSTALLDIR15=<%TEMP%\vsinstalldir.txt
del %TEMP%\vsinstalldir.txt
call "%_VSINSTALLDIR15%\Common7\Tools\VsDevCmd.bat"
echo VCToolsInstallDir = %VCToolsInstallDir%
echo ##vso[task.setvariable variable=VCToolsInstallDir]%VCToolsInstallDir%
displayName: 'Retrieve VC tools directory'
- task: CmdLine@1
displayName: 'Display build machine environment variables'
inputs:
filename: 'set'
- task: NuGetAuthenticate@0
inputs:
nuGetServiceConnections: 'WindowsES'
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: 'NuGet restore ${{ parameters.solutionPath }}'
inputs:
restoreSolution: ${{ parameters.solutionPath }}
feedsToUse: config
nugetConfigPath: ${{ parameters.nugetConfigPath }}
- task: powershell@2
displayName: 'Create pfx to sign MSIX test packages (DevCheck)'
inputs:
targetType: filePath
filePath: tools\DevCheck.ps1
arguments: -CheckTestPfx -Clean -Offline -Verbose
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create DynamicDependencies overrides'
inputs:
targetType: filePath
filePath: tools\GenerateDynamicDependencyOverrides.ps1
arguments: -Path $(Build.SourcesDirectory)\build\override
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create PushNotifications overrides'
inputs:
targetType: filePath
filePath: tools\GeneratePushNotificationsOverrides.ps1
arguments: -Path $(Build.SourcesDirectory)\build\override
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create DynamicDependencies TerminalVelocity features'
inputs:
targetType: filePath
filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-DynamicDependency.xml -Channel ${{ parameters.channel }} -Language C++ -Namespace Microsoft.Windows.ApplicationModel.DynamicDependency -Output $(Build.SourcesDirectory)\dev\common\MddTerminalVelocityFeatures.h
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create DeploymentAPI TerminalVelocity features'
inputs:
targetType: filePath
filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-DeploymentAPI.xml -Channel ${{ parameters.channel }} -Language C++ -Namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-DeploymentAPI.h
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create PushNotifications TerminalVelocity features'
inputs:
targetType: filePath
filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-PushNotifications.xml -Channel ${{ parameters.channel }} -Language C++ -Namespace Microsoft.Windows.PushNotifications -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-PushNotifications.h
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create EnvironmentManager TerminalVelocity features'
inputs:
targetType: filePath
filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-EnvironmentManager.xml -Channel ${{ parameters.channel }} -Language C++ -Namespace Microsoft.Windows.System -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-EnvironmentManager.h
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
name: UpdateTraceloggingConfig
inputs:
targetType: 'inline'
script: |
$srcPath = Get-Childitem -Path 'dev\WindowsAppRuntime_Insights\packages' -File 'MicrosoftTelemetry.h' -Recurse
if (($srcPath -ne $null)){
$destinationPaths = Get-Childitem -Path 'packages' -File 'Traceloggingconfig.h' -Recurse
if (($destinationPaths -ne $null)) {
foreach ($destPath in $destinationPaths) {
Write-Host 'SourcePath:' $srcPath.FullName
Write-Host 'DestinationPath:' $destPath.FullName
Copy-Item -Force $srcPath.FullName $destPath.FullName
}
}
}
- task: VSBuild@1
displayName: 'Build solution ${{ parameters.solutionPath }}'
inputs:
solution: ${{ parameters.solutionPath }}
vsVersion: 16.0
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
msbuildArgs: '/restore /p:AppxSymbolPackageEnabled=false /binaryLogger:$(Build.SourcesDirectory)/${{ parameters.solutionPath }}.$(buildPlatform).$(buildConfiguration).binlog /p:WindowsAppSDKVersionBuild=$(builddate_yymm) /p:WindowsAppSDKVersionRevision=$(builddate_dd)$(buildrevision) /p:VCToolsInstallDir="$(VCToolsInstallDir)\" /p:PGOBuildMode=$(PGOBuildMode) /p:WindowsAppSDKBuildPipeline=1'
- task: CmdLine@2
displayName: 'Install Test Certificate'
inputs:
script: 'certutil.exe -addstore TrustedPeople MSTest.cer'
workingDirectory: '$(Build.SourcesDirectory)\build'
- task: powershell@2
displayName: 'Setup TAEF Service (DevCheck)'
inputs:
targetType: filePath
filePath: tools\DevCheck.ps1
arguments: -CheckTAEFService -Offline -Verbose
workingDirectory: '$(Build.SourcesDirectory)'
#DISABLED - GitHub runs as a a built-in Administrator (thus Elevated and no split-token)
# TAEF Service can't RunAs:RestrictedUser from this account thus all tests Failed or Blocked
# and Dynamic Dependencies doesn't support Elevation so it's impossible for this test to
# work correctly today. Disabling until we move off GitHub's pipeline for test execution
# - task: CmdLine@2
# displayName: 'Run AppLifeCycleTest'
# inputs:
# script: 'te.exe CppTest.dll'
# workingDirectory: '$(Build.SourcesDirectory)\BuildOutput\$(buildConfiguration)\$(buildPlatform)\CppTest'
# condition: or(eq(variables.buildPlatform, 'x64'), eq(variables.buildPlatform, 'x86'))
- task: PublishBuildArtifacts@1
displayName: 'Publish ${{ parameters.solutionPath }} binlog'
condition: succeededOrFailed()
inputs:
PathtoPublish: $(Build.SourcesDirectory)/${{ parameters.solutionPath }}.$(buildPlatform).$(buildConfiguration).binlog
artifactName: binlogs
#UNDONE - subsequent PR
# - task: powershell@2
# displayName: 'Source Index PDBs'
# inputs:
# targetType: filePath
# filePath: build\SourceIndexing\IndexPdbs.ps1
# arguments: -SearchDir '${{ parameters.buildOutputDir }}\$(buildConfiguration)' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
# errorActionPreference: silentlyContinue