Skip to content

Commit 3ec8c35

Browse files
author
John Luo
authored
Multitarget extensions packages to remove dependencies for source build (dotnet#2090)
1 parent c24711c commit 3ec8c35

File tree

112 files changed

+2376
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+2376
-97
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
<!-- This file is automatically generated. -->
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
55
</PropertyGroup>
66
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
77
<Compile Include="Microsoft.Extensions.Caching.Abstractions.netstandard2.0.cs" />
88
<Reference Include="Microsoft.Extensions.Primitives" />
99
</ItemGroup>
10+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
11+
<Compile Include="Microsoft.Extensions.Caching.Abstractions.netcoreapp3.0.cs" />
12+
<Reference Include="Microsoft.Extensions.Primitives" />
13+
</ItemGroup>
1014
</Project>
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
namespace Microsoft.Extensions.Caching.Distributed
5+
{
6+
public static partial class DistributedCacheEntryExtensions
7+
{
8+
public static Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions SetAbsoluteExpiration(this Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options, System.DateTimeOffset absolute) { throw null; }
9+
public static Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions SetAbsoluteExpiration(this Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options, System.TimeSpan relative) { throw null; }
10+
public static Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions SetSlidingExpiration(this Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options, System.TimeSpan offset) { throw null; }
11+
}
12+
public partial class DistributedCacheEntryOptions
13+
{
14+
public DistributedCacheEntryOptions() { }
15+
public System.DateTimeOffset? AbsoluteExpiration { get { throw null; } set { } }
16+
public System.TimeSpan? AbsoluteExpirationRelativeToNow { get { throw null; } set { } }
17+
public System.TimeSpan? SlidingExpiration { get { throw null; } set { } }
18+
}
19+
public static partial class DistributedCacheExtensions
20+
{
21+
public static string GetString(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key) { throw null; }
22+
[System.Diagnostics.DebuggerStepThroughAttribute]
23+
public static System.Threading.Tasks.Task<string> GetStringAsync(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) { throw null; }
24+
public static void Set(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, byte[] value) { }
25+
public static System.Threading.Tasks.Task SetAsync(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, byte[] value, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) { throw null; }
26+
public static void SetString(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value) { }
27+
public static void SetString(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options) { }
28+
public static System.Threading.Tasks.Task SetStringAsync(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) { throw null; }
29+
public static System.Threading.Tasks.Task SetStringAsync(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) { throw null; }
30+
}
31+
public partial interface IDistributedCache
32+
{
33+
byte[] Get(string key);
34+
System.Threading.Tasks.Task<byte[]> GetAsync(string key, System.Threading.CancellationToken token = default(System.Threading.CancellationToken));
35+
void Refresh(string key);
36+
System.Threading.Tasks.Task RefreshAsync(string key, System.Threading.CancellationToken token = default(System.Threading.CancellationToken));
37+
void Remove(string key);
38+
System.Threading.Tasks.Task RemoveAsync(string key, System.Threading.CancellationToken token = default(System.Threading.CancellationToken));
39+
void Set(string key, byte[] value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options);
40+
System.Threading.Tasks.Task SetAsync(string key, byte[] value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options, System.Threading.CancellationToken token = default(System.Threading.CancellationToken));
41+
}
42+
}
43+
namespace Microsoft.Extensions.Caching.Memory
44+
{
45+
public static partial class CacheEntryExtensions
46+
{
47+
public static Microsoft.Extensions.Caching.Memory.ICacheEntry AddExpirationToken(this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, Microsoft.Extensions.Primitives.IChangeToken expirationToken) { throw null; }
48+
public static Microsoft.Extensions.Caching.Memory.ICacheEntry RegisterPostEvictionCallback(this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, Microsoft.Extensions.Caching.Memory.PostEvictionDelegate callback) { throw null; }
49+
public static Microsoft.Extensions.Caching.Memory.ICacheEntry RegisterPostEvictionCallback(this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, Microsoft.Extensions.Caching.Memory.PostEvictionDelegate callback, object state) { throw null; }
50+
public static Microsoft.Extensions.Caching.Memory.ICacheEntry SetAbsoluteExpiration(this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, System.DateTimeOffset absolute) { throw null; }
51+
public static Microsoft.Extensions.Caching.Memory.ICacheEntry SetAbsoluteExpiration(this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, System.TimeSpan relative) { throw null; }
52+
public static Microsoft.Extensions.Caching.Memory.ICacheEntry SetOptions(this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options) { throw null; }
53+
public static Microsoft.Extensions.Caching.Memory.ICacheEntry SetPriority(this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, Microsoft.Extensions.Caching.Memory.CacheItemPriority priority) { throw null; }
54+
public static Microsoft.Extensions.Caching.Memory.ICacheEntry SetSize(this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, long size) { throw null; }
55+
public static Microsoft.Extensions.Caching.Memory.ICacheEntry SetSlidingExpiration(this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, System.TimeSpan offset) { throw null; }
56+
public static Microsoft.Extensions.Caching.Memory.ICacheEntry SetValue(this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, object value) { throw null; }
57+
}
58+
public static partial class CacheExtensions
59+
{
60+
public static object Get(this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key) { throw null; }
61+
[System.Diagnostics.DebuggerStepThroughAttribute]
62+
public static System.Threading.Tasks.Task<TItem> GetOrCreateAsync<TItem>(this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, System.Func<Microsoft.Extensions.Caching.Memory.ICacheEntry, System.Threading.Tasks.Task<TItem>> factory) { throw null; }
63+
public static TItem GetOrCreate<TItem>(this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, System.Func<Microsoft.Extensions.Caching.Memory.ICacheEntry, TItem> factory) { throw null; }
64+
public static TItem Get<TItem>(this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key) { throw null; }
65+
public static TItem Set<TItem>(this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, TItem value) { throw null; }
66+
public static TItem Set<TItem>(this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, TItem value, Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options) { throw null; }
67+
public static TItem Set<TItem>(this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, TItem value, Microsoft.Extensions.Primitives.IChangeToken expirationToken) { throw null; }
68+
public static TItem Set<TItem>(this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, TItem value, System.DateTimeOffset absoluteExpiration) { throw null; }
69+
public static TItem Set<TItem>(this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, TItem value, System.TimeSpan absoluteExpirationRelativeToNow) { throw null; }
70+
public static bool TryGetValue<TItem>(this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, out TItem value) { throw null; }
71+
}
72+
public enum CacheItemPriority
73+
{
74+
Low = 0,
75+
Normal = 1,
76+
High = 2,
77+
NeverRemove = 3,
78+
}
79+
public enum EvictionReason
80+
{
81+
None = 0,
82+
Removed = 1,
83+
Replaced = 2,
84+
Expired = 3,
85+
TokenExpired = 4,
86+
Capacity = 5,
87+
}
88+
public partial interface ICacheEntry : System.IDisposable
89+
{
90+
System.DateTimeOffset? AbsoluteExpiration { get; set; }
91+
System.TimeSpan? AbsoluteExpirationRelativeToNow { get; set; }
92+
System.Collections.Generic.IList<Microsoft.Extensions.Primitives.IChangeToken> ExpirationTokens { get; }
93+
object Key { get; }
94+
System.Collections.Generic.IList<Microsoft.Extensions.Caching.Memory.PostEvictionCallbackRegistration> PostEvictionCallbacks { get; }
95+
Microsoft.Extensions.Caching.Memory.CacheItemPriority Priority { get; set; }
96+
long? Size { get; set; }
97+
System.TimeSpan? SlidingExpiration { get; set; }
98+
object Value { get; set; }
99+
}
100+
public partial interface IMemoryCache : System.IDisposable
101+
{
102+
Microsoft.Extensions.Caching.Memory.ICacheEntry CreateEntry(object key);
103+
void Remove(object key);
104+
bool TryGetValue(object key, out object value);
105+
}
106+
public static partial class MemoryCacheEntryExtensions
107+
{
108+
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions AddExpirationToken(this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, Microsoft.Extensions.Primitives.IChangeToken expirationToken) { throw null; }
109+
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions RegisterPostEvictionCallback(this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, Microsoft.Extensions.Caching.Memory.PostEvictionDelegate callback) { throw null; }
110+
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions RegisterPostEvictionCallback(this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, Microsoft.Extensions.Caching.Memory.PostEvictionDelegate callback, object state) { throw null; }
111+
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions SetAbsoluteExpiration(this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, System.DateTimeOffset absolute) { throw null; }
112+
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions SetAbsoluteExpiration(this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, System.TimeSpan relative) { throw null; }
113+
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions SetPriority(this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, Microsoft.Extensions.Caching.Memory.CacheItemPriority priority) { throw null; }
114+
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions SetSize(this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, long size) { throw null; }
115+
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions SetSlidingExpiration(this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, System.TimeSpan offset) { throw null; }
116+
}
117+
public partial class MemoryCacheEntryOptions
118+
{
119+
public MemoryCacheEntryOptions() { }
120+
public System.DateTimeOffset? AbsoluteExpiration { get { throw null; } set { } }
121+
public System.TimeSpan? AbsoluteExpirationRelativeToNow { get { throw null; } set { } }
122+
public System.Collections.Generic.IList<Microsoft.Extensions.Primitives.IChangeToken> ExpirationTokens { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
123+
public System.Collections.Generic.IList<Microsoft.Extensions.Caching.Memory.PostEvictionCallbackRegistration> PostEvictionCallbacks { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
124+
public Microsoft.Extensions.Caching.Memory.CacheItemPriority Priority { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
125+
public long? Size { get { throw null; } set { } }
126+
public System.TimeSpan? SlidingExpiration { get { throw null; } set { } }
127+
}
128+
public partial class PostEvictionCallbackRegistration
129+
{
130+
public PostEvictionCallbackRegistration() { }
131+
public Microsoft.Extensions.Caching.Memory.PostEvictionDelegate EvictionCallback { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
132+
public object State { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
133+
}
134+
public delegate void PostEvictionDelegate(object key, object value, Microsoft.Extensions.Caching.Memory.EvictionReason reason, object state);
135+
}
136+
namespace Microsoft.Extensions.Internal
137+
{
138+
public partial interface ISystemClock
139+
{
140+
System.DateTimeOffset UtcNow { get; }
141+
}
142+
public partial class SystemClock : Microsoft.Extensions.Internal.ISystemClock
143+
{
144+
public SystemClock() { }
145+
public System.DateTimeOffset UtcNow { get { throw null; } }
146+
}
147+
}

src/Caching/Abstractions/src/Microsoft.Extensions.Caching.Abstractions.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
Commonly used types:
66
Microsoft.Extensions.Caching.Distributed.IDistributedCache
77
Microsoft.Extensions.Caching.Memory.IMemoryCache</Description>
8-
<TargetFramework>netstandard2.0</TargetFramework>
8+
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
9+
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">netcoreapp3.0</TargetFrameworks>
910
<NoWarn>$(NoWarn);CS1591</NoWarn>
1011
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1112
<PackageTags>cache;memorycache;distributedcache</PackageTags>
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- This file is automatically generated. -->
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
55
</PropertyGroup>
66
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
77
<Compile Include="Microsoft.Extensions.Caching.Memory.netstandard2.0.cs" />
@@ -10,4 +10,11 @@
1010
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
1111
<Reference Include="Microsoft.Extensions.Options" />
1212
</ItemGroup>
13+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
14+
<Compile Include="Microsoft.Extensions.Caching.Memory.netcoreapp3.0.cs" />
15+
<Reference Include="Microsoft.Extensions.Caching.Abstractions" />
16+
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
17+
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
18+
<Reference Include="Microsoft.Extensions.Options" />
19+
</ItemGroup>
1320
</Project>

0 commit comments

Comments
 (0)