public BuildManager(IServiceProvider hostServices, BuildOptions buildOptions) { _hostServices = hostServices; _buildOptions = buildOptions; _applicationEnvironment = (IApplicationEnvironment)hostServices.GetService(typeof(IApplicationEnvironment)); var runtimeEnvironment = (IRuntimeEnvironment)hostServices.GetService(typeof(IRuntimeEnvironment)); var loadContextAccessor = (IAssemblyLoadContextAccessor)hostServices.GetService(typeof(IAssemblyLoadContextAccessor)); _compilationEngine = new CompilationEngine2(new CompilationEngineContext2( _applicationEnvironment, runtimeEnvironment, loadContextAccessor.Default, new CompilationCache2())); ScriptExecutor = new ScriptExecutor(buildOptions.Reports.Information); }
public BuildContext(CompilationEngine2 compilationEngine, Runtime.Project project, FrameworkName targetFramework, string configuration, string outputPath) { _project = project; _targetFramework = targetFramework; _configuration = configuration; _targetFrameworkFolder = VersionUtility.GetShortFrameworkName(_targetFramework); _outputPath = Path.Combine(outputPath, _targetFrameworkFolder); _libraryExporter = compilationEngine.CreateProjectExporter( _project, _targetFramework, _configuration); _libraryManager = _libraryExporter.LibraryManager; }