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

#275 Add in Net 6 to optimize dependencies #276

Open
wants to merge 3 commits into
base: main
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
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<Title>System.Text.Json Serializer for Cache Tower</Title>
<Description>System.Text.Json cache serialization for Cache Tower</Description>
<PackageTags>system.text.json;json;$(PackageBaseTags)</PackageTags>
<Authors>James Turner</Authors>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
</ItemGroup>

Expand Down
12 changes: 9 additions & 3 deletions src/CacheTower/CacheTower.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
<Title>Cache Tower</Title>
<Description>A multi-layered caching system for .NET</Description>
<PackageTags>inmemory,$(PackageBaseTags)</PackageTags>
Expand All @@ -13,13 +13,19 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.4" />
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
<PackageReference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageReference Update="TurnerSoftware.BuildVersioning" Version="0.5.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/CacheTower/Internal/CacheEntryKeyLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public bool AcquireLock(string cacheKey)
keyLocks[cacheKey] = null;
}
return hasLock;
#elif NETSTANDARD2_1
#else
return keyLocks.TryAdd(cacheKey, null);
#endif
}
Expand Down Expand Up @@ -56,7 +56,7 @@ private bool TryRemove(string cacheKey, out TaskCompletionSource<ICacheEntry>? c
return true;
}
return false;
#elif NETSTANDARD2_1
#else
return keyLocks.Remove(cacheKey, out completionSource);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/CacheTower/Internal/MD5HashUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static unsafe string ComputeHash(string value)
var bytes = Encoding.UTF8.GetBytes(value);
var hashBytes = HashAlgorithm.ComputeHash(bytes);

#elif NETSTANDARD2_1
#else
public static unsafe string ComputeHash(ReadOnlySpan<char> value)
{
var encoding = Encoding.UTF8;
Expand Down