diff --git a/build/.azure-pipelines.TemplateValidation.yml b/build/.azure-pipelines.TemplateValidation.yml index 0ec2b8f5..c0616ef9 100644 --- a/build/.azure-pipelines.TemplateValidation.yml +++ b/build/.azure-pipelines.TemplateValidation.yml @@ -4,79 +4,137 @@ jobs: pool: vmImage: 'windows-2022' - strategy: - matrix: - DefaultArguments: + variables: + - name: UseDotNetNativeToolchain + value: false + + steps: + - template: templates/package-validation.yml + parameters: templateArgs: '' - Blank: + projectName: 'DefaultArguments' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset blank' - SkiaOnlyHeads: + projectName: 'Blank' + - template: templates/package-validation.yml + parameters: templateArgs: '-platforms gtk wpf linux-fb' - MobileOnlyHeads: + projectName: 'SkiaOnlyHeads' + - template: templates/package-validation.yml + parameters: templateArgs: '-platforms android ios maccatalyst' - BlankMarkup: + projectName: 'MobileOnlyHeads' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset blank -markup csharp' - BlankNoCpm: + projectName: 'BlankMarkup' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset blank --cpm false' - MVVM: + projectName: 'BlankNoCpm' + - template: templates/package-validation.yml + parameters: templateArgs: '-presentation mvvm' - NoCentralPackageManagement: + projectName: 'MVVM' + - template: templates/package-validation.yml + parameters: templateArgs: '--cpm false' - CSharpMarkup: + projectName: 'NoCentralPackageManagement' + - template: templates/package-validation.yml + parameters: templateArgs: '-markup csharp' - NoHosting: + projectName: 'CSharpMarkup' + - template: templates/package-validation.yml + parameters: templateArgs: '-di false' - HostingOnly: + projectName: 'NoHosting' + - template: templates/package-validation.yml + parameters: templateArgs: '-config false -loc false -http false -log none --navigation blank' - NoConfiguration: + projectName: 'HostingOnly' + - template: templates/package-validation.yml + parameters: templateArgs: '-config false' - NoLocalization: + projectName: 'NoConfiguration' + - template: templates/package-validation.yml + parameters: templateArgs: '-loc false' - NoHttp: + projectName: 'NoLocalization' + - template: templates/package-validation.yml + parameters: templateArgs: '-http false' - NoSerilog: + projectName: 'NoHttp' + - template: templates/package-validation.yml + parameters: templateArgs: '-log default' - NoServer: + projectName: 'NoSerilog' + - template: templates/package-validation.yml + parameters: templateArgs: '-server false' - NoServerNoHttp: + projectName: 'NoServer' + - template: templates/package-validation.yml + parameters: templateArgs: '-server false -http false' - NoTests: + projectName: 'NoServerNoHttp' + - template: templates/package-validation.yml + parameters: templateArgs: '-tests none' - FrameNavigation: + projectName: 'NoTests' + - template: templates/package-validation.yml + parameters: templateArgs: '--navigation blank' - Net8: + projectName: 'FrameNavigation' + - template: templates/package-validation.yml + parameters: templateArgs: '-tfm net8.0' + projectName: 'Net8' # https://github.com/unoplatform/uno.templates/issues/22 - Issue22: + - template: templates/package-validation.yml + parameters: templateArgs: '-preset blank -tfm net7.0 -platforms android -platforms ios -platforms maccatalyst -platforms macos -platforms windows -platforms wasm -platforms gtk -platforms wpf -platforms linux-fb -presentation mvvm -server false -tests none -vscode false -pwa false -di true -nav regions -log none -theme material' - CustomAuthMvux: + projectName: 'Issue22' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset=recommended -auth=custom' - CustomAuthMvvm: + projectName: 'CustomAuthMvux' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset=recommended -presentation mvvm -auth=custom' - WebAuthMvux: + projectName: 'CustomAuthMvvm' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset=recommended -auth=web' - WebAuthMvvm: + projectName: 'WebAuthMvux' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset=recommended -presentation mvvm -auth=web' - OidcAuthMvux: + projectName: 'WebAuthMvvm' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset=recommended -auth=oidc' - OidcAuthMvvm: + projectName: 'OidcAuthMvux' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset=recommended -presentation mvvm -auth=oidc' - MsalAuthMvux: + projectName: 'OidcAuthMvvm' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset=recommended -auth=msal' - MsalAuthMvvm: + projectName: 'MsalAuthMvux' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset=recommended -presentation mvvm -auth=msal' - MauiBlank: + projectName: 'MsalAuthMvvm' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset=blank -maui' - MauiRecommended: + projectName: 'MauiBlank' + - template: templates/package-validation.yml + parameters: templateArgs: '-preset=recommended -maui' - MauiRecommendedNet8: - templateArgs: '-preset=recommended -maui -tfm net8.0' - - variables: - - name: UseDotNetNativeToolchain - value: false - - steps: + projectName: 'MauiRecommended' - template: templates/package-validation.yml parameters: - arguments: $(templateArgs) + templateArgs: '-preset=recommended -maui -tfm net8.0' + projectName: 'MauiRecommendedNet8' diff --git a/build/templates/package-validation.yml b/build/templates/package-validation.yml index 603743cb..90849e0b 100644 --- a/build/templates/package-validation.yml +++ b/build/templates/package-validation.yml @@ -1,5 +1,9 @@ parameters: -- name: arguments +- name: templateArgs + type: string + default: '' + +- name: projectName type: string default: '' @@ -8,7 +12,7 @@ steps: clean: 'true' - powershell: | - $templateArgs = '${{ parameters.arguments }}' + $templateArgs = '${{ parameters.templateArgs }}' Write-Host "TemplateArgs = '$templateArgs'" $dotnetVersion = '7.0.400' $workloadRestore = 'https://maui.blob.core.windows.net/metadata/rollbacks/7.0.92.json' @@ -49,7 +53,7 @@ steps: $ErrorActionPreference = 'Stop' # Create app with defaults - dotnet new unoapp -skip -o UnoApp1 ${{ parameters.arguments }} + dotnet new unoapp -skip -o ${{ parameters.projectName }} ${{ parameters.templateArgs }} if ($LASTEXITCODE -ne 0) { throw "Exit code must be zero." @@ -62,7 +66,7 @@ steps: MergeBranch: false - powershell: | - cd UnoApp1 + cd ${{ parameters.projectName }} & dotnet workload restore --from-rollback-file $(WorkloadRestore) --skip-sign-check displayName: Restore workloads @@ -70,9 +74,9 @@ steps: Set-PSDebug -Trace 1 $ErrorActionPreference = 'Stop' - cd UnoApp1 + cd ${{ parameters.projectName }} - & dotnet build UnoApp1.sln "/bl:$(build.artifactstagingdirectory)\$(Agent.JobName).binlog" + & dotnet build ${{ parameters.projectName }}.sln "/bl:$(build.artifactstagingdirectory)\$(Agent.JobName).binlog" if ($LASTEXITCODE -ne 0) { throw "Exit code must be zero."