diff --git a/.gitignore b/.gitignore index c13e56c7..5d87ff80 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ out bin obj packages +pack *.nuget.targets *.nuget.props *.lock.json diff --git a/NuGet.Config b/NuGet.Config index 4b06ea6c..a018c65d 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,10 +1,15 @@  + - - - + diff --git a/README.md b/README.md index 487d1618..99fcdaba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ -![Icon](https://raw.github.com/MobileEssentials/Merq/master/icon/32.png) Merq +![Icon](https://raw.github.com/Xamarin/Merq/main/icon/32.png) Merq ================ +⚠️IMPORTANT: If you are making updates to the product code you **must** re-enable the nuget publishing step as part of your PR. See the **TODO** comment at the bottom of the `azure-pipelines.yml` file. Also remove this warning from this **README** as part of that change +

+ > **Mercury:** messenger of the Roman gods > *Mercury* > *Merq-ry* > **Merq** @@ -10,7 +13,7 @@ messages in a command bus and an event stream respectively, with support for asynchronously executing commands in a main thread deadlock-free way. [![Build status](https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/8887/badge)](http://build.devdiv.io/8887) -[![Coverage Status](https://coveralls.io/repos/github/MobileEssentials/Merq/badge.svg?branch=master)](https://coveralls.io/github/MobileEssentials/Merq?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/Xamarin/Merq/badge.svg?branch=main)](https://coveralls.io/github/Xamarin/Merq?branch=main) [![Latest version](https://img.shields.io/nuget/v/Merq.svg)](https://www.nuget.org/packages/Merq) [![Join the chat at https://gitter.im/MobileEssentials](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/MobileEssentials?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![License](https://img.shields.io/github/license/MobileEssentials/Merq.svg)](https://github.com/MobileEssentials/Merq/blob/master/LICENSE) +[![License](https://img.shields.io/github/license/MobileEssentials/Merq.svg)](https://github.com/Xamarin/Merq/blob/main/LICENSE) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 622ff4fe..2f2a8042 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,8 +4,7 @@ trigger: batch: false branches: include: - - master - - dev/* + - main - feature/* - rel/* paths: @@ -14,8 +13,8 @@ trigger: - icon variables: -- group: Xamarin Release - group: Xamarin-Secrets +- group: Xamarin Release - name: Configuration value: Release - name: DotNetVersion @@ -24,37 +23,105 @@ variables: value: $(Build.ArtifactStagingDirectory)/package - name: System.Debug value: true +- name: TeamName + value: "VSCX Platform Tools" +- name: MainBranch + value: refs/heads/main resources: repositories: - repository: templates type: github name: xamarin/yaml-templates - ref: refs/heads/master + ref: refs/heads/main endpoint: xamarin stages: - stage: Windows jobs: - job: Build - pool: VSEng-MicroBuildVS2019 + pool: + name: VSEngSS-MicroBuild2022-1ES steps: - checkout: self clean: true submodules: recursive + - task: UseDotNet@2 inputs: version: $(DotNetVersion) performMultiLevelLookup: true - - script: 'dotnet tool update -g dotnet-format && dotnet format -f $(Build.SourcesDirectory)\src --dry-run --check -v:diag' + + - powershell: | + dotnet --version + dotnet --list-sdks + displayName: 'Show .NET versions' + + - task: NuGetAuthenticate@0 + displayName: Authenticate NuGet feeds + inputs: + forceReinstallCredentialProvider: true + + - powershell: | + $branch = "$(Build.SourceBranch)" + Write-Host "Branch: ${branch}" + $buildReason = "$(Build.Reason)" + Write-Host "Build.Reason: ${buildReason}" + $codeSignOverride = '' # Defaulting to empty as opposed to 'false' allows for the template to still determine if signing is needed + # The template will only set Xamarin.CodeSign to true and enable real sigining for builds triggered against release branches such as 'd17-0' + # The template does not enable real signing for the main branch and so we enable real signing for main here + if ($branch -eq "$(MainBranch)") { + $codeSignOverride = 'true' + } + Write-Host "Setting CodeSignOverride: ${codeSignOverride}" + Write-Host "##vso[task.setvariable variable=CodeSignOverride]$codeSignOverride" + displayName: 'Set CodeSignOverride' + + - template: jenkins-codesign/signType.v1.yml@templates + parameters: + CodeSignOverride: "$(CodeSignOverride)" + + - task: MicroBuildSigningPlugin@2 + inputs: + signType: "$(Xamarin.SignType)" + feedSource: 'https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json' + env: + TeamName: "$(TeamName)" + + # Disabled due to unreliability in loading the service index for source https://devdiv.pkgs.visualstudio.com/_packaging/xamarin-xvs/nuget/v3/index.json. [C:\Users\VssAdministrator\AppData\Local\Temp\nabauqrz.xry\restore.csproj] + - powershell: | + # https://stackoverflow.com/questions/58764322/cannot-install-dotnet-ef-tool-on-windows-10 + # https://devdiv.visualstudio.com/DevDiv/_artifacts/feed/xamarin-xvs/NuGet/dotnet-format/6.0.226302/versions + dotnet tool update -g dotnet-format --version 6.0.226302 + dotnet format -f $(Build.SourcesDirectory)\src --check -v:diag displayName: Check .editorconfig compliance + enabled: false + - template: dump-environment.yml@templates - task: MSBuild@1 displayName: Build inputs: solution: src\Merq.sln - msbuildArguments: '-r -bl:$(Build.ArtifactStagingDirectory)/logs/build.binlog' + configuration: $(Configuration) + msbuildArguments: '-r -v:normal -p:Configuration=$(Configuration) -bl:$(Build.ArtifactStagingDirectory)/logs/build.binlog' # Note: Setting configuration on the task does not appear to be sufficient. Also set as a build property + + - powershell: | + $filename = "$(Build.SourcesDirectory)\src\Vsix\Merq.Vsix\obj\$(Configuration)\extension.vsixmanifest" + if ([IO.File]::Exists($filename)) { + type $filename + } else { + Write-Host "File not found: ${filename}" + } + + $filename = "$(Build.SourcesDirectory)\src\Vsix\Merq.Vsix\bin\$(Configuration)\extension.vsixmanifest" + if ([IO.File]::Exists($filename)) { + type $filename + } else { + Write-Host "File not found: ${filename}" + } + displayName: Show extension.vsixmanifest + condition: always() - task: VSTest@2 displayName: 'Test' @@ -69,20 +136,28 @@ stages: runInParallel: false rerunFailedTests: true rerunMaxAttempts: 5 - + - task: PublishBuildArtifacts@1 displayName: 'Logs' condition: always() inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)/logs' ArtifactName: logs - + - task: PublishBuildArtifacts@1 displayName: 'Artifacts' inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)/package' ArtifactName: package + - task: MicroBuildCodesignVerify@3 + displayName: 'Verify Signed Files' + inputs: + TargetFolders: | + $(Build.ArtifactStagingDirectory)/package + ExcludeSNVerify: true + ApprovalListPathForCerts: '$(Build.SourcesDirectory)/signexclusionlist.csv' + - task: PublishBuildArtifacts@1 displayName: 'Symbols' inputs: @@ -92,7 +167,11 @@ stages: - stage: Upload jobs: - job: Upload - pool: VSEng-MicroBuildVS2019 + pool: + name: AzurePipelines-EO + demands: + - ImageOverride -equals AzurePipelinesWindows2022compliant + steps: - checkout: self @@ -104,12 +183,6 @@ stages: - script: 'dotnet tool update -g --version 7.0.0 PowerShell >nul || dotnet tool list -g' displayName: UsePowerShell - - template: fix-source-version/v2.yml@templates - # This is only needed while we teach the build-tools tasks how to receive overriden variables. - - script: git reset --hard $(GitHub.Commit) - displayName: Align checkout with GitHub.Commit - condition: ne(variables['GitHub.Commit'], variables['Build.SourceVersion']) - - task: DownloadBuildArtifacts@0 inputs: artifactName: package @@ -121,12 +194,28 @@ stages: Azure.ContainerName: 'xvs-merq' GitHub.Context: 'artifacts' - - task: NuGetCommand@2 - displayName: Push Packages - continueOnError: true - condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['PushPackages'], 'true'))) - inputs: - command: push - packagesToPush: $(Build.ArtifactStagingDirectory)/package/*.nupkg - nuGetFeedType: external - publishFeedCredentials: 'xamarin-impl public feed' + # TODO: If you are making updates to the product code as opposed to an infrastructure change, you will need to re-enable this nuget.org publishing step as part of your PR + # Also update the README file to remove the IMPORTANT notice regarding the need to re-enable this step + # This step was disabled at the time of making the needed infrastructure changes to migrate Merg from the MobileEssentials GitHub org to Xamarin + # - task: NuGetCommand@2 + # displayName: Push Packages + # continueOnError: true + # condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['PushPackages'], 'true'))) + # inputs: + # command: push + # packagesToPush: $(Build.ArtifactStagingDirectory)/package/*.nupkg + # nuGetFeedType: external + # publishFeedCredentials: 'xamarin-impl public feed' + +- stage: SBOM + displayName: 'Software Bill of Materials' + dependsOn: + - Upload + + jobs: + - template: compliance/sbom/job.v1.yml@templates # Software Bill of Materials (SBOM): https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/secure-supply-chain/ado-sbom-generator + parameters: + packageName: 'Mobile Essentials' + artifactNames: ['package'] + packageFilter: '*.vsix;*.nupkg' + packageVersionRegex: '(?i)^Merq\.(?\d+\.\d+\.\d+).vsix$' diff --git a/signexclusionlist.csv b/signexclusionlist.csv new file mode 100644 index 00000000..1c420755 --- /dev/null +++ b/signexclusionlist.csv @@ -0,0 +1 @@ +*.xml,ignore unsigned xml \ No newline at end of file diff --git a/src/Core/Merq.Core/Merq.Core.csproj b/src/Core/Merq.Core/Merq.Core.csproj index f45d950c..299a527f 100644 --- a/src/Core/Merq.Core/Merq.Core.csproj +++ b/src/Core/Merq.Core/Merq.Core.csproj @@ -14,6 +14,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + @@ -29,6 +33,12 @@ + + + Microsoft400 + + + True @@ -49,14 +59,13 @@ - + - + - + - \ No newline at end of file diff --git a/src/Core/Merq/GitInfo.txt b/src/Core/Merq/GitInfo.txt index 8cfbc905..cb174d58 100644 --- a/src/Core/Merq/GitInfo.txt +++ b/src/Core/Merq/GitInfo.txt @@ -1 +1 @@ -1.1.1 \ No newline at end of file +1.2.1 \ No newline at end of file diff --git a/src/Core/Merq/IExecutableCommandHandler.cs b/src/Core/Merq/IExecutableCommandHandler.cs index 496dbd5d..cdae0180 100644 --- a/src/Core/Merq/IExecutableCommandHandler.cs +++ b/src/Core/Merq/IExecutableCommandHandler.cs @@ -4,8 +4,9 @@ namespace Merq { /// /// Marker interface for all generic command handlers, whether synchronous or asynchronous, - /// allowing easy introspection of the generic if necessary. + /// allowing easy introspection of the generic if necessary. /// + /// The type of command to be executed. [EditorBrowsable(EditorBrowsableState.Never)] public interface IExecutableCommandHandler : ICommandHandler where TCommand : IExecutable { @@ -13,9 +14,10 @@ public interface IExecutableCommandHandler : ICommandHandler where /// /// Marker interface for all generic command handlers that return values, whether synchronous or asynchronous, - /// allowing easy introspection of the generic and + /// allowing easy introspection of the generic and /// if necessary. /// + /// The type of command to be executed. /// The type of the command execution result. [EditorBrowsable(EditorBrowsableState.Never)] public interface IExecutableCommandHandler : IExecutableCommandHandler where TCommand : IExecutable diff --git a/src/Core/Merq/Merq.csproj b/src/Core/Merq/Merq.csproj index 94beef93..4551a1d6 100644 --- a/src/Core/Merq/Merq.csproj +++ b/src/Core/Merq/Merq.csproj @@ -18,6 +18,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + @@ -26,9 +30,10 @@ - - <_Parameter1>Merq.Core.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001009d69078301b6c4881e95cd924d5e355a4d24ba3d28fb571e00124706538eef959eb371fbb9bd2776fbe7d228178df51fbd4a849aff37161190f3254c77167d16e42c2be32c817537b67b874b66be01a4b6d1c780ff052c8f7f52cad6751288911d450cf443ed4f40b266332f6f25204df23df9a23d38e5fe19f6372a636c7da1 - + + + Microsoft400 + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 3abaccde..8434f8fb 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -5,9 +5,9 @@ mobessen Copyright 2016 © Mobile Essentials - https://github.com/MobileEssentials/Merq - https://github.com/MobileEssentials/Merq/blob/master/LICENSE - https://raw.github.com/MobileEssentials/Merq/master/icon/48.png + https://github.com/Xamarin/Merq + https://github.com/Xamarin/Merq/blob/main/LICENSE + https://raw.github.com/Xamarin/Merq/main/icon/48.png false $(DefaultItemExcludes);**/*.binlog @@ -21,7 +21,7 @@ - + diff --git a/src/GitInfo.txt b/src/GitInfo.txt index 26aaba0e..f0bb29e7 100644 --- a/src/GitInfo.txt +++ b/src/GitInfo.txt @@ -1 +1 @@ -1.2.0 +1.3.0 diff --git a/src/Installers/Merq.Msi/Product.wxs b/src/Installers/Merq.Msi/Product.wxs index 72b68710..a616ea3e 100644 --- a/src/Installers/Merq.Msi/Product.wxs +++ b/src/Installers/Merq.Msi/Product.wxs @@ -30,7 +30,7 @@ - + diff --git a/src/Installers/SampleBundle/Bundle.wxs b/src/Installers/SampleBundle/Bundle.wxs index 8548ee6b..fd52ae69 100644 --- a/src/Installers/SampleBundle/Bundle.wxs +++ b/src/Installers/SampleBundle/Bundle.wxs @@ -15,7 +15,7 @@ LogoFile="Resources/banner.bmp" ThemeFile="Resources/ClassicTheme.xml" LocalizationFile="Resources/ClassicTheme.wxl" - LicenseUrl="https://github.com/MobileEssentials/Merq/blob/master/LICENSE" /> + LicenseUrl="https://github.com/Xamarin/Merq/blob/main/LICENSE" /> diff --git a/src/Merq.VisualStudio.proj b/src/Merq.VisualStudio.proj index cb3eba3c..2b91d776 100644 --- a/src/Merq.VisualStudio.proj +++ b/src/Merq.VisualStudio.proj @@ -27,8 +27,7 @@ Command Bus and Event Stream implementation installers for Visual Studio Extensibility. Copyright 2016 © Mobile Essentials - $(Out) - ..\out + $(OutDir) @@ -55,7 +54,7 @@ - + @@ -74,7 +73,7 @@ $(MSBuildExtensionsPath)\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets - + @@ -84,4 +83,4 @@ - \ No newline at end of file + diff --git a/src/Merq.props b/src/Merq.props index 915fa6fe..f372e9b5 100644 --- a/src/Merq.props +++ b/src/Merq.props @@ -18,6 +18,7 @@ true false $(MSBuildThisFileDirectory)Merq.snk + 00240000048000009400000006020000002400005253413100040000010001009d69078301b6c4881e95cd924d5e355a4d24ba3d28fb571e00124706538eef959eb371fbb9bd2776fbe7d228178df51fbd4a849aff37161190f3254c77167d16e42c2be32c817537b67b874b66be01a4b6d1c780ff052c8f7f52cad6751288911d450cf443ed4f40b266332f6f25204df23df9a23d38e5fe19f6372a636c7da1 true false $(OutputPath) diff --git a/src/Merq.sln b/src/Merq.sln index dee9c51c..24db2a17 100644 --- a/src/Merq.sln +++ b/src/Merq.sln @@ -29,7 +29,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Merq.Core.Tests", "Core\Mer EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Merq.Core", "Core\Merq.Core\Merq.Core.csproj", "{33BDD9D1-3E01-49C1-AB46-50941DFFD5D4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merq.Vsix", "Vsix\Merq.Vsix\Merq.Vsix.csproj", "{C9A505CA-F826-473A-8290-B36AF6BE56FB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Merq.Vsix", "Vsix\Merq.Vsix\Merq.Vsix.csproj", "{C9A505CA-F826-473A-8290-B36AF6BE56FB}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Merq.Vsix.Tests", "Vsix\Merq.Vsix.Tests\Merq.Vsix.Tests.csproj", "{882DCF88-ADA6-4425-8E57-8EA4B3201DD5}" EndProject diff --git a/src/Version.targets b/src/Version.targets index 2136ff73..02effcdc 100644 --- a/src/Version.targets +++ b/src/Version.targets @@ -28,10 +28,12 @@ BeforeTargets="PrepareForBuild;GetAssemblyVersion;GetPackageVersion;Pack" DependsOnTargets="GitVersion" Condition="'$(ExcludeRestorePackageImports)' != 'true' and '$(GitInfoImported)' == 'true'"> + - $(GitSemVerDashLabel)-pr$(BUILD_SOURCEBRANCH.Substring(10).TrimEnd('/merge')) + $(BUILD_SOURCEBRANCH.Substring(10).TrimEnd('/merge')) + $(GitSemVerDashLabel)-pr$(PRNumber) $(GitSemVerDashLabel)-pr$(APPVEYOR_PULL_REQUEST_NUMBER) @@ -39,8 +41,8 @@ $(BUILD_SOURCEBRANCHNAME) $(APPVEYOR_REPO_BRANCH) - <_IndexOfBranchSlash>$(GitBranch.LastIndexOf('/')) @@ -48,19 +50,27 @@ <_GitBranch Condition="'$(_IndexOfBranchSlash)' != '0'">$(GitBranch.Substring($(_IndexOfBranchSubstring))) <_GitBranch Condition="'$(_IndexOfBranchSlash)' == '0'">$(GitBranch) - - -$(_GitBranch) - $(_GitBranch). + + -$(_GitBranch) + $(_GitBranch). $(SemVerMetadata)sha.$(GitCommit) - $(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch)$(GitSemVerDashLabel).$(GitCommits) + $(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitCommits) $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch) $(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch) $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch) $(PackageVersion)+$(SemVerMetadata) + + + + + + + + diff --git a/src/Vsix/Merq.Vsix/Merq.Vsix.csproj b/src/Vsix/Merq.Vsix/Merq.Vsix.csproj index 26c1beee..4de07e6a 100644 --- a/src/Vsix/Merq.Vsix/Merq.Vsix.csproj +++ b/src/Vsix/Merq.Vsix/Merq.Vsix.csproj @@ -5,11 +5,17 @@ net472 Merq Merq.vsix + true false + + true + false + false + false - + True @@ -32,7 +38,7 @@ true - + @@ -61,19 +67,86 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + - - - + + + + + - + + + + + + + + + + + + + + + + + + Microsoft400 + + + + + + + + + + + + + + + VsixSHA2 + + + NuGet + + + + + + + + + + + + true @@ -88,9 +161,9 @@ Merq.Properties - + - + Program $(DevEnvDir)\devenv.exe diff --git a/src/Vsix/Merq.Vsix/Merq.Vsix.targets b/src/Vsix/Merq.Vsix/Merq.Vsix.targets index 5e493ba6..caa6f338 100644 --- a/src/Vsix/Merq.Vsix/Merq.Vsix.targets +++ b/src/Vsix/Merq.Vsix/Merq.Vsix.targets @@ -1,6 +1,6 @@  - + false true @@ -23,8 +23,7 @@ $([System.IO.Path]::ChangeExtension('$(TargetVsixContainerName)', '$(FileVersion).vsix')) - $([System.IO.Path]::Combine('$(PackageOutputPath)', '$(TargetVsixContainerName)')) - $([System.IO.Path]::Combine('$(OutDir)', '$(TargetVsixContainerName)')) + $([System.IO.Path]::Combine('$(OutDir)', '$(TargetVsixContainerName)')) diff --git a/src/Vsix/Merq.Vsix/source.extension.vsixmanifest b/src/Vsix/Merq.Vsix/source.extension.vsixmanifest index 93b05c24..33caa0f4 100644 --- a/src/Vsix/Merq.Vsix/source.extension.vsixmanifest +++ b/src/Vsix/Merq.Vsix/source.extension.vsixmanifest @@ -6,7 +6,7 @@ Extensibility Message Bus Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration. - https://github.com/MobileEssentials/Merq + https://github.com/Xamarin/Merq LICENSE Merq.ico 200.png