public CompilationEngine( CompilationCache compilationCache, CompilationEngineContext context) { _context = context; RootLibraryExporter = new LibraryExporter(_context.LibraryManager, this, _context.TargetFramework, _context.Configuration); _compilerLoadContext = new Lazy<IAssemblyLoadContext>(() => { var factory = (IAssemblyLoadContextFactory)_context.Services.GetService(typeof(IAssemblyLoadContextFactory)); // Ensure this compilation engine is in the service provider var services = new ServiceProvider(_context.Services); services.Add(typeof(ICompilationEngine), this); return factory.Create(services); }); CompilationCache = compilationCache; // Register compiler services // TODO(anurse): Switch to project factory model to avoid needing to do this. _context.AddService(typeof(ICache), CompilationCache.Cache); _context.AddService(typeof(ICacheContextAccessor), CompilationCache.CacheContextAccessor); _context.AddService(typeof(INamedCacheDependencyProvider), CompilationCache.NamedCacheDependencyProvider); _context.AddService(typeof(IFileWatcher), context.FileWatcher); }
public CompilationEngineContext(IApplicationEnvironment applicationEnvironment, IAssemblyLoadContext defaultLoadContext, CompilationCache cache) : this(applicationEnvironment, defaultLoadContext, cache, NoopWatcher.Instance, new ProjectGraphProvider()) { }
public CompilationEngineContext(IApplicationEnvironment applicationEnvironment, IRuntimeEnvironment runtimeEnvironment, IAssemblyLoadContext defaultLoadContext, CompilationCache cache) : this(applicationEnvironment, runtimeEnvironment, defaultLoadContext, cache, NoopWatcher.Instance) { }
public ConnectionContext(IDictionary<int, ApplicationContext> contexts, IServiceProvider services, ProcessingQueue queue, ProtocolManager protocolManager, string hostId) { _contexts = contexts; _services = services; _queue = queue; _hostId = hostId; _protocolManager = protocolManager; _cache = new CompilationCache(); }
public CompilationEngineContext(IApplicationEnvironment applicationEnvironment, IRuntimeEnvironment runtimeEnvironment, IAssemblyLoadContext defaultLoadContext, CompilationCache cache) { ApplicationEnvironment = applicationEnvironment; RuntimeEnvironment = runtimeEnvironment; DefaultLoadContext = defaultLoadContext; CompilationCache = cache; // Register compiler services AddCompilationService(typeof(IApplicationEnvironment), ApplicationEnvironment); AddCompilationService(typeof(ICache), CompilationCache.Cache); AddCompilationService(typeof(ICacheContextAccessor), CompilationCache.CacheContextAccessor); AddCompilationService(typeof(INamedCacheDependencyProvider), CompilationCache.NamedCacheDependencyProvider); }
public CompilationEngineContext(IApplicationEnvironment applicationEnvironment, IAssemblyLoadContext defaultLoadContext, CompilationCache cache, IFileWatcher fileWatcher, IProjectGraphProvider projectGraphProvider) { ApplicationEnvironment = applicationEnvironment; DefaultLoadContext = defaultLoadContext; ProjectGraphProvider = projectGraphProvider; CompilationCache = cache; FileWatcher = fileWatcher; // Register compiler services AddCompilationService(typeof(IFileWatcher), FileWatcher); AddCompilationService(typeof(IApplicationEnvironment), ApplicationEnvironment); AddCompilationService(typeof(ICache), CompilationCache.Cache); AddCompilationService(typeof(ICacheContextAccessor), CompilationCache.CacheContextAccessor); AddCompilationService(typeof(INamedCacheDependencyProvider), CompilationCache.NamedCacheDependencyProvider); }
public CompilationEngineFactory(CompilationCache cache) { CompilationCache = cache; }