Beispiel #1
0
        static private JadeCore.Project.IProject Read(string name, StreamReader reader, FilePath projectPath, IFileService fileService)
        {
            IProject project = new JadeCore.Project.Project(name, projectPath);

            while (!reader.EndOfStream)
            {
                string line = reader.ReadLine();
                Match match = Regex.Match(line, _compileLineRegex);
                if (match.Success)
                {
                    string itemPath = match.Groups[1].Value;
                    itemPath = JadeUtils.IO.PathUtils.CombinePaths(projectPath.Directory, itemPath);
                    project.AddItem(null, new JadeCore.Project.FileItem(fileService.MakeFileHandle(itemPath)));
                    continue;
                }
                match = Regex.Match(line, _includeLineRegex);
                if (match.Success)
                {
                    string itemPath = match.Groups[1].Value;
                    itemPath = JadeUtils.IO.PathUtils.CombinePaths(projectPath.Directory, itemPath);
                    project.AddItem(null, new JadeCore.Project.FileItem(fileService.MakeFileHandle(itemPath)));
                    continue;
                }
            }            
            return project;
        }
Beispiel #2
0
 private static JadeCore.Project.IItem MakeFile(string projectDir, FileType xml, IFileService fileService)
 {
     string path = xml.Path;
     if (System.IO.Path.IsPathRooted(path) == false)
     {
         //Convert from relative path stored in project xml file
         path = System.IO.Path.Combine(projectDir, path);                
     }
     return new JadeCore.Project.FileItem(fileService.MakeFileHandle(path));
 }