Skip to content

Commit

Permalink
Fix Nullable Warnings & projectcacheplugin.csproj now targets net5.0 (#…
Browse files Browse the repository at this point in the history
…6048)

Fixes official builds after the arcade update. This failed because arcade CI had merged with a successful (but stale) CI build.
  • Loading branch information
benvillalobos committed Jan 20, 2021
1 parent f98579d commit 4797664
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Expand Up @@ -43,7 +43,7 @@
<ProjectReference Include="..\Samples\ProjectCachePlugin\ProjectCachePlugin.csproj" Private="false" ReferenceOutputAssembly="false">
<SetTargetFramework Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">TargetFramework=$(FullFrameworkTFM)</SetTargetFramework>
<SetTargetFramework Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(MonoBuild)' == 'true'">TargetFramework=$(FullFrameworkTFM)</SetTargetFramework>
<SetTargetFramework Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">TargetFramework=netcoreapp2.1</SetTargetFramework>
<SetTargetFramework Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">TargetFramework=net5.0</SetTargetFramework>
</ProjectReference>

<Reference Include="System.Configuration" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'" />
Expand Down
8 changes: 4 additions & 4 deletions src/Build/BackEnd/Components/ProjectCache/ProjectCacheItem.cs
Expand Up @@ -26,25 +26,25 @@ public ProjectCacheItem(string pluginPath, IReadOnlyDictionary<string, string> p
public string PluginPath { get; }
public IReadOnlyDictionary<string, string> PluginSettings { get; }

public bool Equals(ProjectCacheItem other)
public bool Equals(ProjectCacheItem? other)
{
if (ReferenceEquals(this, other))
{
return true;
}

return PluginPath == other.PluginPath &&
return PluginPath == other?.PluginPath &&
CollectionHelpers.DictionaryEquals(PluginSettings, other.PluginSettings);
}

public override bool Equals(object obj)
public override bool Equals(object? obj)
{
if (ReferenceEquals(this, obj))
{
return true;
}

if (obj.GetType() != GetType())
if (obj?.GetType() != GetType())
{
return false;
}
Expand Down
Expand Up @@ -92,7 +92,7 @@ private static ProjectCachePluginBase GetPluginInstanceFromType(Type pluginType)
{
try
{
return (ProjectCachePluginBase) Activator.CreateInstance(pluginType);
return (ProjectCachePluginBase) Activator.CreateInstance(pluginType)!;
}
catch (TargetInvocationException e) when (e.InnerException != null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Samples/ProjectCachePlugin/ProjectCachePlugin.csproj
Expand Up @@ -4,8 +4,8 @@
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(OsEnvironment)'=='windows'">$(FullFrameworkTFM);netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net5.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(FullFrameworkTFM);net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(MonoBuild)'=='true'">$(RuntimeOutputTargetFrameworks)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
Expand Down

0 comments on commit 4797664

Please sign in to comment.