-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from espertechinc/hotfix-8.5.7
Addressing compile & runtime issues for plugin-style assemblies
- Loading branch information
Showing
69 changed files
with
435 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/NEsper.Common/common/client/artifact/MetadataReferenceProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
using com.espertech.esper.common.@internal.util; | ||
using com.espertech.esper.compat; | ||
using com.espertech.esper.compat.collections; | ||
|
||
#if NETCOREAPP3_0_OR_GREATER | ||
using System.Runtime.Loader; | ||
#endif | ||
|
||
using com.espertech.esper.container; | ||
|
||
using Microsoft.CodeAnalysis; | ||
|
||
namespace com.espertech.esper.common.client.artifact | ||
{ | ||
public delegate IEnumerable<MetadataReference> MetadataReferenceProvider(); | ||
} |
32 changes: 32 additions & 0 deletions
32
src/NEsper.Common/common/client/artifact/MetadataReferenceProviderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
|
||
using com.espertech.esper.common.@internal.util; | ||
using com.espertech.esper.compat; | ||
using com.espertech.esper.compat.collections; | ||
|
||
#if NETCOREAPP3_0_OR_GREATER | ||
using System.Runtime.Loader; | ||
#endif | ||
|
||
using com.espertech.esper.container; | ||
|
||
using Microsoft.CodeAnalysis; | ||
|
||
namespace com.espertech.esper.common.client.artifact | ||
{ | ||
public static class MetadataReferenceProviderExtensions | ||
{ | ||
public static MetadataReferenceProvider MetadataReferenceProvider(this IContainer container) | ||
{ | ||
container.CheckContainer(); | ||
|
||
lock (container) { | ||
if (container.DoesNotHave<MetadataReferenceProvider>()) { | ||
container.Register<MetadataReferenceProvider>(Array.Empty<MetadataReference>, Lifespan.Singleton); | ||
} | ||
} | ||
|
||
return container.Resolve<MetadataReferenceProvider>(); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/NEsper.Common/common/client/artifact/MetadataReferenceResolver.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
|
||
using com.espertech.esper.common.@internal.util; | ||
using com.espertech.esper.compat; | ||
using com.espertech.esper.compat.collections; | ||
|
||
#if NETCOREAPP3_0_OR_GREATER | ||
using System.Runtime.Loader; | ||
#endif | ||
|
||
using com.espertech.esper.container; | ||
|
||
using Microsoft.CodeAnalysis; | ||
|
||
namespace com.espertech.esper.common.client.artifact | ||
{ | ||
public delegate MetadataReference MetadataReferenceResolver(Assembly assembly); | ||
} |
41 changes: 41 additions & 0 deletions
41
src/NEsper.Common/common/client/artifact/MetadataReferenceResolverExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System.Reflection; | ||
|
||
using com.espertech.esper.container; | ||
|
||
using Microsoft.CodeAnalysis; | ||
|
||
namespace com.espertech.esper.common.client.artifact | ||
{ | ||
public static class MetadataReferenceResolverExtensions | ||
{ | ||
/// <summary> | ||
/// Gets a metadata reference from an assembly. This method provides no caching of the metadata | ||
/// reference. | ||
/// </summary> | ||
/// <param name="assembly"></param> | ||
/// <returns>a metadata reference for the requested assembly</returns> | ||
public static MetadataReference GetMetadataReference(Assembly assembly) | ||
{ | ||
return string.IsNullOrEmpty(assembly.Location) ? null : MetadataReference.CreateFromFile(assembly.Location); | ||
} | ||
|
||
/// <summary> | ||
/// Retrieves an instance of the MetadataReferenceResolver. If none has been registered, this method | ||
/// will return the default resolver. | ||
/// </summary> | ||
/// <param name="container"></param> | ||
/// <returns></returns> | ||
public static MetadataReferenceResolver MetadataReferenceResolver(this IContainer container) | ||
{ | ||
container.CheckContainer(); | ||
|
||
lock (container) { | ||
if (container.DoesNotHave<MetadataReferenceResolver>()) { | ||
return GetMetadataReference; | ||
} | ||
} | ||
|
||
return container.Resolve<MetadataReferenceResolver>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.