Skip to content

Commit 1c4fa06

Browse files
committed
Weaver: netstandard -> netcore
1 parent 38fd7ec commit 1c4fa06

5 files changed

Lines changed: 156 additions & 152 deletions

File tree

Weaver/Xtensive.Orm.Weaver/AssemblyChecker.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ namespace Xtensive.Orm.Weaver
1212
public sealed class AssemblyChecker
1313
{
1414
private readonly Dictionary<string, byte[]> frameworkAssemblies = new Dictionary<string, byte[]>(WeavingHelper.AssemblyNameComparer);
15-
private readonly Dictionary<string, byte[]> netStandardAssemblies = new Dictionary<string, byte[]>(WeavingHelper.AssemblyNameComparer);
15+
private readonly Dictionary<string, byte[]> netCoreAssemblies = new Dictionary<string, byte[]>(WeavingHelper.AssemblyNameComparer);
1616

1717

1818
public void RegisterFrameworkAssembly(string name, string publicKeyToken)
1919
{
2020
frameworkAssemblies.Add(name, WeavingHelper.ParsePublicKeyToken(publicKeyToken));
2121
}
2222

23-
public void RegisterNetStandardAssembly(string name, string publicKeyToken)
23+
public void RegisterNetCoreAssembly(string name, string publicKeyToken)
2424
{
25-
netStandardAssemblies.Add(name, WeavingHelper.ParsePublicKeyToken(publicKeyToken));
25+
netCoreAssemblies.Add(name, WeavingHelper.ParsePublicKeyToken(publicKeyToken));
2626
}
2727

2828
public bool IsFrameworkAssembly(AssemblyNameReference reference)
@@ -31,10 +31,10 @@ public bool IsFrameworkAssembly(AssemblyNameReference reference)
3131
return frameworkAssemblies.TryGetValue(reference.Name, out expectedToken) && reference.HasPublicKeyToken(expectedToken);
3232
}
3333

34-
public bool IsNetStandardAssembly(AssemblyNameReference reference)
34+
public bool IsNetCoreAssembly(AssemblyNameReference reference)
3535
{
3636
byte[] expectedToken;
37-
return netStandardAssemblies.TryGetValue(reference.Name, out expectedToken) && reference.HasPublicKeyToken(expectedToken);
37+
return netCoreAssemblies.TryGetValue(reference.Name, out expectedToken) && reference.HasPublicKeyToken(expectedToken);
3838
}
3939
}
4040
}

Weaver/Xtensive.Orm.Weaver/AssemblyProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private IEnumerable<ProcessorStage> GetStages()
5757
new LoadAssemblyStage(),
5858
new ImportReferencesStage(),
5959
new RegisterFrameworkAssembliesStage(),
60-
new RegisterNetStandardAssembliesStage(),
60+
new RegisterNetCoreAssembliesStage(),
6161
new FindPersistentTypesStage(),
6262
new ModifyPersistentTypesStage(),
6363
new MarkAssemblyStage(),
Lines changed: 127 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,128 @@
1-
namespace Xtensive.Orm.Weaver
2-
{
3-
internal static class NetStandardAssemblyList
4-
{
5-
public static string[] Get()
6-
{
7-
return new[] {
8-
"Microsoft.Win32.Primitives b03f5f7f11d50a3a",
9-
"mscorlib b77a5c561934e089",
10-
"netstandard cc7b13ffcd2ddd51",
11-
"System.AppContext b03f5f7f11d50a3a",
12-
"System.Collections.Concurrent b03f5f7f11d50a3a",
13-
"System.Collections b03f5f7f11d50a3a",
14-
"System.Collections.NonGeneric b03f5f7f11d50a3a",
15-
"System.Collections.Specialized b03f5f7f11d50a3a",
16-
"System.ComponentModel.Composition b77a5c561934e089",
17-
"System.ComponentModel b03f5f7f11d50a3a",
18-
"System.ComponentModel.EventBasedAsync b03f5f7f11d50a3a",
19-
"System.ComponentModel.Primitives b03f5f7f11d50a3a",
20-
"System.ComponentModel.TypeConverter b03f5f7f11d50a3a",
21-
"System.Console b03f5f7f11d50a3a",
22-
"System.Core b77a5c561934e089",
23-
"System.Data.Common b03f5f7f11d50a3a",
24-
"System.Data b77a5c561934e089",
25-
"System.Diagnostics.Contracts b03f5f7f11d50a3a",
26-
"System.Diagnostics.Debug b03f5f7f11d50a3a",
27-
"System.Diagnostics.FileVersionInfo b03f5f7f11d50a3a",
28-
"System.Diagnostics.Process b03f5f7f11d50a3a",
29-
"System.Diagnostics.StackTrace b03f5f7f11d50a3a",
30-
"System.Diagnostics.TextWriterTraceListener b03f5f7f11d50a3a",
31-
"System.Diagnostics.Tools b03f5f7f11d50a3a",
32-
"System.Diagnostics.TraceSource b03f5f7f11d50a3a",
33-
"System.Diagnostics.Tracing b03f5f7f11d50a3a",
34-
"System b77a5c561934e089",
35-
"System.Drawing b03f5f7f11d50a3a",
36-
"System.Drawing.Primitives b03f5f7f11d50a3a",
37-
"System.Dynamic.Runtime b03f5f7f11d50a3a",
38-
"System.Globalization.Calendars b03f5f7f11d50a3a",
39-
"System.Globalization b03f5f7f11d50a3a",
40-
"System.Globalization.Extensions b03f5f7f11d50a3a",
41-
"System.IO.Compression b77a5c561934e089",
42-
"System.IO.Compression.FileSystem b77a5c561934e089",
43-
"System.IO.Compression.ZipFile b77a5c561934e089",
44-
"System.IO b03f5f7f11d50a3a",
45-
"System.IO.FileSystem b03f5f7f11d50a3a",
46-
"System.IO.FileSystem.DriveInfo b03f5f7f11d50a3a",
47-
"System.IO.FileSystem.Primitives b03f5f7f11d50a3a",
48-
"System.IO.FileSystem.Watcher b03f5f7f11d50a3a",
49-
"System.IO.IsolatedStorage b03f5f7f11d50a3a",
50-
"System.IO.MemoryMappedFiles b03f5f7f11d50a3a",
51-
"System.IO.Pipes b03f5f7f11d50a3a",
52-
"System.IO.UnmanagedMemoryStream b03f5f7f11d50a3a",
53-
"System.Linq b03f5f7f11d50a3a",
54-
"System.Linq.Expressions b03f5f7f11d50a3a",
55-
"System.Linq.Parallel b03f5f7f11d50a3a",
56-
"System.Linq.Queryable b03f5f7f11d50a3a",
57-
"System.Net b03f5f7f11d50a3a",
58-
"System.Net.Http b03f5f7f11d50a3a",
59-
"System.Net.NameResolution b03f5f7f11d50a3a",
60-
"System.Net.NetworkInformation b03f5f7f11d50a3a",
61-
"System.Net.Ping b03f5f7f11d50a3a",
62-
"System.Net.Primitives b03f5f7f11d50a3a",
63-
"System.Net.Requests b03f5f7f11d50a3a",
64-
"System.Net.Security b03f5f7f11d50a3a",
65-
"System.Net.Sockets b03f5f7f11d50a3a",
66-
"System.Net.WebHeaderCollection b03f5f7f11d50a3a",
67-
"System.Net.WebSockets.Client b03f5f7f11d50a3a",
68-
"System.Net.WebSockets b03f5f7f11d50a3a",
69-
"System.Numerics b77a5c561934e089",
70-
"System.ObjectModel b03f5f7f11d50a3a",
71-
"System.Reflection b03f5f7f11d50a3a",
72-
"System.Reflection.Extensions b03f5f7f11d50a3a",
73-
"System.Reflection.Primitives b03f5f7f11d50a3a",
74-
"System.Resources.Reader b03f5f7f11d50a3a",
75-
"System.Resources.ResourceManager b03f5f7f11d50a3a",
76-
"System.Resources.Writer b03f5f7f11d50a3a",
77-
"System.Runtime.CompilerServices.VisualC b03f5f7f11d50a3a",
78-
"System.Runtime b03f5f7f11d50a3a",
79-
"System.Runtime.Extensions b03f5f7f11d50a3a",
80-
"System.Runtime.Handles b03f5f7f11d50a3a",
81-
"System.Runtime.InteropServices b03f5f7f11d50a3a",
82-
"System.Runtime.InteropServices.RuntimeInformation b03f5f7f11d50a3a",
83-
"System.Runtime.Numerics b03f5f7f11d50a3a",
84-
"System.Runtime.Serialization b77a5c561934e089",
85-
"System.Runtime.Serialization.Formatters b03f5f7f11d50a3a",
86-
"System.Runtime.Serialization.Json b03f5f7f11d50a3a",
87-
"System.Runtime.Serialization.Primitives b03f5f7f11d50a3a",
88-
"System.Runtime.Serialization.Xml b03f5f7f11d50a3a",
89-
"System.Security.Claims b03f5f7f11d50a3a",
90-
"System.Security.Cryptography.Algorithms b03f5f7f11d50a3a",
91-
"System.Security.Cryptography.Csp b03f5f7f11d50a3a",
92-
"System.Security.Cryptography.Encoding b03f5f7f11d50a3a",
93-
"System.Security.Cryptography.Primitives b03f5f7f11d50a3a",
94-
"System.Security.Cryptography.X509Certificates b03f5f7f11d50a3a",
95-
"System.Security.Principal b03f5f7f11d50a3a",
96-
"System.Security.SecureString b03f5f7f11d50a3a",
97-
"System.ServiceModel.Web 31bf3856ad364e35",
98-
"System.Text.Encoding b03f5f7f11d50a3a",
99-
"System.Text.Encoding.Extensions b03f5f7f11d50a3a",
100-
"System.Text.RegularExpressions b03f5f7f11d50a3a",
101-
"System.Threading b03f5f7f11d50a3a",
102-
"System.Threading.Overlapped b03f5f7f11d50a3a",
103-
"System.Threading.Tasks b03f5f7f11d50a3a",
104-
"System.Threading.Tasks.Parallel b03f5f7f11d50a3a",
105-
"System.Threading.Thread b03f5f7f11d50a3a",
106-
"System.Threading.ThreadPool b03f5f7f11d50a3a",
107-
"System.Threading.Timer b03f5f7f11d50a3a",
108-
"System.Transactions b77a5c561934e089",
109-
"System.ValueTuple cc7b13ffcd2ddd51",
110-
"System.Web b03f5f7f11d50a3a",
111-
"System.Windows b03f5f7f11d50a3a",
112-
"System.Xml b77a5c561934e089",
113-
"System.Xml.Linq b77a5c561934e089",
114-
"System.Xml.ReaderWriter b03f5f7f11d50a3a",
115-
"System.Xml.Serialization b77a5c561934e089",
116-
"System.Xml.XDocument b03f5f7f11d50a3a",
117-
"System.Xml.XmlDocument b03f5f7f11d50a3a",
118-
"System.Xml.XmlSerializer b03f5f7f11d50a3a",
119-
"System.Xml.XPath b03f5f7f11d50a3a",
120-
"System.Xml.XPath.XDocument b03f5f7f11d50a3a",
121-
};
122-
}
123-
}
1+
// Copyright (C) 2018-2020 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
4+
5+
namespace Xtensive.Orm.Weaver
6+
{
7+
internal static class NetCoreAssemblyList
8+
{
9+
public static string[] Get()
10+
{
11+
return new[] {
12+
"Microsoft.Win32.Primitives b03f5f7f11d50a3a",
13+
"mscorlib b77a5c561934e089",
14+
"netstandard cc7b13ffcd2ddd51",
15+
"System.AppContext b03f5f7f11d50a3a",
16+
"System.Collections.Concurrent b03f5f7f11d50a3a",
17+
"System.Collections b03f5f7f11d50a3a",
18+
"System.Collections.NonGeneric b03f5f7f11d50a3a",
19+
"System.Collections.Specialized b03f5f7f11d50a3a",
20+
"System.ComponentModel.Composition b77a5c561934e089",
21+
"System.ComponentModel b03f5f7f11d50a3a",
22+
"System.ComponentModel.EventBasedAsync b03f5f7f11d50a3a",
23+
"System.ComponentModel.Primitives b03f5f7f11d50a3a",
24+
"System.ComponentModel.TypeConverter b03f5f7f11d50a3a",
25+
"System.Console b03f5f7f11d50a3a",
26+
"System.Core b77a5c561934e089",
27+
"System.Data.Common b03f5f7f11d50a3a",
28+
"System.Data b77a5c561934e089",
29+
"System.Diagnostics.Contracts b03f5f7f11d50a3a",
30+
"System.Diagnostics.Debug b03f5f7f11d50a3a",
31+
"System.Diagnostics.FileVersionInfo b03f5f7f11d50a3a",
32+
"System.Diagnostics.Process b03f5f7f11d50a3a",
33+
"System.Diagnostics.StackTrace b03f5f7f11d50a3a",
34+
"System.Diagnostics.TextWriterTraceListener b03f5f7f11d50a3a",
35+
"System.Diagnostics.Tools b03f5f7f11d50a3a",
36+
"System.Diagnostics.TraceSource b03f5f7f11d50a3a",
37+
"System.Diagnostics.Tracing b03f5f7f11d50a3a",
38+
"System b77a5c561934e089",
39+
"System.Drawing b03f5f7f11d50a3a",
40+
"System.Drawing.Primitives b03f5f7f11d50a3a",
41+
"System.Dynamic.Runtime b03f5f7f11d50a3a",
42+
"System.Globalization.Calendars b03f5f7f11d50a3a",
43+
"System.Globalization b03f5f7f11d50a3a",
44+
"System.Globalization.Extensions b03f5f7f11d50a3a",
45+
"System.IO.Compression b77a5c561934e089",
46+
"System.IO.Compression.FileSystem b77a5c561934e089",
47+
"System.IO.Compression.ZipFile b77a5c561934e089",
48+
"System.IO b03f5f7f11d50a3a",
49+
"System.IO.FileSystem b03f5f7f11d50a3a",
50+
"System.IO.FileSystem.DriveInfo b03f5f7f11d50a3a",
51+
"System.IO.FileSystem.Primitives b03f5f7f11d50a3a",
52+
"System.IO.FileSystem.Watcher b03f5f7f11d50a3a",
53+
"System.IO.IsolatedStorage b03f5f7f11d50a3a",
54+
"System.IO.MemoryMappedFiles b03f5f7f11d50a3a",
55+
"System.IO.Pipes b03f5f7f11d50a3a",
56+
"System.IO.UnmanagedMemoryStream b03f5f7f11d50a3a",
57+
"System.Linq b03f5f7f11d50a3a",
58+
"System.Linq.Expressions b03f5f7f11d50a3a",
59+
"System.Linq.Parallel b03f5f7f11d50a3a",
60+
"System.Linq.Queryable b03f5f7f11d50a3a",
61+
"System.Net b03f5f7f11d50a3a",
62+
"System.Net.Http b03f5f7f11d50a3a",
63+
"System.Net.NameResolution b03f5f7f11d50a3a",
64+
"System.Net.NetworkInformation b03f5f7f11d50a3a",
65+
"System.Net.Ping b03f5f7f11d50a3a",
66+
"System.Net.Primitives b03f5f7f11d50a3a",
67+
"System.Net.Requests b03f5f7f11d50a3a",
68+
"System.Net.Security b03f5f7f11d50a3a",
69+
"System.Net.Sockets b03f5f7f11d50a3a",
70+
"System.Net.WebHeaderCollection b03f5f7f11d50a3a",
71+
"System.Net.WebSockets.Client b03f5f7f11d50a3a",
72+
"System.Net.WebSockets b03f5f7f11d50a3a",
73+
"System.Numerics b77a5c561934e089",
74+
"System.ObjectModel b03f5f7f11d50a3a",
75+
"System.Reflection b03f5f7f11d50a3a",
76+
"System.Reflection.Extensions b03f5f7f11d50a3a",
77+
"System.Reflection.Primitives b03f5f7f11d50a3a",
78+
"System.Resources.Reader b03f5f7f11d50a3a",
79+
"System.Resources.ResourceManager b03f5f7f11d50a3a",
80+
"System.Resources.Writer b03f5f7f11d50a3a",
81+
"System.Runtime.CompilerServices.VisualC b03f5f7f11d50a3a",
82+
"System.Runtime b03f5f7f11d50a3a",
83+
"System.Runtime.Extensions b03f5f7f11d50a3a",
84+
"System.Runtime.Handles b03f5f7f11d50a3a",
85+
"System.Runtime.InteropServices b03f5f7f11d50a3a",
86+
"System.Runtime.InteropServices.RuntimeInformation b03f5f7f11d50a3a",
87+
"System.Runtime.Numerics b03f5f7f11d50a3a",
88+
"System.Runtime.Serialization b77a5c561934e089",
89+
"System.Runtime.Serialization.Formatters b03f5f7f11d50a3a",
90+
"System.Runtime.Serialization.Json b03f5f7f11d50a3a",
91+
"System.Runtime.Serialization.Primitives b03f5f7f11d50a3a",
92+
"System.Runtime.Serialization.Xml b03f5f7f11d50a3a",
93+
"System.Security.Claims b03f5f7f11d50a3a",
94+
"System.Security.Cryptography.Algorithms b03f5f7f11d50a3a",
95+
"System.Security.Cryptography.Csp b03f5f7f11d50a3a",
96+
"System.Security.Cryptography.Encoding b03f5f7f11d50a3a",
97+
"System.Security.Cryptography.Primitives b03f5f7f11d50a3a",
98+
"System.Security.Cryptography.X509Certificates b03f5f7f11d50a3a",
99+
"System.Security.Principal b03f5f7f11d50a3a",
100+
"System.Security.SecureString b03f5f7f11d50a3a",
101+
"System.ServiceModel.Web 31bf3856ad364e35",
102+
"System.Text.Encoding b03f5f7f11d50a3a",
103+
"System.Text.Encoding.Extensions b03f5f7f11d50a3a",
104+
"System.Text.RegularExpressions b03f5f7f11d50a3a",
105+
"System.Threading b03f5f7f11d50a3a",
106+
"System.Threading.Overlapped b03f5f7f11d50a3a",
107+
"System.Threading.Tasks b03f5f7f11d50a3a",
108+
"System.Threading.Tasks.Parallel b03f5f7f11d50a3a",
109+
"System.Threading.Thread b03f5f7f11d50a3a",
110+
"System.Threading.ThreadPool b03f5f7f11d50a3a",
111+
"System.Threading.Timer b03f5f7f11d50a3a",
112+
"System.Transactions b77a5c561934e089",
113+
"System.ValueTuple cc7b13ffcd2ddd51",
114+
"System.Web b03f5f7f11d50a3a",
115+
"System.Windows b03f5f7f11d50a3a",
116+
"System.Xml b77a5c561934e089",
117+
"System.Xml.Linq b77a5c561934e089",
118+
"System.Xml.ReaderWriter b03f5f7f11d50a3a",
119+
"System.Xml.Serialization b77a5c561934e089",
120+
"System.Xml.XDocument b03f5f7f11d50a3a",
121+
"System.Xml.XmlDocument b03f5f7f11d50a3a",
122+
"System.Xml.XmlSerializer b03f5f7f11d50a3a",
123+
"System.Xml.XPath b03f5f7f11d50a3a",
124+
"System.Xml.XPath.XDocument b03f5f7f11d50a3a",
125+
};
126+
}
127+
}
124128
}

Weaver/Xtensive.Orm.Weaver/Stages/FindPersistentTypesStage.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Copyright (C) 2013 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2013-2020 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
55
// Created: 2013.08.19
66

@@ -91,7 +91,7 @@ private TypeInfo InspectType(ProcessorContext context, TypeReference type)
9191
// because ModuleReference contains only name of Module.
9292
throw new InvalidOperationException("Unable to inspect ModuleReference");
9393
}
94-
if (context.AssemblyChecker.IsFrameworkAssembly(reference) || context.AssemblyChecker.IsNetStandardAssembly(reference)) {
94+
if (context.AssemblyChecker.IsFrameworkAssembly(reference) || context.AssemblyChecker.IsNetCoreAssembly(reference)) {
9595
var result = new TypeInfo(type, PersistentTypeKind.None);
9696
processedTypes.Add(identity, result);
9797
return result;

Weaver/Xtensive.Orm.Weaver/Stages/RegisterNetStandardAssembliesStage.cs renamed to Weaver/Xtensive.Orm.Weaver/Stages/RegisterNetCoreAssembliesStage.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
// Copyright (C) 2013 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
4-
// Created by: Denis Krjuchkov
5-
// Created: 2018.05.31
6-
7-
namespace Xtensive.Orm.Weaver.Stages
8-
{
9-
internal sealed class RegisterNetStandardAssembliesStage : ProcessorStage
10-
{
11-
public override ActionResult Execute(ProcessorContext context)
12-
{
13-
foreach (var assembly in NetStandardAssemblyList.Get()) {
14-
var items = assembly.Split();
15-
context.AssemblyChecker.RegisterNetStandardAssembly(items[0], items[1]);
16-
}
17-
return ActionResult.Success;
18-
}
19-
}
1+
// Copyright (C) 2013 Xtensive LLC.
2+
// All rights reserved.
3+
// For conditions of distribution and use, see license.
4+
// Created by: Denis Krjuchkov
5+
// Created: 2018.05.31
6+
7+
namespace Xtensive.Orm.Weaver.Stages
8+
{
9+
internal sealed class RegisterNetCoreAssembliesStage : ProcessorStage
10+
{
11+
public override ActionResult Execute(ProcessorContext context)
12+
{
13+
foreach (var assembly in NetCoreAssemblyList.Get()) {
14+
var items = assembly.Split();
15+
context.AssemblyChecker.RegisterNetCoreAssembly(items[0], items[1]);
16+
}
17+
return ActionResult.Success;
18+
}
19+
}
2020
}

0 commit comments

Comments
 (0)