Ejemplo n.º 1
0
        public Project Parse(string path)
        {
            var directory   = _pathReader.GetDirectoryName(path);
            var sourceFiles = new List <SourceFile>();

            _xmlReader.Create(path);

            while (_xmlReader.ReadToFollowing("ClCompile"))
            {
                var baseDirectory = directory;
                var filePath      = _xmlReader.GetAttribute("Include");

                if (string.IsNullOrWhiteSpace(filePath))
                {
                    continue;
                }

                filePath = _pathReader.GetFullPath(filePath, baseDirectory);
                sourceFiles.Add(new SourceFile(filePath)
                {
                    Repository = _repositoryRegistry.GetRepositoryFromPath(filePath)
                });
            }

            return(new Project(path, sourceFiles));
        }
Ejemplo n.º 2
0
        public Project Parse(string path)
        {
            var directory   = _pathReader.GetDirectoryName(path);
            var sourceFiles = new List <SourceFile>();

            _xmlReader.Create(path);

            while (_xmlReader.ReadToFollowing("File"))
            {
                var baseDirectory = directory;
                var filePath      = _xmlReader.GetAttribute("RelativePath");
                filePath = _pathReader.GetFullPath(filePath, baseDirectory);
                sourceFiles.Add(new SourceFile(filePath)
                {
                    Repository = _repositoryRegistry.GetRepositoryFromPath(filePath)
                });
            }

            return(new Project(path, sourceFiles));
        }