Esempio n. 1
0
 protected override void Load(ContainerBuilder builder)
 {
     builder.Register(context => PageStreamFactory.CreateDefault()).As <StreamFactory>()
     .InstancePerLifetimeScope();
     builder.RegisterType <CliServer>().As <ICliServer>().SingleInstance();
     builder.RegisterType <ServerConnectionLifetimeScope>().AsSelf().AutoActivate();
     builder.RegisterType <CommandLineFacade>().As <ICommandLineFacade>().InstancePerLifetimeScope();
     builder.RegisterType <JsonMessageParser>().As <IMessageParser>().InstancePerLifetimeScope();
     builder.RegisterModule <MessageSenderDiModule>();
 }
        public NamedPipeServerProtocolSplitMessagesTest(ITestOutputHelper output)
        {
            NamedPipeServerFeature serverFeature = new NamedPipeServerFeature();

            if (!serverFeature.FeatureEnabled)
            {
                throw new SkipTestException("Disabled named pipe communication");
            }
            streamFactory = PageStreamFactory.CreateDefault(16);
            string serverName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
                                    ? Guid.NewGuid().ToByteString()
                                    : $"/tmp/{Guid.NewGuid().ToByteString()}";
            Task <ICommunicationProtocol> creationTask = NamedPipeCommunicationProtocol.Connect(serverName, streamFactory, new LogTracer(output));

            simulator = NamedPipeCommunicationProtocolSimulator.Connect(serverName, streamFactory, new LogTracer(output));
            creationTask.Wait();
            protocol = creationTask.Result;
            protocol.MessageReceived    += OnMessageReceived;
            protocol.CommunicationError += OnCommunicationError;
            protocol.Start();
        }
Esempio n. 3
0
 protected override void Load(ContainerBuilder builder)
 {
     builder.Register(context => PageStreamFactory.CreateDefault()).As <StreamFactory>()
     .InstancePerLifetimeScope();
     builder.Register(_ => CancellationToken.None).AsSelf().InstancePerLifetimeScope();
     builder.RegisterType <ExecutionContext>().AsSelf().InstancePerLifetimeScope();
     builder.RegisterType <CommandManager>().As <ICommandManager>().InstancePerLifetimeScope();
     builder.RegisterType <OutputFormatterPool>().As <IOutputFormatterPool>().InstancePerLifetimeScope();
     builder.RegisterType <CMakeServerFormatter>().As <IOutputFormatter>().InstancePerLifetimeScope();
     builder.RegisterType <PriorityHell>().As <IPriorityMaster>().InstancePerLifetimeScope();
     builder.RegisterType <BuildCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <DynamicCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <GenerateLibraryCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <GetCompilerSpecificationsCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <GetComponentsCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <GetIncludePathsCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <GetSdksCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <GetSettingsCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <GetTargetsCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <GetProjectInformationCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <GetProgramsCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <GetUpdateVersionsCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <InstallSdkCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <ScanSdksCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <SetSettingsCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <SetTargetsCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <UpdateCliCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <UpdateTargetsCommand>().As <ICommand>().InstancePerLifetimeScope();
     builder.RegisterType <TargetParser>().As <ITargetParser>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <AutomaticRollbackTransactionFactory>().As <ITransactionFactory>().InstancePerLifetimeScope();
     builder.RegisterType <StaticDatatypeConversion>().As <IDatatypeConversion>().InstancePerLifetimeScope();
     builder.RegisterType <SettingsBasedSdkRepository>().As <ISdkRepository>().InstancePerLifetimeScope();
     builder.RegisterType <CmakeExecuter>().As <IBuildExecuter>().AsSelf().InstancePerLifetimeScope();
     builder.RegisterType <CmakeBuildInformationService>().As <IBuildInformationService>().InstancePerLifetimeScope();
     builder.RegisterType <Builder>().As <IBuilder>().InstancePerLifetimeScope();
     builder.RegisterType <EngineeringLibraryBuilderExecuter>().As <ILibraryBuilderExecuter>().InstancePerLifetimeScope();
     builder.RegisterType <FileBasedSettingsProvider>()
     .As <ISettingsProvider>()
     .As <ISettingsObserver>()
     .InstancePerLifetimeScope();
     builder.RegisterType <HttpCliUpdater>().As <ICliUpdater>().InstancePerLifetimeScope();
     builder.RegisterType <JsonCommandResultVisualizer>().As <ICommandResultVisualizer>().InstancePerLifetimeScope();
     builder.RegisterType <RsaSecurityValidator>().As <ISecurityValidator>().InstancePerLifetimeScope();
     builder.RegisterType <SharpZipFileUnpackService>().As <IFileUnpackService>().InstancePerLifetimeScope();
     builder.RegisterType <ProcessBasedSettingsMigrationInstallationStep>().As <IInstallationStep>().InstancePerLifetimeScope();
     builder.RegisterType <AttributeView>().As <IAttributeView>().InstancePerLifetimeScope();
     builder.RegisterType <FileBasedBinariesLocator>().As <IBinariesLocator>().InstancePerLifetimeScope();
     builder.RegisterType <TemplateCommandProvider>().As <IDynamicCommandProvider>().InstancePerLifetimeScope();
     builder.RegisterType <SettingsBasedTemplateLoader>().As <ITemplateLoader>().InstancePerLifetimeScope();
     builder.RegisterType <TemplateCommandBuilder>().As <ITemplateCommandBuilder>().InstancePerLifetimeScope();
     builder.RegisterType <TemplateRepository>().As <ITemplateRepository>().InstancePerLifetimeScope();
     builder.RegisterType <TemplateResolver>().As <ITemplateResolver>().InstancePerLifetimeScope();
     builder.RegisterType <TemplateFileGenerator>().As <ITemplateFileGenerator>().InstancePerLifetimeScope();
     builder.RegisterType <CollectiveTemplateIdentifierRepository>().As <ITemplateIdentifierRepository>().InstancePerLifetimeScope();
     builder.RegisterType <SdkInstaller>().As <ISdkInstaller>().InstancePerLifetimeScope();
     builder.RegisterType <PropertiesFileSdkContainer>().As <ISdkContainer>().InstancePerLifetimeScope();
     builder.RegisterType <EntityFactory>().As <IEntityFactory>().InstancePerLifetimeScope();
     builder.Register(c => c.ResolveNamed <IEnumerable <IEntityContentProvider> >("Implementation")).As <IEnumerable <IEntityContentProvider> >().InstancePerLifetimeScope();
     builder.RegisterType <CMakeBuildContentProvider>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <CodeModelContentProvider>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <CommandDefinitionContentProvider>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <ConstantContentProvider>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <FormatTemplateContentProvider>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <RootEntityContentProvider>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <SettingsContentProvider>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <DeployCommandContentProvider>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <TemplateContentProvider>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <CppContentProvider>().Named <IEntityContentProvider>("Implementation").InstancePerLifetimeScope();
     builder.RegisterType <ProjectSettingsProvider>()
     .Named <IEntityContentProvider>("Implementation")
     .As <ITemplateIdentifier>()
     .InstancePerLifetimeScope();
     builder.RegisterType <CollectiveEntityContentProvider>().As <IEntityContentProvider>().InstancePerLifetimeScope();
     builder.RegisterType <DeployService>().As <IDeployService>().InstancePerLifetimeScope();
     builder.RegisterType <EngineeringLibraryBuilderDeployStep>().As <IDeployStep>().InstancePerLifetimeScope();
     builder.RegisterType <ProjectPropertiesProvider>().As <IProjectPropertiesProvider>().InstancePerLifetimeScope();
     builder.RegisterType <CopyDependenciesDeployStep>().As <IDeployStep>().InstancePerLifetimeScope();
     if (activateAutoComponents)
     {
         AddAutoActivatedComponents(builder, noSdkExploration);
     }
 }