@@ -30,6 +30,11 @@ resources:
3030 name : xamarin/release-scripts
3131 ref : refs/heads/sign-and-notarized
3232 endpoint : xamarin
33+ - repository : maui
34+ type : github
35+ name : dotnet/maui
36+ ref : refs/heads/net8.0
37+ endpoint : xamarin
3338
3439parameters :
3540- name : provisionatorChannel
@@ -277,13 +282,139 @@ stages:
277282 artifactName : Test Results - MSBuild Smoke - Linux
278283
279284 - template : yaml-templates/fail-on-issue.yaml
280-
285+
281286- template : yaml-templates/stage-msbuild-tests.yaml
282-
287+
283288- template : yaml-templates/stage-msbuild-emulator-tests.yaml
284289 parameters :
285290 usesCleanImages : ${{ parameters.macTestAgentsUseCleanImages }}
286291
292+ - stage : maui_tests
293+ displayName : MAUI Tests
294+ dependsOn : mac_build
295+ condition : eq(variables['System.PullRequest.TargetBranch'], 'main')
296+ jobs :
297+ # Check - "Xamarin.Android (MAUI Tests MAUI Integration)"
298+ - job : maui_tests_integration
299+ displayName : MAUI Integration
300+ pool : $(1ESWindowsPool)
301+ timeoutInMinutes : 180
302+ workspace :
303+ clean : all
304+ variables :
305+ BuildVersion : $(Build.BuildId)
306+ steps :
307+ - checkout : maui
308+ clean : true
309+ submodules : recursive
310+ path : s/maui
311+ persistCredentials : true
312+
313+ - template : yaml-templates/setup-test-environment.yaml
314+ parameters :
315+ xaSourcePath : $(Build.SourcesDirectory)/xamarin-android
316+ provisionClassic : false
317+ provisionatorChannel : ${{ parameters.provisionatorChannel }}
318+ installLegacyDotNet : false
319+ restoreNUnitConsole : false
320+ updateMono : false
321+ androidSdkPlatforms : 23,24,25,26,27,28,29,30,31,32,$(DefaultTestSdkPlatforms)
322+
323+ - task : NuGetAuthenticate@0
324+ displayName : authenticate with azure artifacts
325+ inputs :
326+ forceReinstallCredentialProvider : true
327+
328+ - script : |
329+ echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_11_X64%
330+ echo ##vso[task.setvariable variable=JAVA_HOME]%JAVA_HOME_11_X64%
331+ displayName: set JI_JAVA_HOME, JAVA_HOME
332+
333+ - task : DownloadPipelineArtifact@2
334+ inputs :
335+ artifactName : $(NuGetArtifactName)
336+ downloadPath : $(Build.StagingDirectory)/android-packs
337+
338+ - pwsh : |
339+ $searchPath = Join-Path $(Build.StagingDirectory) android-packs
340+ $wlmanPack = Get-ChildItem $searchPath -Filter *Android*Manifest*.nupkg | Select-Object -First 1
341+ $dest = Join-Path $searchPath "tmp-wlman" "$($wlmanPack.BaseName)"
342+ Expand-Archive -LiteralPath $wlmanPack -DestinationPath $dest
343+ $wlmanJsonPath = Join-Path $dest "data" "WorkloadManifest.json"
344+ $json = Get-Content $wlmanJsonPath | ConvertFrom-Json -AsHashtable
345+ Write-Host "Setting variable ANDROID_PACK_VERSION = $($json["version"])"
346+ Write-Host "##vso[task.setvariable variable=ANDROID_PACK_VERSION;]$($json["version"])"
347+ displayName: Set ANDROID_PACK_VERSION
348+
349+ - pwsh : >-
350+ $(Build.SourcesDirectory)/maui/eng/scripts/update-version-props.ps1
351+ -xmlFileName "$(Build.SourcesDirectory)/maui/eng/Versions.props"
352+ -androidVersion $(ANDROID_PACK_VERSION)
353+ displayName: Update MAUI's Android dependency
354+
355+ - pwsh : ./build.ps1 --target=dotnet --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic
356+ displayName : Install .NET
357+ retryCountOnTaskFailure : 3
358+ workingDirectory : $(Build.SourcesDirectory)/maui
359+
360+ - pwsh : ./build.ps1 --target=dotnet-pack --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic
361+ displayName : Pack .NET Maui
362+ workingDirectory : $(Build.SourcesDirectory)/maui
363+
364+ - task : DotNetCoreCLI@2
365+ displayName : Install MAUI workload packs
366+ retryCountOnTaskFailure : 3
367+ inputs :
368+ projects : $(Build.SourcesDirectory)/xamarin-android/Xamarin.Android.sln
369+ arguments : -t:InstallMaui -p:MauiUseLocalPacks=true -p:MauiWorkloadToInstall=maui -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/install-maui.binlog
370+
371+ - template : yaml-templates/run-dotnet-preview.yaml
372+ parameters :
373+ command : new
374+ arguments : maui -o $(Build.StagingDirectory)/MauiTestProj
375+ xaSourcePath : $(Build.SourcesDirectory)/xamarin-android
376+ displayName : Create MAUI template
377+ continueOnError : false
378+
379+ - template : yaml-templates/run-dotnet-preview.yaml
380+ parameters :
381+ project : $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj
382+ arguments : >-
383+ -f $(DotNetTargetFramework)-android -c Debug
384+ --configfile $(Build.SourcesDirectory)/maui/NuGet.config
385+ -bl:$(Build.StagingDirectory)/logs/MauiTestProj-Debug.binlog
386+ xaSourcePath : $(Build.SourcesDirectory)/xamarin-android
387+ displayName : Build MAUI template - Debug
388+
389+ - template : yaml-templates/run-dotnet-preview.yaml
390+ parameters :
391+ project : $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj
392+ arguments : >-
393+ -f $(DotNetTargetFramework)-android -c Release
394+ --configfile $(Build.SourcesDirectory)/maui/NuGet.config
395+ -bl:$(Build.StagingDirectory)/logs/MauiTestProj-Release.binlog
396+ xaSourcePath : $(Build.SourcesDirectory)/xamarin-android
397+ displayName : Build MAUI template - Release
398+
399+ - task : CopyFiles@2
400+ displayName : copy build logs
401+ condition : always()
402+ inputs :
403+ Contents : |
404+ $(Build.SourcesDirectory)/maui/artifacts/logs/**
405+ TargetFolder : $(Build.StagingDirectory)/logs
406+ flattenFolders : true
407+
408+ - template : yaml-templates/publish-artifact.yaml
409+ parameters :
410+ displayName : upload build and test results
411+ artifactName : Test Results - MAUI Integration
412+ targetPath : $(Build.StagingDirectory)/logs
413+ condition : or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true'))
414+
415+ - template : yaml-templates/fail-on-issue.yaml
416+
417+
287418- stage : dotnet_prepare_release
288419 displayName : Prepare .NET Release
289420 dependsOn :
0 commit comments