Beispiel #1
0
        private string GetTemplate(string templateFileName)
        {
            var path     = Path.Combine(ResourceDirectory, templateFileName);
            var resource = _filesystem.ReadFile(path);

            return(resource);
        }
        private Project ParseProject(RelPath projectFilePath, RelPath root)
        {
            _logger.LogWarning("Parsing project at {path}", projectFilePath.Path);
            var projectFileXml = XElement.Parse(_filesystem.ReadFile(projectFilePath.Path));

            var projectFolder = projectFilePath.Parent;

            var otherProjects = projectFileXml
                                .Descendants("ProjectReference")
                                .Select(x => x.Attribute("Include").Value)
                                .Select(x => RelPath.FromString(x).RelativeTo(projectFolder).RelativeTo(root))
                                .Select(x => ParseProject(x, root))
                                .ToArray();

            return(new Project(projectFilePath, otherProjects));
        }