private DotNetCorePlatform CreatePlatform( string projectFile = null, Dictionary <string, string> supportedVersions = null, string defaultVersion = null) { var projectFileProvider = new TestProjectFileProvider(projectFile); var detector = new DotNetCorePlatformDetector( projectFileProvider, NullLogger <DotNetCorePlatformDetector> .Instance); defaultVersion = defaultVersion ?? DotNetCoreRunTimeVersions.NetCoreApp31; supportedVersions = supportedVersions ?? new Dictionary <string, string> { { defaultVersion, defaultVersion }, }; var versionProvider = new TestDotNetCoreVersionProvider( supportedVersions, defaultVersion); var commonOptions = new BuildScriptGeneratorOptions(); var dotNetCoreScriptGeneratorOptions = new DotNetCoreScriptGeneratorOptions(); var installer = new DotNetCorePlatformInstaller( Options.Create(commonOptions), versionProvider, NullLoggerFactory.Instance); var globalJsonSdkResolver = new GlobalJsonSdkResolver(NullLogger <GlobalJsonSdkResolver> .Instance); return(new TestDotNetCorePlatform( versionProvider, projectFileProvider, detector, Options.Create(commonOptions), Options.Create(dotNetCoreScriptGeneratorOptions), installer, globalJsonSdkResolver)); }
private DotNetCorePlatform CreateDotNetCorePlatform( Dictionary <string, string> supportedDotNetCoreVersions = null, string defaultVersion = null, string detectedVersion = null, BuildScriptGeneratorOptions commonOptions = null, DotNetCoreScriptGeneratorOptions DotNetCoreScriptGeneratorOptions = null, bool?isDotNetCoreVersionAlreadyInstalled = null, string DotNetCoreInstallationScript = null, string dotNetCoreInstallationScript = null) { commonOptions = commonOptions ?? new BuildScriptGeneratorOptions(); DotNetCoreScriptGeneratorOptions = DotNetCoreScriptGeneratorOptions ?? new DotNetCoreScriptGeneratorOptions(); isDotNetCoreVersionAlreadyInstalled = isDotNetCoreVersionAlreadyInstalled ?? true; DotNetCoreInstallationScript = DotNetCoreInstallationScript ?? "default-DotNetCore-installation-script"; var versionProvider = new TestDotNetCoreVersionProvider(supportedDotNetCoreVersions, defaultVersion); var detector = new TestDotNetCorePlatformDetector(detectedVersion: detectedVersion); var DotNetCoreInstaller = new TestDotNetCorePlatformInstaller( Options.Create(commonOptions), isDotNetCoreVersionAlreadyInstalled.Value, DotNetCoreInstallationScript); var globalJsonSdkResolver = new GlobalJsonSdkResolver(NullLogger <GlobalJsonSdkResolver> .Instance); return(new TestDotNetCorePlatform( Options.Create(DotNetCoreScriptGeneratorOptions), Options.Create(commonOptions), versionProvider, NullLogger <TestDotNetCorePlatform> .Instance, detector, DotNetCoreInstaller, globalJsonSdkResolver)); }
public TestDotNetCorePlatform( IDotNetCoreVersionProvider versionProvider, IDotNetCorePlatformDetector detector, IOptions <BuildScriptGeneratorOptions> cliOptions, IOptions <DotNetCoreScriptGeneratorOptions> dotNetCoreScriptGeneratorOptions, DotNetCorePlatformInstaller platformInstaller, GlobalJsonSdkResolver globalJsonSdkResolver) : base( versionProvider, NullLogger <DotNetCorePlatform> .Instance, detector, cliOptions, dotNetCoreScriptGeneratorOptions, platformInstaller, globalJsonSdkResolver) { }
public TestDotNetCorePlatform( IOptions <DotNetCoreScriptGeneratorOptions> DotNetCoreScriptGeneratorOptions, IOptions <BuildScriptGeneratorOptions> commonOptions, IDotNetCoreVersionProvider DotNetCoreVersionProvider, ILogger <DotNetCorePlatform> logger, IDotNetCorePlatformDetector detector, DotNetCorePlatformInstaller DotNetCoreInstaller, GlobalJsonSdkResolver globalJsonSdkResolver) : base( DotNetCoreVersionProvider, logger, detector, commonOptions, DotNetCoreScriptGeneratorOptions, DotNetCoreInstaller, globalJsonSdkResolver) { }