React to ICompileModule change
This commit is contained in:
parent
53f3a91f01
commit
bca294e6e8
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||||
public class PrecompilationTagHelperTypeResolver : TagHelperTypeResolver
|
public class PrecompilationTagHelperTypeResolver : TagHelperTypeResolver
|
||||||
{
|
{
|
||||||
private static readonly string TagHelperTypeName = typeof(ITagHelper).FullName;
|
private static readonly string TagHelperTypeName = typeof(ITagHelper).FullName;
|
||||||
private readonly IBeforeCompileContext _compileContext;
|
private readonly BeforeCompileContext _compileContext;
|
||||||
private readonly IAssemblyLoadContext _loadContext;
|
private readonly IAssemblyLoadContext _loadContext;
|
||||||
private object _compilationLock = new object();
|
private object _compilationLock = new object();
|
||||||
private bool _assemblyEmited;
|
private bool _assemblyEmited;
|
||||||
|
|
@ -29,9 +29,9 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of <see cref="PrecompilationTagHelperTypeResolver"/>.
|
/// Initializes a new instance of <see cref="PrecompilationTagHelperTypeResolver"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="compileContext">The <see cref="IBeforeCompileContext"/>.</param>
|
/// <param name="compileContext">The <see cref="BeforeCompileContext"/>.</param>
|
||||||
/// <param name="loadContext">The <see cref="IAssemblyLoadContext"/>.</param>
|
/// <param name="loadContext">The <see cref="IAssemblyLoadContext"/>.</param>
|
||||||
public PrecompilationTagHelperTypeResolver([NotNull] IBeforeCompileContext compileContext,
|
public PrecompilationTagHelperTypeResolver([NotNull] BeforeCompileContext compileContext,
|
||||||
[NotNull] IAssemblyLoadContext loadContext)
|
[NotNull] IAssemblyLoadContext loadContext)
|
||||||
{
|
{
|
||||||
_compileContext = compileContext;
|
_compileContext = compileContext;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||||
public class RazorPreCompiler
|
public class RazorPreCompiler
|
||||||
{
|
{
|
||||||
public RazorPreCompiler(
|
public RazorPreCompiler(
|
||||||
[NotNull] IBeforeCompileContext compileContext,
|
[NotNull] BeforeCompileContext compileContext,
|
||||||
[NotNull] IAssemblyLoadContextAccessor loadContextAccessor,
|
[NotNull] IAssemblyLoadContextAccessor loadContextAccessor,
|
||||||
[NotNull] IFileProvider fileProvider,
|
[NotNull] IFileProvider fileProvider,
|
||||||
[NotNull] IMemoryCache precompilationCache,
|
[NotNull] IMemoryCache precompilationCache,
|
||||||
|
|
@ -45,7 +45,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||||
|
|
||||||
protected IFileProvider FileProvider { get; }
|
protected IFileProvider FileProvider { get; }
|
||||||
|
|
||||||
protected IBeforeCompileContext CompileContext { get; }
|
protected BeforeCompileContext CompileContext { get; }
|
||||||
|
|
||||||
protected IAssemblyLoadContext LoadContext { get; }
|
protected IAssemblyLoadContext LoadContext { get; }
|
||||||
|
|
||||||
|
|
@ -62,7 +62,6 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||||
public virtual void CompileViews()
|
public virtual void CompileViews()
|
||||||
{
|
{
|
||||||
var result = CreateFileInfoCollection();
|
var result = CreateFileInfoCollection();
|
||||||
|
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
var collectionGenerator = new RazorFileInfoCollectionGenerator(
|
var collectionGenerator = new RazorFileInfoCollectionGenerator(
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <remarks>Pre-compiles all Razor views in the application.</remarks>
|
/// <remarks>Pre-compiles all Razor views in the application.</remarks>
|
||||||
public virtual void BeforeCompile(IBeforeCompileContext context)
|
public virtual void BeforeCompile(BeforeCompileContext context)
|
||||||
{
|
{
|
||||||
var compilerOptionsProvider = _appServices.GetRequiredService<ICompilerOptionsProvider>();
|
var compilerOptionsProvider = _appServices.GetRequiredService<ICompilerOptionsProvider>();
|
||||||
var loadContextAccessor = _appServices.GetRequiredService<IAssemblyLoadContextAccessor>();
|
var loadContextAccessor = _appServices.GetRequiredService<IAssemblyLoadContextAccessor>();
|
||||||
|
|
@ -61,13 +61,13 @@ namespace Microsoft.AspNet.Mvc
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void AfterCompile(IAfterCompileContext context)
|
public void AfterCompile(AfterCompileContext context)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CompilationSettings GetCompilationSettings(
|
private static CompilationSettings GetCompilationSettings(
|
||||||
ICompilerOptionsProvider compilerOptionsProvider,
|
ICompilerOptionsProvider compilerOptionsProvider,
|
||||||
IProjectContext projectContext)
|
ProjectContext projectContext)
|
||||||
{
|
{
|
||||||
return compilerOptionsProvider.GetCompilerOptions(projectContext.Name,
|
return compilerOptionsProvider.GetCompilerOptions(projectContext.Name,
|
||||||
projectContext.TargetFramework,
|
projectContext.TargetFramework,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue