public ModelTypesLocator( [NotNull]ILibraryExporter libraryExporter, [NotNull]IApplicationEnvironment application) { _libraryExporter = libraryExporter; _application = application; }
public static string GetResolvedPathForDependency(this ILibraryExporter _libraryExporter, LibraryDescription library) { if (library == null) { throw new ArgumentNullException(nameof(library)); } var exports = _libraryExporter.GetAllExports(); var assets = exports .SelectMany(export => GetAssets(export.RuntimeAssemblyGroups)) .Where(asset => asset.Name == library.Identity.Name); if (assets.Any()) { return(assets.First().ResolvedPath); } assets = exports .SelectMany(export => GetAssets(export.NativeLibraryGroups)) .Where(asset => asset.Name == library.Identity.Name); if (assets.Any()) { return(assets.First().ResolvedPath); } assets = exports .SelectMany(export => export.CompilationAssemblies) .Where(asset => asset.Name == library.Identity.Name); if (assets.Any()) { return(assets.First().ResolvedPath); } return(string.Empty); }
public ModelTypesLocator( [NotNull] ILibraryExporter libraryExporter, [NotNull] IApplicationEnvironment application) { _libraryExporter = libraryExporter; _application = application; }
public RoslynCompilationService(IApplicationEnvironment environment, IAssemblyLoadContextAccessor accessor, ILibraryExporter libraryExporter) { _environment = environment; _loader = accessor.GetLoadContext(typeof(RoslynCompilationService).GetTypeInfo().Assembly); _libraryExporter = libraryExporter; }
public OrchardLibraryManager(ILibraryManager libraryManager, ILibraryExporter libraryExporter) { _libraryManager = libraryManager; _libraryExporter = libraryExporter; AdditionalLibraries = new List <Library>(); AdditionalLibraryExportRegistrations = new Dictionary <string, LibraryExport>(); MetadataReferences = new List <IMetadataReference>(); }
public OrchardLibraryManager(ILibraryManager libraryManager, ILibraryExporter libraryExporter) { _libraryManager = libraryManager; _libraryExporter = libraryExporter; AdditionalLibraries = new List<Library>(); AdditionalLibraryExportRegistrations = new Dictionary<string, LibraryExport>(); MetadataReferences = new List<IMetadataReference>(); }
public static IEnumerable <Assembly> GetProjectAssemblies( [NotNull] this ILibraryExporter libraryExporter, [NotNull] ILibraryManager libraryManager, [NotNull] IApplicationEnvironment environment) { return(libraryExporter .GetProjectsInApp(environment) .Select(comp => libraryManager.GetLibrary(comp.Compilation.AssemblyName)) .Select(lib => LoadAssembly(lib.Name))); }
public static IEnumerable <CompilationReference> GetProjectsInApp( [NotNull] this ILibraryExporter libraryExporter, [NotNull] IApplicationEnvironment environment) { var export = libraryExporter.GetAllExports(environment.ApplicationName); return(export.MetadataReferences .OfType <IMetadataProjectReference>() .OfType <IRoslynMetadataReference>() .Select(reference => reference.MetadataReference as CompilationReference) .Where(compilation => !_frameworkProjectNames.Contains(compilation.Compilation.AssemblyName))); }
public static Type GetReflectionType( [NotNull] this ILibraryExporter libraryExporter, [NotNull] ILibraryManager libraryManager, [NotNull] IApplicationEnvironment environment, string name) { return(libraryExporter .GetProjectAssemblies(libraryManager, environment) .Select(asm => asm.GetType(name)) .Where(type => type != null) .FirstOrDefault()); }
/// <summary> /// Initalizes a new instance of the <see cref="DnxRoslynCompilationService"/> class. /// </summary> /// <param name="environment">The environment for the executing application.</param> /// <param name="libraryManager">The <see cref="IOrchardLibraryManager"/>.</param> /// <param name="libraryExporter">The library manager that provides export and reference information.</param> /// <param name="optionsAccessor">Accessor to <see cref="RazorViewEngineOptions"/>.</param> /// <param name="fileProviderAccessor">The <see cref="IRazorViewEngineFileProviderAccessor"/>.</param> /// <param name="loaderAccessor"> The accessor for the <see cref="IAssemblyLoadContext"/> used to load compiled assemblies.</param> public DnxRoslynCompilationService( IHostingEnvironment environment, IOrchardLibraryManager libraryManager, ILibraryExporter libraryExporter, IOptions <RazorViewEngineOptions> optionsAccessor, IRazorViewEngineFileProviderAccessor fileProviderAccessor, IAssemblyLoadContextAccessor loaderAccessor) { _environment = environment; _libraryManager = libraryManager; _libraryExporter = libraryExporter; _options = optionsAccessor.Value; _applicationReferences = new Lazy <List <MetadataReference> >(GetApplicationReferences); _loader = loaderAccessor.GetLoadContext(typeof(DnxRoslynCompilationService).GetTypeInfo().Assembly); }
/// <summary> /// Initalizes a new instance of the <see cref="RoslynCompilationService"/> class. /// </summary> /// <param name="environment">The environment for the executing application.</param> /// <param name="loaderAccessor"> /// The accessor for the <see cref="IAssemblyLoadContext"/> used to load compiled assemblies. /// </param> /// <param name="libraryManager">The library manager that provides export and reference information.</param> /// <param name="compilerOptionsProvider"> /// The <see cref="ICompilerOptionsProvider"/> that provides Roslyn compilation settings. /// </param> /// <param name="host">The <see cref="IMvcRazorHost"/> that was used to generate the code.</param> public DefaultRoslynCompilationService(IApplicationEnvironment environment, IAssemblyLoadContextAccessor loaderAccessor, IOrchardLibraryManager libraryExporter, ICompilerOptionsProvider compilerOptionsProvider, IMvcRazorHost host, IOptions<RazorViewEngineOptions> optionsAccessor) { _environment = environment; _loader = loaderAccessor.GetLoadContext(typeof(RoslynCompilationService).GetTypeInfo().Assembly); _libraryExporter = libraryExporter; _applicationReferences = new Lazy<List<MetadataReference>>(GetApplicationReferences); _compilerOptionsProvider = compilerOptionsProvider; _fileProvider = optionsAccessor.Options.FileProvider; _classPrefix = host.MainClassNamePrefix; }
/// <summary> /// Initalizes a new instance of the <see cref="RoslynCompilationService"/> class. /// </summary> /// <param name="environment">The environment for the executing application.</param> /// <param name="loaderAccessor"> /// The accessor for the <see cref="IAssemblyLoadContext"/> used to load compiled assemblies. /// </param> /// <param name="libraryManager">The library manager that provides export and reference information.</param> /// <param name="compilerOptionsProvider"> /// The <see cref="ICompilerOptionsProvider"/> that provides Roslyn compilation settings. /// </param> /// <param name="host">The <see cref="IMvcRazorHost"/> that was used to generate the code.</param> public RoslynCompilationService(IApplicationEnvironment environment, IAssemblyLoadContextAccessor loaderAccessor, ILibraryExporter libraryExporter, ICompilerOptionsProvider compilerOptionsProvider, IMvcRazorHost host, IOptions <RazorViewEngineOptions> optionsAccessor) { _environment = environment; _loader = loaderAccessor.GetLoadContext(typeof(RoslynCompilationService).GetTypeInfo().Assembly); _libraryExporter = libraryExporter; _applicationReferences = new Lazy <List <MetadataReference> >(GetApplicationReferences); _compilerOptionsProvider = compilerOptionsProvider; _fileProvider = optionsAccessor.Options.FileProvider; _classPrefix = host.MainClassNamePrefix; }
/// <summary> /// Initalizes a new instance of the <see cref="DnxRoslynCompilationService"/> class. /// </summary> /// <param name="environment">The environment for the executing application.</param> /// <param name="libraryExporter">The library manager that provides export and reference information.</param> /// <param name="optionsAccessor">Accessor to <see cref="RazorViewEngineOptions"/>.</param> /// <param name="fileProviderAccessor">The <see cref="IRazorViewEngineFileProviderAccessor"/>.</param> public DnxRoslynCompilationService( IHostingEnvironment environment, ILibraryExporter libraryExporter, IOptions <RazorViewEngineOptions> optionsAccessor, IRazorViewEngineFileProviderAccessor fileProviderAccessor) { _environment = environment; _libraryExporter = libraryExporter; _options = optionsAccessor.Value; _applicationReferences = new Lazy <List <MetadataReference> >(GetApplicationReferences); #if NETSTANDARD1_5 _razorLoadContext = new RazorLoadContext(); #endif }
public static CompilationReference GetProject( [NotNull] this ILibraryExporter libraryExporter, [NotNull] IApplicationEnvironment environment) { var export = libraryExporter.GetExport(environment.ApplicationName); var project = export.MetadataReferences .OfType <IMetadataProjectReference>() .OfType <IRoslynMetadataReference>() .Select(reference => reference.MetadataReference as CompilationReference) .FirstOrDefault(); Contract.Assert(project != null); return(project); }
public ModelTypesLocator( ILibraryExporter libraryExporter, IApplicationEnvironment application) { if (libraryExporter == null) { throw new ArgumentNullException(nameof(libraryExporter)); } if (application == null) { throw new ArgumentNullException(nameof(application)); } _libraryExporter = libraryExporter; _application = application; }
public ModelTypesLocator( ILibraryExporter libraryExporter, Workspace projectWorkspace) { if (libraryExporter == null) { throw new ArgumentNullException(nameof(libraryExporter)); } if (projectWorkspace == null) { throw new ArgumentNullException(nameof(projectWorkspace)); } _libraryExporter = libraryExporter; _projectWorkspace = projectWorkspace; }
/// <summary> /// Initalizes a new instance of the <see cref="RoslynCompilationService"/> class. /// </summary> /// <param name="environment">The environment for the executing application.</param> /// <param name="loaderAccessor"> /// The accessor for the <see cref="IAssemblyLoadContext"/> used to load compiled assemblies. /// </param> /// <param name="libraryManager">The library manager that provides export and reference information.</param> /// <param name="compilerOptionsProvider"> /// The <see cref="ICompilerOptionsProvider"/> that provides Roslyn compilation settings. /// </param> /// <param name="host">The <see cref="IMvcRazorHost"/> that was used to generate the code.</param> public RoslynCompilationService( IApplicationEnvironment environment, ILibraryExporter libraryExporter, ICompilerOptionsProvider compilerOptionsProvider, IMvcRazorHost host, IOptions <RazorViewEngineOptions> optionsAccessor) { _environment = environment; _libraryExporter = libraryExporter; _applicationReferences = new Lazy <List <MetadataReference> >(GetApplicationReferences); _compilerOptionsProvider = compilerOptionsProvider; _fileProvider = optionsAccessor.Value.FileProvider; _classPrefix = host.MainClassNamePrefix; #if DOTNET5_4 _razorLoadContext = new RazorLoadContext(); #endif }
public DefaultCodeGeneratorAssemblyProvider(ILibraryManager libraryManager, ICodeGenAssemblyLoadContext loadContext, ILibraryExporter libraryExporter) { if (libraryManager == null) { throw new ArgumentNullException(nameof(libraryManager)); } if (loadContext == null) { throw new ArgumentNullException(nameof(loadContext)); } if (libraryExporter == null) { throw new ArgumentNullException(nameof(libraryExporter)); } _libraryManager = libraryManager; _assemblyLoadContext = loadContext; _libraryExporter = libraryExporter; }
/// <summary> /// Initalizes a new instance of the <see cref="RoslynCompilationService"/> class. /// </summary> /// <param name="environment">The environment for the executing application.</param> /// <param name="loaderAccessor"> /// The accessor for the <see cref="IAssemblyLoadContext"/> used to load compiled assemblies. /// </param> /// <param name="libraryManager">The library manager that provides export and reference information.</param> /// <param name="compilerOptionsProvider"> /// The <see cref="ICompilerOptionsProvider"/> that provides Roslyn compilation settings. /// </param> /// <param name="host">The <see cref="IMvcRazorHost"/> that was used to generate the code.</param> public RoslynCompilationService( IApplicationEnvironment environment, ILibraryExporter libraryExporter, ICompilerOptionsProvider compilerOptionsProvider, IMvcRazorHost host, IOptions<RazorViewEngineOptions> optionsAccessor) { _environment = environment; _libraryExporter = libraryExporter; _applicationReferences = new Lazy<List<MetadataReference>>(GetApplicationReferences); _compilerOptionsProvider = compilerOptionsProvider; _fileProvider = optionsAccessor.Value.FileProvider; _classPrefix = host.MainClassNamePrefix; #if DOTNET5_4 _razorLoadContext = new RazorLoadContext(); #endif }
public RoslynCompilationService(IApplicationInfo applicationInfo, ICodeGenAssemblyLoadContext loader, ILibraryExporter libraryExporter) { if (loader == null) { throw new ArgumentNullException(nameof(loader)); } if (applicationInfo == null) { throw new ArgumentNullException(nameof(applicationInfo)); } if (libraryExporter == null) { throw new ArgumentNullException(nameof(libraryExporter)); } _applicationInfo = applicationInfo; _loader = loader; _libraryExporter = libraryExporter; }
public EntityFrameworkServices( [NotNull] ILibraryManager libraryManager, [NotNull] ILibraryExporter libraryExporter, [NotNull] IApplicationEnvironment environment, [NotNull] IAssemblyLoadContextAccessor loader, [NotNull] IModelTypesLocator modelTypesLocator, [NotNull] IDbContextEditorServices dbContextEditorServices, [NotNull] IPackageInstaller packageInstaller, [NotNull] IServiceProvider serviceProvider, [NotNull] ILogger logger) { _libraryManager = libraryManager; _libraryExporter = libraryExporter; _environment = environment; _loader = loader.GetLoadContext(typeof(EntityFrameworkServices).GetTypeInfo().Assembly); _modelTypesLocator = modelTypesLocator; _dbContextEditorServices = dbContextEditorServices; _packageInstaller = packageInstaller; _serviceProvider = serviceProvider; _logger = logger; }
public EntityFrameworkServices( [NotNull]ILibraryManager libraryManager, [NotNull]ILibraryExporter libraryExporter, [NotNull]IApplicationEnvironment environment, [NotNull]IAssemblyLoadContextAccessor loader, [NotNull]IModelTypesLocator modelTypesLocator, [NotNull]IDbContextEditorServices dbContextEditorServices, [NotNull]IPackageInstaller packageInstaller, [NotNull]IServiceProvider serviceProvider, [NotNull]ILogger logger) { _libraryManager = libraryManager; _libraryExporter = libraryExporter; _environment = environment; _loader = loader.GetLoadContext(typeof(EntityFrameworkServices).GetTypeInfo().Assembly); _modelTypesLocator = modelTypesLocator; _dbContextEditorServices = dbContextEditorServices; _packageInstaller = packageInstaller; _serviceProvider = serviceProvider; _logger = logger; }
/// <summary> /// Initalizes a new instance of the <see cref="RoslynCompilationService"/> class. /// </summary> /// <param name="environment">The environment for the executing application.</param> /// <param name="runtimeEnvironment">Provides access to the runtime environment.</param> /// <param name="loaderAccessor"> /// The accessor for the <see cref="IAssemblyLoadContext"/> used to load compiled assemblies. /// </param> /// <param name="compilerOptionsProvider"> /// The <see cref="ICompilerOptionsProvider"/> that provides Roslyn compilation settings. /// </param> /// <param name="host">The <see cref="IMvcRazorHost"/> that was used to generate the code.</param> /// <param name="libraryExporter">The library manager that provides export and reference information.</param> /// <param name="hostingEnvironment">The web hosting environment the application is running in.</param> public DefaultRoslynCompilationService(IApplicationEnvironment environment, IRuntimeEnvironment runtimeEnvironment, IAssemblyLoadContextAccessor loaderAccessor, IOrchardLibraryManager libraryManager, ICompilerOptionsProvider compilerOptionsProvider, IMvcRazorHost host, IOptions <RazorViewEngineOptions> optionsAccessor, ILibraryExporter libraryExporter, IHostingEnvironment hostingEnvironment) { _environment = environment; _runtimeEnvironment = runtimeEnvironment; _loader = loaderAccessor.GetLoadContext(typeof(DefaultRoslynCompilationService).GetTypeInfo().Assembly); _libraryManager = libraryManager; _applicationReferences = new Lazy <List <MetadataReference> >(GetApplicationReferences); _compilerOptionsProvider = compilerOptionsProvider; _fileProvider = optionsAccessor.Value.FileProvider; _classPrefix = host.MainClassNamePrefix; _libraryExporter = libraryExporter; _hostingEnvironment = hostingEnvironment; }
public EntityFrameworkServices( ILibraryManager libraryManager, ILibraryExporter libraryExporter, IApplicationInfo applicationInfo, ICodeGenAssemblyLoadContext loader, IModelTypesLocator modelTypesLocator, IDbContextEditorServices dbContextEditorServices, IPackageInstaller packageInstaller, IServiceProvider serviceProvider, Workspace workspace, ILogger logger) { if (libraryManager == null) { throw new ArgumentNullException(nameof(libraryManager)); } if (libraryExporter == null) { throw new ArgumentNullException(nameof(libraryExporter)); } if (applicationInfo == null) { throw new ArgumentNullException(nameof(applicationInfo)); } if (loader == null) { throw new ArgumentNullException(nameof(loader)); } if (modelTypesLocator == null) { throw new ArgumentNullException(nameof(modelTypesLocator)); } if (dbContextEditorServices == null) { throw new ArgumentNullException(nameof(dbContextEditorServices)); } if (packageInstaller == null) { throw new ArgumentNullException(nameof(packageInstaller)); } if (serviceProvider == null) { throw new ArgumentNullException(nameof(serviceProvider)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } if (workspace == null) { throw new ArgumentNullException(nameof(workspace)); } _libraryManager = libraryManager; _libraryExporter = libraryExporter; _applicationInfo = applicationInfo; _loader = loader; _modelTypesLocator = modelTypesLocator; _dbContextEditorServices = dbContextEditorServices; _packageInstaller = packageInstaller; _serviceProvider = serviceProvider; _logger = logger; _workspace = workspace; }
public Program(IApplicationEnvironment appEnv, ILibraryExporter libraryExporter) { _appEnv = appEnv; _libraryExporter = libraryExporter; }
public static CompilationServices Create(ILibraryExporter libraryExporter, ICompilerOptionsProvider compilerOptionsProvider) { return(new DefaultCompilationServices(libraryExporter, compilerOptionsProvider)); }
public GenFuTagHelper(ILibraryExporter exporter, IAssemblyLoadContextAccessor accessor) { _exporter = exporter; _accessor = accessor; }
public RoslynCompilationService(ILibraryExporter libraryExporter, ITextTemplatingEngineHost host) { _libraryExporter = libraryExporter; _host = host; }
public Engine(ILibraryExporter libraryExporter, ITextTemplatingEngineHost host) { _libraryExporter = libraryExporter; _host = host; }
public HomeController(IAssemblyLoadContextAccessor accessor, ILibraryExporter exporter) { _accessor = accessor; _exporter = exporter; }
public static CompilationServices Create(ILibraryExporter libraryExporter, ICompilerOptionsProvider compilerOptionsProvider) { return new DefaultCompilationServices(libraryExporter, compilerOptionsProvider); }
internal DefaultCompilationServices(ILibraryExporter libraryExporter, ICompilerOptionsProvider compilerOptionsProvider) { LibraryExporter = libraryExporter; CompilerOptionsProvider = compilerOptionsProvider; }
public EntityFrameworkServices( ILibraryManager libraryManager, ILibraryExporter libraryExporter, IApplicationEnvironment environment, IAssemblyLoadContextAccessor loader, IModelTypesLocator modelTypesLocator, IDbContextEditorServices dbContextEditorServices, IPackageInstaller packageInstaller, IServiceProvider serviceProvider, ILogger logger) { if (libraryManager == null) { throw new ArgumentNullException(nameof(libraryManager)); } if (libraryExporter == null) { throw new ArgumentNullException(nameof(libraryExporter)); } if (environment == null) { throw new ArgumentNullException(nameof(environment)); } if (loader == null) { throw new ArgumentNullException(nameof(loader)); } if (modelTypesLocator == null) { throw new ArgumentNullException(nameof(modelTypesLocator)); } if (dbContextEditorServices == null) { throw new ArgumentNullException(nameof(dbContextEditorServices)); } if (packageInstaller == null) { throw new ArgumentNullException(nameof(packageInstaller)); } if (serviceProvider == null) { throw new ArgumentNullException(nameof(serviceProvider)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } _libraryManager = libraryManager; _libraryExporter = libraryExporter; _environment = environment; _loader = loader.GetLoadContext(typeof(EntityFrameworkServices).GetTypeInfo().Assembly); _modelTypesLocator = modelTypesLocator; _dbContextEditorServices = dbContextEditorServices; _packageInstaller = packageInstaller; _serviceProvider = serviceProvider; _logger = logger; }
public Program(ILibraryExporter exporter) { _exporter = exporter; }