diff --git a/.editorconfig b/.editorconfig index db5b05678..91146ee65 100644 --- a/.editorconfig +++ b/.editorconfig @@ -47,4 +47,7 @@ csharp_style_namespace_declarations = file_scoped:error dotnet_diagnostic.CS4014.severity = error # Remove explicit default access modifiers -dotnet_style_require_accessibility_modifiers = omit_if_default:error \ No newline at end of file +dotnet_style_require_accessibility_modifiers = omit_if_default:error + +# CA1063: Implement IDisposable Correctly +dotnet_diagnostic.CA1063.severity = error \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ad032e88b..11b5764f1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,11 +38,6 @@ jobs: pool: vmImage: windows-latest steps: - # .NET 5.0 is required for maui-check - - task: UseDotNet@2 - displayName: 'Install .NET 5.0 SDK' - inputs: - version: '5.0.x' - task: UseDotNet@2 displayName: 'Install .NET SDK' inputs: @@ -77,7 +72,7 @@ jobs: - powershell: | $prNumber = $env:System_PullRequest_PullRequestNumber $commitId = "$($env:System_PullRequest_SourceCommitId)".Substring(0, 7) - $fullVersionString = "$(CurrentSemanticVersionBase)-build.$prNumber+$commitId" + $fullVersionString = "$(CurrentSemanticVersionBase)-build-$prNumber.$(Build.BuildId)+$commitId" Write-Host("GitHub PR = $prNumber, Commit = $commitId"); Write-Host ("##vso[task.setvariable variable=NugetPackageVersion;]$fullVersionString") Write-Host "##vso[build.updatebuildnumber]$fullVersionString" @@ -96,15 +91,13 @@ jobs: inputs: script: 'dotnet build $(PathToCommunityToolkitCsproj) -c Release' - task: CmdLine@2 - displayName: 'Build Community Toolkit Sample' + displayName: 'Run Unit Tests' inputs: - script: 'dotnet build $(PathToCommunityToolkitSampleCsproj) -c Release' + script: 'dotnet test $(PathToCommunityToolkitUnitTestCsproj) -c Release' - task: CmdLine@2 - displayName: 'Run Unit Tests' + displayName: 'Build Community Toolkit Sample' inputs: - script: | - dotnet build $(PathToCommunityToolkitUnitTestCsproj) -c Release - dotnet test $(PathToCommunityToolkitUnitTestCsproj) -c Release + script: 'dotnet build $(PathToCommunityToolkitSampleCsproj) -c Release' - task: CmdLine@2 displayName: Pack Community Toolkit NuGets inputs: @@ -163,15 +156,13 @@ jobs: inputs: script: 'dotnet build $(PathToCommunityToolkitCsproj) -c Release' - task: CmdLine@2 - displayName: 'Build Community Toolkit Sample' + displayName: 'Run Unit Tests' inputs: - script: 'dotnet build $(PathToCommunityToolkitSampleCsproj) -c Release' + script: 'dotnet test $(PathToCommunityToolkitUnitTestCsproj) -c Release' - task: CmdLine@2 - displayName: 'Run Unit Tests' + displayName: 'Build Community Toolkit Sample' inputs: - script: | - dotnet build $(PathToCommunityToolkitUnitTestCsproj) -c Release - dotnet test $(PathToCommunityToolkitUnitTestCsproj) -c Release + script: 'dotnet build $(PathToCommunityToolkitSampleCsproj) -c Release' - task: CmdLine@2 displayName: 'Pack CommunityToolkit NuGets' inputs: diff --git a/samples/CommunityToolkit.Maui.Sample.sln b/samples/CommunityToolkit.Maui.Sample.sln index 0fba7d0ac..6de6e6777 100644 --- a/samples/CommunityToolkit.Maui.Sample.sln +++ b/samples/CommunityToolkit.Maui.Sample.sln @@ -13,9 +13,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Maui.Sampl EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3ED2C978-9DDB-48FE-8C5A-521B254F18A3}" ProjectSection(SolutionItems) = preProject + ..\.editorconfig = ..\.editorconfig + ..\azure-pipelines.yml = ..\azure-pipelines.yml ..\Directory.Build.props = ..\Directory.Build.props ..\global.json = ..\global.json - ..\.editorconfig = ..\.editorconfig EndProjectSection EndProject Global diff --git a/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj b/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj index f34180d65..5797720af 100644 --- a/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj +++ b/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj @@ -40,7 +40,7 @@ - + @@ -67,4 +67,8 @@ win-x64 + + android-arm;android-arm64;android-x86;android-x64 + + diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/AlertsGalleryPage.cs b/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/AlertsGalleryPage.cs new file mode 100644 index 000000000..448faa270 --- /dev/null +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/AlertsGalleryPage.cs @@ -0,0 +1,10 @@ +using CommunityToolkit.Maui.Sample.ViewModels.Alerts; + +namespace CommunityToolkit.Maui.Sample.Pages.Alerts; + +public class AlertsGalleryPage : BaseGalleryPage +{ + public AlertsGalleryPage() : base("Alerts") + { + } +} \ No newline at end of file diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/SnackbarPage.xaml b/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/SnackbarPage.xaml new file mode 100644 index 000000000..102f8d098 --- /dev/null +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/SnackbarPage.xaml @@ -0,0 +1,37 @@ + + + + + + + + + + + +