public CodeFileCompilationHandlerCSharp(IWorkspaceManager workspaceManager, IPipelineExecutionInfo pipelineExecutionInfo, ILogger logger)
 {
     this.workspaceManager = workspaceManager;
     this.pipelineExecutionInfo = pipelineExecutionInfo;
     this.logger = logger;
     this.compilationHandler = new WorkspaceCompilationHandler(workspaceManager);
 }
Exemplo n.º 2
0
 public CodeFileEnvironmentHandlerTs(
     IFileSystem fileSystem,
     ICodeFileStorageHandler codeFileStorageHandler,
     ICodeFileCompilationHandler codeFileCompilationHandler,
     IPipelineExecutionInfo pipelineExecutionInfo,
     ILogger logger)
     : base(codeFileStorageHandler, codeFileCompilationHandler)
 {
     this.fileSystem = fileSystem;
     this.tsHost     = new TsHost(30050, 30100, 5000, new TsHostLoggerAdapter(logger));
 }
Exemplo n.º 3
0
        private IPipelineEnvironment CreatePipelineEnvironment(IPipelineExecutionInfo pipelineExecutionInfo, PipelineConfiguration configuration)
        {
            var result = new PipelineEnvironment(pipelineExecutionInfo);

            foreach (var handlerRegistration in configuration.CodeFileHandlerTypeRegistrations)
            {
                Type type = Type.GetType(handlerRegistration.Type);
                if (type is null)
                {
                    throw new InvalidOperationException($"Cannot resolve CodeFileHandler type {handlerRegistration.Type}.");
                }

                var codeFileHandlerFactory = Activator.CreateInstance(type) as ICodeFileEnvironmentHandlerFactory;
                if (codeFileHandlerFactory == null)
                {
                    throw new InvalidOperationException($"CodeFileHandler type {handlerRegistration.Type} should implement {typeof(ICodeFileEnvironmentHandlerFactory)} interface.");
                }

                var handler = codeFileHandlerFactory.Create(this.workspaceManagers.ProcessingWorkspace, this.fileSystem, pipelineExecutionInfo, this.logger, handlerRegistration.Configuration);
                result.Handlers.Add(handler);
            }

            return(result);
        }
Exemplo n.º 4
0
        public List <ICodeStream> Execute(IEnumerable <CodeFile> inputs, IMetadataWriter metadataWriter, IMetadataReader metadataReader, ICodeStreamFactory codeStreamFactory, IPipelineExecutionInfo pipelineExecutionInfo)
        {
            this.logger.Write(new LogRecord(MessageSeverity.Information, $"Starting plugin: {this.Plugin?.Signature?.Id} - {this.Plugin?.Signature?.Name}"));
            var metadataRecorder = new MetadataRecorder(metadataWriter, pipelineExecutionInfo, this.Plugin.Signature.Id);
            var result           = this.Plugin.InitializeOutputs(codeStreamFactory);

            this.Plugin.Execute(inputs, metadataRecorder, metadataReader, this.logger);

            return(result);
        }
Exemplo n.º 5
0
 public MetadataRecorder(IMetadataWriter metadataWriter, IPipelineExecutionInfo pipelineExecutionInfo, string pluginId)
 {
     this.metadataWriter        = metadataWriter;
     this.pipelineExecutionInfo = pipelineExecutionInfo;
     this.pluginId = pluginId;
 }
Exemplo n.º 6
0
 public ICodeFileEnvironmentHandler Create(IWorkspaceManager workspaceManager, IFileSystem fileSystem, IPipelineExecutionInfo pipelineExecutionInfo, ILogger logger, JObject configuration = null)
 {
     return(new CodeFileEnvironmentHandlerCSharp(workspaceManager, pipelineExecutionInfo, logger));
 }
Exemplo n.º 7
0
 public CodeFileEnvironmentHandlerTs(IFileSystem fileSystem, IPipelineExecutionInfo pipelineExecutionInfo, ILogger logger)
     : this(fileSystem, new CodeFileStorageHandlerTs(fileSystem), new CodeFileCompilationHandlerTs(pipelineExecutionInfo, logger), pipelineExecutionInfo, logger)
 {
 }
Exemplo n.º 8
0
 public CodeFileEnvironmentHandlerCSharp(IWorkspaceManager workspaceManager, IPipelineExecutionInfo pipelineExecutionInfo, ILogger logger)
     : base(workspaceManager, new CodeFileCompilationHandlerCSharp(workspaceManager, pipelineExecutionInfo, logger))
 {
 }
Exemplo n.º 9
0
 public CodeFileCompilationHandlerTs(IPipelineExecutionInfo pipelineExecutionInfo, ILogger logger)
 {
     this.pipelineExecutionInfo = pipelineExecutionInfo;
     this.logger = logger;
 }
Exemplo n.º 10
0
 public PipelineEnvironment(IPipelineExecutionInfo pipelineExecutionInfo)
 {
     this.PipelineExecutionInfo = pipelineExecutionInfo;
 }