Cleanup: Moving files from src/Microsoft.AspNet.Mvc.Razor/Razor/PreCompileViews ->
src/Microsoft.AspNet.Mvc.Razor/Precompilation
This commit is contained in:
parent
d388aa58c8
commit
9dc8ecac8a
|
|
@ -7,7 +7,7 @@ using System.Linq;
|
|||
using Microsoft.Framework.Runtime;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// An <see cref="Exception"/> thrown when accessing the result of a failed compilation.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Microsoft.Framework.Internal;
|
|||
using Microsoft.Framework.Runtime;
|
||||
using Microsoft.Framework.Runtime.Roslyn;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for <see cref="ICompilerOptionsProvider"/>.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using Microsoft.Framework.Runtime;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the result of compilation.
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNet.FileProviders;
|
||||
using Microsoft.AspNet.Mvc.Razor.Precompilation;
|
||||
using Microsoft.Framework.Caching.Memory;
|
||||
using Microsoft.Framework.Internal;
|
||||
using Microsoft.Framework.OptionsModel;
|
||||
using Microsoft.Framework.Runtime;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// Caches the result of runtime compilation of Razor files for the duration of the app lifetime.
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNet.Mvc.Razor.Precompilation;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// An entry in <see cref="ICompilerCache"/> that contain metadata about precompiled and dynamically compiled file.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// Result of <see cref="ICompilerCache"/>.
|
||||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
/// Initializes a new instance of <see cref="CompilerCacheResult"/> with the specified
|
||||
/// <see cref="CompilationResult"/>.
|
||||
/// </summary>
|
||||
/// <param name="compilationResult">The <see cref="Razor.CompilationResult"/> </param>
|
||||
/// <param name="compilationResult">The <see cref="Compilation.CompilationResult"/> </param>
|
||||
public CompilerCacheResult([NotNull] CompilationResult compilationResult)
|
||||
{
|
||||
CompilationResult = compilationResult;
|
||||
|
|
@ -34,7 +34,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Razor.CompilationResult"/>.
|
||||
/// The <see cref="Compilation.CompilationResult"/>.
|
||||
/// </summary>
|
||||
/// <remarks>This property is null when file lookup failed.</remarks>
|
||||
public CompilationResult CompilationResult { get; }
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides methods for compilation of a Razor page.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
using System;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// Caches the result of runtime compilation of Razor files for the duration of the app lifetime.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the contracts for a service that compiles Razor files.
|
||||
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
|||
using Microsoft.Framework.Runtime;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="ICompilationFailure"/> for Razor parse failures.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
|||
using Microsoft.Framework.Internal;
|
||||
using Microsoft.Framework.Runtime;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="ICompilationMessage"/> for a <see cref="RazorError"/> encountered during parsing.
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using Microsoft.AspNet.FileProviders;
|
|||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// Default implementation of <see cref="IRazorCompilationService"/>.
|
||||
|
|
@ -5,9 +5,10 @@ using System;
|
|||
using System.Globalization;
|
||||
using System.IO;
|
||||
using Microsoft.AspNet.FileProviders;
|
||||
using Microsoft.AspNet.Mvc.Razor.Internal;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
public static class RazorFileHash
|
||||
{
|
||||
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using Microsoft.AspNet.FileProviders;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// A container type that represents <see cref="IFileInfo"/> along with the application base relative path
|
||||
|
|
@ -19,7 +19,7 @@ using Microsoft.Framework.Runtime;
|
|||
using Microsoft.Framework.Runtime.Compilation;
|
||||
using Microsoft.Framework.Runtime.Roslyn;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// A type that uses Roslyn to compile C# content.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using Microsoft.CodeAnalysis.Text;
|
|||
using Microsoft.Framework.Internal;
|
||||
using Microsoft.Framework.Runtime.Roslyn;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
public static class SyntaxTreeGenerator
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
using System;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the result of compilation that does not come from the <see cref="ICompilerCache" />.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using System.IO;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Internal
|
||||
{
|
||||
internal static class Crc32
|
||||
{
|
||||
|
|
@ -8,7 +8,7 @@ using Microsoft.CodeAnalysis;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||
{
|
||||
public static class GeneratorResultExtensions
|
||||
{
|
||||
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
|||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||
{
|
||||
/// <summary>
|
||||
/// An entry in the cache used by <see cref="RazorPreCompiler"/>.
|
||||
|
|
@ -12,7 +12,7 @@ using Microsoft.Framework.Internal;
|
|||
using Microsoft.Framework.Runtime;
|
||||
using Microsoft.Framework.Runtime.Roslyn;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="TagHelperDescriptorResolver"/> used during Razor precompilation.
|
||||
|
|
@ -6,7 +6,7 @@ using Microsoft.CodeAnalysis;
|
|||
using Microsoft.CodeAnalysis.Text;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||
{
|
||||
public static class RazorErrorExtensions
|
||||
{
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||
{
|
||||
public class RazorFileInfo
|
||||
{
|
||||
|
|
@ -7,7 +7,7 @@ using System.IO;
|
|||
using System.Reflection;
|
||||
using Microsoft.Framework.Runtime;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies metadata about precompiled views.
|
||||
|
|
@ -3,12 +3,13 @@
|
|||
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using Microsoft.AspNet.Mvc.Razor.Compilation;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.Framework.Internal;
|
||||
using Microsoft.Framework.Runtime;
|
||||
using Microsoft.Framework.Runtime.Roslyn;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||
{
|
||||
public class RazorFileInfoCollectionGenerator
|
||||
{
|
||||
|
|
@ -8,6 +8,7 @@ using System.Linq;
|
|||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.FileProviders;
|
||||
using Microsoft.AspNet.Mvc.Razor.Compilation;
|
||||
using Microsoft.AspNet.Mvc.Razor.Directives;
|
||||
using Microsoft.AspNet.Mvc.Razor.Internal;
|
||||
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
|
||||
|
|
@ -18,7 +19,7 @@ using Microsoft.Framework.Internal;
|
|||
using Microsoft.Framework.Runtime;
|
||||
using Microsoft.Framework.Runtime.Roslyn;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||
{
|
||||
public class RazorPreCompiler
|
||||
{
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using Microsoft.AspNet.Mvc.Razor.Compilation;
|
||||
using Microsoft.Framework.DependencyInjection;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ using Microsoft.AspNet.Mvc.ModelBinding.Metadata;
|
|||
using Microsoft.AspNet.Mvc.ModelBinding.Validation;
|
||||
using Microsoft.AspNet.Mvc.OptionDescriptors;
|
||||
using Microsoft.AspNet.Mvc.Razor;
|
||||
using Microsoft.AspNet.Mvc.Razor.Compilation;
|
||||
using Microsoft.AspNet.Mvc.Razor.Directives;
|
||||
using Microsoft.AspNet.Mvc.Razor.OptionDescriptors;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
|
|
@ -81,8 +82,8 @@ namespace Microsoft.AspNet.Mvc
|
|||
// Dataflow - ModelBinding, Validation and Formatting
|
||||
//
|
||||
// The DefaultModelMetadataProvider does significant caching and should be a singleton.
|
||||
services.AddSingleton<ModelBinding.IModelMetadataProvider, DefaultModelMetadataProvider>();
|
||||
services.AddTransient<ModelBinding.Metadata.ICompositeMetadataDetailsProvider>(serviceProvider =>
|
||||
services.AddSingleton<IModelMetadataProvider, DefaultModelMetadataProvider>();
|
||||
services.AddTransient<ICompositeMetadataDetailsProvider>(serviceProvider =>
|
||||
{
|
||||
var options = serviceProvider.GetRequiredService<IOptions<MvcOptions>>().Options;
|
||||
return new DefaultCompositeMetadataDetailsProvider(options.ModelMetadataDetailsProviders);
|
||||
|
|
@ -156,7 +157,7 @@ namespace Microsoft.AspNet.Mvc
|
|||
// These do caching so they should stay singleton
|
||||
services.AddSingleton<IViewComponentSelector, DefaultViewComponentSelector>();
|
||||
services.AddSingleton<IViewComponentActivator, DefaultViewComponentActivator>();
|
||||
services.AddSingleton<IViewComponentDescriptorCollectionProvider,
|
||||
services.AddSingleton<IViewComponentDescriptorCollectionProvider,
|
||||
DefaultViewComponentDescriptorCollectionProvider>();
|
||||
|
||||
services.AddTransient<IViewComponentDescriptorProvider, DefaultViewComponentDescriptorProvider>();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using System;
|
||||
using Microsoft.AspNet.FileProviders;
|
||||
using Microsoft.AspNet.Mvc.Razor;
|
||||
using Microsoft.AspNet.Mvc.Razor.Precompilation;
|
||||
using Microsoft.Framework.Caching.Memory;
|
||||
using Microsoft.Framework.DependencyInjection;
|
||||
using Microsoft.Framework.Runtime;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using System.Reflection;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Mvc.Razor;
|
||||
using Microsoft.AspNet.Mvc.Razor.Precompilation;
|
||||
using Microsoft.Framework.DependencyInjection;
|
||||
using Microsoft.Framework.Runtime;
|
||||
using PrecompilationWebSite;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Microsoft.Framework.Runtime;
|
|||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Test
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
public class CompilationResultTest
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,11 +9,13 @@ using System.Linq;
|
|||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Microsoft.AspNet.FileProviders;
|
||||
using Microsoft.AspNet.Mvc.Razor.Internal;
|
||||
using Microsoft.AspNet.Mvc.Razor.Precompilation;
|
||||
using Microsoft.Framework.Runtime;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
public class CompilerCacheTest
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ using Microsoft.AspNet.Razor.TagHelpers;
|
|||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Test
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
public class RazorCompilationServiceTest
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ using Microsoft.Framework.Runtime.Compilation;
|
|||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
public class RoslynCompilationServiceTest
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ using Microsoft.AspNet.Testing;
|
|||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
||||
{
|
||||
public class RazorFileHashTest
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Razor;
|
||||
using Microsoft.AspNet.Mvc.Razor.Compilation;
|
||||
using Microsoft.Framework.OptionsModel;
|
||||
using Microsoft.Framework.Runtime;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Mvc.Razor;
|
||||
using Microsoft.AspNet.Mvc.Razor.Compilation;
|
||||
using Microsoft.Framework.DependencyInjection;
|
||||
|
||||
namespace RazorCompilerCacheWebSite
|
||||
|
|
|
|||
Loading…
Reference in New Issue