Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NuGet Package Content and Metadata #143

Merged
merged 4 commits into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 19 additions & 19 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
<Project>

<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<DebugType>Portable</DebugType>
<LangVersion>8.0</LangVersion>
<Authors>Microsot Health Team</Authors>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is freeform and doesn't need to be related to any user in the feed/nuget.org. Does anyone have another value they'd like to use here?

<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<Company>Microsoft Corporation</Company>
<Copyright>Copyright © Microsoft Corporation. All rights reserved.</Copyright>
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<HighEntropyVA>true</HighEntropyVA>
<EnableSourceLink Condition="$([MSBuild]::IsOSPlatform('osx'))">false</EnableSourceLink>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work on OSX now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at SourceLink's issues page, the only potential issue I found was related to mono: dotnet/sourcelink#155. This has since been fixed, so I think we're good to go.

<EnableSourceControlManagerQueries>$(EnableSourceLink)</EnableSourceControlManagerQueries>
<!--This will target the latest patch release of the runtime released with the current SDK. -->
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<LangVersion>8.0</LangVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Product>Microsoft Health</Product>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryUrl>https://github.com/microsoft/healthcare-components</RepositoryUrl>

<SupportedFrameworks>netcoreapp3.1;net5.0</SupportedFrameworks>
<SdkPackageVersion>3.1.7</SdkPackageVersion>
<SupportedFrameworks>netcoreapp3.1;net5.0</SupportedFrameworks>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework.StartsWith('net5'))">
<SdkPackageVersion>5.0.0</SdkPackageVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(EnableSourceLink)' == 'true' ">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<Choose>
<When Condition="$(MSBuildProjectName.Contains('Test'))">
<PropertyGroup>
Expand All @@ -46,15 +45,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
</ItemGroup>

<Choose>
<When Condition="$(MSBuildProjectName)!='Microsoft.Health.Extensions.BuildTimeCodeGenerator' AND !$(MSBuildProjectName.Contains('Test'))">
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" PrivateAssets="All" />
</ItemGroup>
</When>
</Choose>

</Project>
6 changes: 3 additions & 3 deletions build/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
packageArtifacts: true

steps:
- task: UseDotNet@2
displayName: 'Use .NET Core 3.1.x SDK'
Expand All @@ -17,14 +17,14 @@ steps:
displayName: 'dotnet build $(buildConfiguration)'
inputs:
command: build
arguments: '--configuration $(buildConfiguration) /p:AssemblyVersion="$(assemblySemVer)" /p:FileVersion="$(assemblySemFileVer)" /p:InformationalVersion="$(informationalVersion)" /warnaserror'
arguments: '--configuration $(buildConfiguration) /p:AssemblyVersion="$(assemblySemVer)" /p:FileVersion="$(assemblySemFileVer)" /p:InformationalVersion="$(informationalVersion)" /p:ContinuousIntegrationBuild=true /warnaserror'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag sets determinism-related flags that would only apply on a CI server, like deterministic source paths, etc.


- task: DotNetCoreCLI@2
displayName: 'dotnet test UnitTests'
inputs:
command: test
projects: '**/*UnitTests/*.csproj'
arguments: '--configuration $(buildConfiguration)'

- ${{ if eq(parameters.packageArtifacts, 'true') }}:
- template: package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Abstractions used by Microsoft Health.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\test\Microsoft.Health.Test.Common\Microsoft.Health.Test.Utilities.csproj" />
<ProjectReference Include="..\Microsoft.Health.Api\Microsoft.Health.Api.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\test\Microsoft.Health.Test.Common\Microsoft.Health.Test.Utilities.csproj" />
<ProjectReference Include="..\Microsoft.Health.Api\Microsoft.Health.Api.csproj" />
</ItemGroup>
</Project>
55 changes: 28 additions & 27 deletions src/Microsoft.Health.Api/Microsoft.Health.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<Description>Common components, such as middleware, for Microsoft Health APIs using ASP.NET Core.</Description>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(SdkPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(SdkPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.Health.Core\Microsoft.Health.Core.csproj" />
<ProjectReference Include="..\Microsoft.Health.Extensions.DependencyInjection\Microsoft.Health.Extensions.DependencyInjection.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Health.Core\Microsoft.Health.Core.csproj" />
<ProjectReference Include="..\Microsoft.Health.Extensions.DependencyInjection\Microsoft.Health.Extensions.DependencyInjection.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Microsoft.Health.Api/Modules/InitializationModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
namespace Microsoft.Health.Api.Modules
{
/// <summary>
/// Starts all <see cref="IStartable"/> instances in the IoC container and ensures that all <see cref="IRequireInitializationOnFirstRequest"/> instances
/// are initialized before any controllers are invoked.
/// Ensures that all <see cref="IRequireInitializationOnFirstRequest"/> instances are
/// initialized before any controllers are invoked.
/// </summary>
public class InitializationModule : IStartupModule, IStartupFilter
{
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.Health.Blob/Microsoft.Health.Blob.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Azure blob storage utilities for Microsoft Health.</Description>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Moq" Version="4.14.7" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Moq" Version="4.14.7" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.Health.Client\Microsoft.Health.Client.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Health.Client\Microsoft.Health.Client.csproj" />
</ItemGroup>

</Project>
20 changes: 11 additions & 9 deletions src/Microsoft.Health.Client/Microsoft.Health.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<Description>Utilities for HTTP clients that communicate with Microsoft Health services.</Description>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Ensure.That" Version="9.2.0" />
<PackageReference Include="Microsoft.Azure.Services.AppAuthentication" Version="1.5.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(SdkPackageVersion)" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="5.5.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Ensure.That" Version="9.2.0" />
<PackageReference Include="Microsoft.Azure.Services.AppAuthentication" Version="1.5.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(SdkPackageVersion)" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="5.5.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
<RootNamespace>Microsoft.Health.Extensions.UnitTests</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
<RootNamespace>Microsoft.Health.Extensions.UnitTests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.Health.Core\Microsoft.Health.Core.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Health.Core\Microsoft.Health.Core.csproj" />
</ItemGroup>

</Project>
56 changes: 29 additions & 27 deletions src/Microsoft.Health.Core/Microsoft.Health.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<Description>Common primitives and utilities used by Microsoft Health.</Description>
<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(SdkPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(SdkPackageVersion)" />
<PackageReference Include="Ensure.That" Version="9.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.13" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(SdkPackageVersion)" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: Normalize .csproj identation to 2 spaces
What is the default? Will this play nice with everyone's editors, is there a settings file to make this consistent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should, as this is the default (and most of the other files were using this). However, we may want to consider the use of an .editorconfig file in the near future, perhaps as part of another PR.

<PackageReference Include="Microsoft.Extensions.Logging" Version="$(SdkPackageVersion)" />
<PackageReference Include="Ensure.That" Version="9.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.13" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.Health.Abstractions\Microsoft.Health.Abstractions.csproj" />
<ProjectReference Include="..\Microsoft.Health.Extensions.DependencyInjection\Microsoft.Health.Extensions.DependencyInjection.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Health.Abstractions\Microsoft.Health.Abstractions.csproj" />
<ProjectReference Include="..\Microsoft.Health.Extensions.DependencyInjection\Microsoft.Health.Extensions.DependencyInjection.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Identity primitives used by Microsoft Health.</Description>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like Identity primitives used by Microsoft Health for local development scenarios.

Copy link
Member Author

@wsugarman wsugarman Jan 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Changed to Identity primitives used by Microsoft Health for local development.

<TargetFrameworks>$(SupportedFrameworks);</TargetFrameworks>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Dependency injection extensions for Microsoft's default implementation used by Microsoft Health.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private static object Factory<T>(IServiceProvider provider)
EnsureArg.IsNotNull(provider, nameof(provider));

var delegateType = typeof(TDelegate);
Func<TService> factory = () => (TService)provider.GetService<TImplementation>();
Func<TService> factory = () => provider.GetService<TImplementation>();
var invokeMethod = factory.GetType().GetMethod(nameof(factory.Invoke));
return invokeMethod.CreateDelegate(delegateType, factory);
}
Expand Down