public static IExportRegistrationBlock WithCommon(this IExportRegistrationBlock block, WindowsDeploymentOptionsProvider installOptionsProvider) { var taskTypes = from a in Assemblies.AppDomainAssemblies from type in a.ExportedTypes where type.GetTypeInfo().ImplementedInterfaces.Contains(typeof(IDeploymentTask)) select type; block.ExportAssemblies(Assemblies.AppDomainAssemblies).ByInterface <ISpaceAllocator <IDevice> >(); block.Export <ZipExtractor>().As <IZipExtractor>(); block.ExportFactory(Tokenizer.Create).As <Tokenizer <LangToken> >(); block.Export <ScriptParser>().As <IScriptParser>(); block.ExportFactory(() => installOptionsProvider).As <IWindowsOptionsProvider>(); block.Export <WoaDeployer>().As <IWoaDeployer>(); block.Export <BootCreator>().As <IBootCreator>(); block.Export <LowLevelApi>().As <ILowLevelApi>(); block.ExportInstance(taskTypes).As <IEnumerable <Type> >(); block.Export <ScriptRunner>().As <IScriptRunner>(); block.Export <InstanceBuilder>().As <IInstanceBuilder>(); block.Export <RaspberryPathBuilder>().As <IPathBuilder>(); block.Export <FileSystemOperations>().As <IFileSystemOperations>(); block.Export <BcdInvokerFactory>().As <IBcdInvokerFactory>(); block.Export <WindowsDeployer>().As <IWindowsDeployer>(); block.Export <RaspberryDisklayoutPreparer>().As <IDiskLayoutPreparer>(); block.Export <ImageFlasher>().As <IImageFlasher>(); block.Export <DismImageService>().As <IWindowsImageService>(); block.ExportFactory(() => AzureDevOpsClient.Create(new Uri("https://dev.azure.com"))).As <IAzureDevOpsBuildClient>(); return(block); }
public async Task Test() { var zipExtractor = new ZipExtractor(new FileSystemOperations()); var azureDevOpsClient = AzureDevOpsClient.Create(new Uri("https://dev.azure.com")); var task = new AzureDevOpsUnpack("LumiaWOA;Lumia950XLPkg;1;MSM8994 UEFI (Lumia 950 XL)", azureDevOpsClient, zipExtractor); await task.Execute(); }
public async Task Test() { var zipExtractor = new ZipExtractor(new FileSystemOperations()); var azureDevOpsClient = AzureDevOpsClient.Create(new Uri("https://dev.azure.com")); using (var httpClient = new HttpClient()) { IDownloader downloader = new Downloader(httpClient); var task = new FetchAzureDevOpsArtifact("LumiaWOA;Lumia950XLPkg;1;MSM8994 UEFI (Lumia 950 XL)", azureDevOpsClient, zipExtractor, downloader, null); await task.Execute(); } }
public static IExportRegistrationBlock WithCommon(this IExportRegistrationBlock block, WindowsDeploymentOptionsProvider installOptionsProvider) { var taskTypes = from a in Assemblies.AppDomainAssemblies from type in a.ExportedTypes where type.GetTypeInfo().ImplementedInterfaces.Contains(typeof(IDeploymentTask)) select type; block.ExportAssemblies(Assemblies.AppDomainAssemblies).ByInterface <ISpaceAllocator <IPhone> >(); block.Export <ZipExtractor>().As <IZipExtractor>(); block.ExportFactory(Tokenizer.Create).As <Tokenizer <LangToken> >().Lifestyle.Singleton(); block.Export <ScriptParser>().As <IScriptParser>().Lifestyle.Singleton(); block.ExportFactory(() => installOptionsProvider).As <IWindowsOptionsProvider>().Lifestyle.Singleton(); block.Export <LumiaDiskLayoutPreparer>().As <IDiskLayoutPreparer>().Lifestyle.Singleton(); block.Export <PhoneInfoReader>().As <IPhoneInfoReader>().Lifestyle.Singleton(); block.Export <WoaDeployer>().As <IWoaDeployer>().Lifestyle.Singleton(); block.Export <Tooling>().As <ITooling>().Lifestyle.Singleton(); block.Export <BootCreator>().As <IBootCreator>().Lifestyle.Singleton(); block.Export <DiskApi>().As <IDiskApi>().Lifestyle.Singleton(); block.Export <PhonePathBuilder>().As <IPathBuilder>().Lifestyle.Singleton(); block.ExportInstance(taskTypes).As <IEnumerable <Type> >(); block.Export <ScriptRunner>().As <IScriptRunner>().Lifestyle.Singleton(); block.Export <InstanceBuilder>().As <IInstanceBuilder>().Lifestyle.Singleton(); block.ExportFactory((IPhone p) => new DeviceProvider { Device = p }).As <IDeviceProvider>(); block.Export <FileSystemOperations>().As <IFileSystemOperations>().Lifestyle.Singleton(); block.Export <BcdInvokerFactory>().As <IBcdInvokerFactory>().Lifestyle.Singleton(); block.Export <WindowsDeployer>().As <IWindowsDeployer>().Lifestyle.Singleton(); block.ExportFactory(() => new HttpClient { Timeout = TimeSpan.FromMinutes(30) }).Lifestyle.Singleton(); block.ExportFactory(() => new GitHubClient(new ProductHeaderValue("WOADeployer"))).As <IGitHubClient>(); block.Export <Downloader>().As <IDownloader>().Lifestyle.Singleton(); block.Export <ProviderBasedWindowsDeployer>().As <IProviderBasedWindowsDeployer>(); block.Export <PartitionCleaner>().As <IPartitionCleaner>(); block.ExportFactory(() => AzureDevOpsClient.Create(new Uri("https://dev.azure.com"))).As <IAzureDevOpsBuildClient>(); return(block); }