static DotNetCoreSdkPaths GetSdkPaths(DotNetCorePath path)
        {
            var sdkPaths = new DotNetCoreSdkPaths(path.FileName, initializeSdkLocation: true);

            sdkPaths.ResolveSDK();
            return(sdkPaths);
        }
Esempio n. 2
0
        static DotNetCoreSdkPaths GetSdkPaths(DotNetCorePath path)
        {
            var sdkPaths = new DotNetCoreSdkPaths(path.FileName);

            sdkPaths.ResolveSDK();
            return(sdkPaths);
        }
        static DotNetCoreSdkPaths GetSdkPaths(DotNetCorePath path)
        {
            var sdkPaths = new DotNetCoreSdkPaths();

            sdkPaths.FindMSBuildSDKsPath(path.FileName);
            return(sdkPaths);
        }
 public void ValidateSdkLocation(FilePath location)
 {
     if (!location.IsNullOrEmpty)
     {
         DotNetCorePath  = new DotNetCorePath(location);
         SdkPaths        = GetSdkPaths(DotNetCorePath);
         RuntimeVersions = DotNetCoreRuntimeVersions.GetInstalledVersions(DotNetCorePath.FileName).ToArray();
     }
     else
     {
         DotNetCorePath  = null;
         SdkPaths        = new DotNetCoreSdkPaths();
         RuntimeVersions = Array.Empty <DotNetCoreVersion> ();
     }
 }
Esempio n. 5
0
        DotNetCoreSdkPaths CreateResolver(string dotnetCorePath, bool mockSdkVersions = true)
        {
            if (string.IsNullOrEmpty(DotNetCoreRuntime.FileName))
            {
                Assert.Inconclusive($"'DotNetCoreRuntime.FileName' is empty. Unable to run the test. DotNetCore installed? {DotNetCoreRuntime.IsInstalled}");
            }

            var resolver = new DotNetCoreSdkPaths(dotnetCorePath);

            if (mockSdkVersions)
            {
                resolver.SdkVersions = this.SdkVersions;
            }

            return(resolver);
        }
        public void SaveSdkLocationSetting(FilePath location)
        {
            if (location == DotNetCoreRuntime.FileName)
            {
                return;
            }

            var path = new DotNetCorePath(location);
            DotNetCoreSdkPaths sdkPaths = GetSdkPaths(path);

            DotNetCoreSdk.Update(sdkPaths);
            DotNetCoreRuntime.Update(path);

            // All open .NET Core projects need to be re-evaluated so the correct
            // SDK MSBuild imports are used.
            ReevaluateAllOpenDotNetCoreProjects().Ignore();
        }