Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

Minor build/dep updates #53

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ out
bin
obj
packages
pack
*.nuget.targets
*.nuget.props
*.lock.json
Expand Down
11 changes: 8 additions & 3 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--
Consolidated feeds.
Reducing the number of feeds speeds up restore and improves security & reliability

View and edit this feed, push new packages, view or add upstream feeds at:
https://devdiv.visualstudio.com/DevDiv/_artifacts/feed/xamarin-xvs
-->
<clear />
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
<add key="xamarin-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
<add key="nugetizer" value="https://ci.appveyor.com/nuget/nugetizer3000" />
<add key="xvs" value="https://devdiv.pkgs.visualstudio.com/_packaging/xamarin-xvs/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
================

⚠️<b>IMPORTANT:</b> 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
<br><br>

> **Mercury:** messenger of the Roman gods

> *Mercury* > *Merq-ry* > **Merq**
Expand All @@ -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)
139 changes: 114 additions & 25 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ trigger:
batch: false
branches:
include:
- master
- dev/*
- main
- feature/*
- rel/*
paths:
Expand All @@ -14,8 +13,8 @@ trigger:
- icon

variables:
- group: Xamarin Release
- group: Xamarin-Secrets
- group: Xamarin Release
- name: Configuration
value: Release
- name: DotNetVersion
Expand All @@ -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'
Expand All @@ -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:
Expand All @@ -92,7 +167,11 @@ stages:
- stage: Upload
jobs:
- job: Upload
pool: VSEng-MicroBuildVS2019
pool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals AzurePipelinesWindows2022compliant

steps:
- checkout: self

Expand All @@ -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
Expand All @@ -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\.(?<version>\d+\.\d+\.\d+).vsix$'
1 change: 1 addition & 0 deletions signexclusionlist.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.xml,ignore unsigned xml
17 changes: 13 additions & 4 deletions src/Core/Merq.Core/Merq.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

<ItemGroup>
<PackageReference Include="IFluentInterface" Version="2.*" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="MSBuilder.ThisAssembly.Project" Version="0.3.3" PrivateAssets="all" />
<PackageReference Include="netfx-System.StringResources" Version="3.0.14" PrivateAssets="all" />
<PackageReference Include="Microsoft.CSharp" Version="4.0.1" PrivateAssets="all" />
Expand All @@ -29,6 +33,12 @@
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<FilesToSign Include="$(OutDir)\Merq.Core.dll">
<Authenticode>Microsoft400</Authenticode>
</FilesToSign>
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
Expand All @@ -49,14 +59,13 @@
<ItemGroup>
<PackageFile Include="$(OutputPath)\$(PackageId).*" Exclude="$(OutputPath)\$(PackageId)*.nupkg;$(OutputPath)\$(PackageId)*.json" Kind="Lib" />
</ItemGroup>

<MSBuild Projects="..\Merq\Merq.csproj" Targets="GetPackageVersion">
<Output TaskParameter="TargetOutputs" PropertyName="MerqVersion" />
</MSBuild>

<ItemGroup>
<PackageFile Include="Merq" Kind="Dependency" Version="$(MerqVersion)" />
<PackageFile Include="Merq" Kind="Dependency" Version="$(MerqVersion)" />
</ItemGroup>
</Target>

</Project>
2 changes: 1 addition & 1 deletion src/Core/Merq/GitInfo.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.1
1.2.1
6 changes: 4 additions & 2 deletions src/Core/Merq/IExecutableCommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ namespace Merq
{
/// <summary>
/// Marker interface for all generic command handlers, whether synchronous or asynchronous,
/// allowing easy introspection of the generic <typeparam name="TCommand" /> if necessary.
/// allowing easy introspection of the generic <typeparamref name="TCommand" /> if necessary.
/// </summary>
/// <typeparam name="TCommand">The type of command to be executed.</typeparam>
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IExecutableCommandHandler<in TCommand> : ICommandHandler where TCommand : IExecutable
{
}

/// <summary>
/// Marker interface for all generic command handlers that return values, whether synchronous or asynchronous,
/// allowing easy introspection of the generic <typeparam name="TCommand" /> and <typeparamref name="TResult"/>
/// allowing easy introspection of the generic <typeparamref name="TCommand" /> and <typeparamref name="TResult"/>
/// if necessary.
/// </summary>
/// <typeparam name="TCommand">The type of command to be executed.</typeparam>
/// <typeparam name="TResult">The type of the command execution result.</typeparam>
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IExecutableCommandHandler<in TCommand, out TResult> : IExecutableCommandHandler<TCommand> where TCommand : IExecutable<TResult>
Expand Down
11 changes: 8 additions & 3 deletions src/Core/Merq/Merq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

<ItemGroup>
<PackageReference Include="IFluentInterface" Version="2.0.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="MSBuilder.ThisAssembly.Project" Version="0.3.3" PrivateAssets="all" />
</ItemGroup>

Expand All @@ -26,9 +30,10 @@
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Merq.Core.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001009d69078301b6c4881e95cd924d5e355a4d24ba3d28fb571e00124706538eef959eb371fbb9bd2776fbe7d228178df51fbd4a849aff37161190f3254c77167d16e42c2be32c817537b67b874b66be01a4b6d1c780ff052c8f7f52cad6751288911d450cf443ed4f40b266332f6f25204df23df9a23d38e5fe19f6372a636c7da1</_Parameter1>
</AssemblyAttribute>
<InternalsVisibleTo Include="Merq.Core.Tests" />
<FilesToSign Include="$(OutDir)\Merq.dll">
<Authenticode>Microsoft400</Authenticode>
</FilesToSign>
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<Owners>mobessen</Owners>
<Copyright>Copyright 2016 © Mobile Essentials</Copyright>

<PackageProjectUrl>https://github.com/MobileEssentials/Merq</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/MobileEssentials/Merq/blob/master/LICENSE</PackageLicenseUrl>
<PackageIconUrl>https://raw.github.com/MobileEssentials/Merq/master/icon/48.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/Xamarin/Merq</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/Xamarin/Merq/blob/main/LICENSE</PackageLicenseUrl>
<PackageIconUrl>https://raw.github.com/Xamarin/Merq/main/icon/48.png</PackageIconUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>

<DefaultItemExcludes>$(DefaultItemExcludes);**/*.binlog</DefaultItemExcludes>
Expand All @@ -21,7 +21,7 @@

<ItemGroup>
<PackageReference Include="MSBuilder" Version="0.2.0" PrivateAssets="All" />
<PackageReference Include="NuGet.Build.Packaging" Version="0.2.5-dev.1" PrivateAssets="All" />
<PackageReference Include="NuGet.Build.Packaging" Version="0.2.2" PrivateAssets="All" />
<PackageReference Include="GitInfo" Version="2.0.11" PrivateAssets="All" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/GitInfo.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.3.0
Loading