Ejemplo n.º 1
0
 public NetSdkManagedInstaller(
     IReporter reporter,
     SdkFeatureBand sdkFeatureBand,
     IWorkloadResolver workloadResolver,
     INuGetPackageDownloader nugetPackageDownloader = null,
     string dotnetDir = null)
 {
     _dotnetDir             = dotnetDir ?? EnvironmentProvider.GetDotnetExeDirectory();
     _tempPackagesDir       = Path.Combine(_dotnetDir, "metadata", "temp");
     _nugetPackageInstaller = nugetPackageDownloader ?? new NuGetPackageDownloader(_tempPackagesDir, sourceUrl: "https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json");
     _workloadMetadataDir   = Path.Combine(_dotnetDir, "metadata", "workloads");
     _reporter         = reporter;
     _sdkFeatureBand   = sdkFeatureBand;
     _workloadResolver = workloadResolver;
 }
 public NetSdkManagedInstaller(
     IReporter reporter,
     SdkFeatureBand sdkFeatureBand,
     IWorkloadResolver workloadResolver,
     INuGetPackageDownloader nugetPackageDownloader = null,
     string dotnetDir = null)
 {
     _dotnetDir             = dotnetDir ?? EnvironmentProvider.GetDotnetExeDirectory();
     _tempPackagesDir       = new DirectoryPath(Path.Combine(_dotnetDir, "metadata", "temp"));
     _nugetPackageInstaller = nugetPackageDownloader ?? new NuGetPackageDownloader(_tempPackagesDir);
     _workloadMetadataDir   = Path.Combine(_dotnetDir, "metadata", "workloads");
     _reporter         = reporter;
     _sdkFeatureBand   = sdkFeatureBand;
     _workloadResolver = workloadResolver;
 }
Ejemplo n.º 3
0
        public WorkloadInstallCommand(
            ParseResult parseResult,
            IReporter reporter = null,
            IWorkloadResolver workloadResolver = null,
            IInstaller workloadInstaller       = null,
            string version = null)
            : base(parseResult)
        {
            _reporter              = reporter ?? Reporter.Output;
            _skipManifestUpdate    = parseResult.ValueForOption <bool>(WorkloadInstallCommandParser.SkipManifestUpdateOption);
            _printDownloadLinkOnly = parseResult.ValueForOption <bool>(WorkloadInstallCommandParser.PrintDownloadLinkOnlyOption);
            _fromCacheOption       = parseResult.ValueForOption <string>(WorkloadInstallCommandParser.FromCacheOption);
            _workloadIds           = parseResult.ValueForArgument <IReadOnlyCollection <string> >(WorkloadInstallCommandParser.WorkloadIdArgument);
            _sdkVersion            = new ReleaseVersion(version ?? Product.Version);

            var dotnetPath = EnvironmentProvider.GetDotnetExeDirectory();
            var workloadManifestProvider = new SdkDirectoryWorkloadManifestProvider(dotnetPath, _sdkVersion.ToString());

            _workloadResolver = workloadResolver ?? WorkloadResolver.Create(workloadManifestProvider, dotnetPath, _sdkVersion.ToString());
            var sdkFeatureBand = new SdkFeatureBand(string.Join('.', _sdkVersion.Major, _sdkVersion.Minor, _sdkVersion.SdkFeatureBand));

            _workloadInstaller = workloadInstaller ?? WorkloadInstallerFactory.GetWorkloadInstaller(_reporter, sdkFeatureBand, _workloadResolver);
        }