Esempio n. 1
0
        private bool WrapCsProject()
        {
            if (string.IsNullOrEmpty(Configuration))
            {
                Configuration = "debug";
            }

            MsBuildPath = string.IsNullOrEmpty(MsBuildPath) ?
                          DnuEnvironment.GetFolderPath(DnuFolderPath.DefaultMsBuildPath) : MsBuildPath;

            XDocument resolutionResults;
            string    errorMessage;

            if (!TryResolveReferences(out resolutionResults, out errorMessage))
            {
                Reports.Error.WriteLine(errorMessage);
                return(false);
            }

            foreach (var projectElement in resolutionResults.Root.Elements())
            {
                EmitProjectWrapper(projectElement);
            }

            return(true);
        }
Esempio n. 2
0
        private static string FindRuntimeHome()
        {
            var runtimeHome = Environment.GetEnvironmentVariable(EnvironmentNames.Home);

            if (string.IsNullOrEmpty(runtimeHome))
            {
                var runtimeGlobalPath = DnuEnvironment.GetFolderPath(DnuFolderPath.DnxGlobalPath);
                var userRuntimeFolder = DnuEnvironment.GetFolderPath(DnuFolderPath.DefaultDnxHome);

                runtimeHome = $"{userRuntimeFolder};{runtimeGlobalPath}";
            }

            foreach (var probePath in runtimeHome.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
            {
                string fullPath = Environment.ExpandEnvironmentVariables(probePath);

                if (Directory.Exists(fullPath))
                {
                    return(fullPath);
                }
            }

            return(null);
        }