Пример #1
0
        private static void SynchronizeAll()
        {
            var dontSynchronizeProject = The.Workspace.ProjectJson["DontSynchronizeProject"] as bool?;

            if (dontSynchronizeProject != null && dontSynchronizeProject.Value)
            {
                return;
            }
            var fileEnumerator = new ScanOptimizedFileEnumerator(
                The.Workspace.ProjectDirectory,
                CsprojSynchronization.SkipUnwantedDirectoriesPredicate,
                cutDirectoryPrefix: false
                );

            foreach (var target in The.Workspace.Targets)
            {
                var limeProj = CsprojSynchronization.ToUnixSlashes(The.Workspace.GetLimeCsprojFilePath(target.Platform));
                CsprojSynchronization.SynchronizeProject(limeProj);
                using (new DirectoryChanger(The.Workspace.ProjectDirectory)) {
                    var dirInfo = new System.IO.DirectoryInfo(The.Workspace.ProjectDirectory);
                    foreach (var fileInfo in fileEnumerator.Enumerate(The.Workspace.GetPlatformSuffix(target.Platform) + ".csproj"))
                    {
                        CsprojSynchronization.SynchronizeProject(fileInfo.Path);
                    }
                    ;
                    if (target.ProjectPath != null)
                    {
                        foreach (var targetCsprojFile in fileEnumerator.Enumerate(Path.GetFileName(target.ProjectPath)))
                        {
                            CsprojSynchronization.SynchronizeProject(targetCsprojFile.Path);
                        }
                    }
                }
            }
        }
Пример #2
0
        public void Rescan()
        {
            files.Clear();
            var dirInfo = new DirectoryInfo(Directory);
            var queue   = new Queue <DirectoryInfo>();

            queue.Enqueue(new DirectoryInfo(Directory));
            while (queue.Count != 0)
            {
                var rootDirectoryInfo = queue.Dequeue();
                foreach (var fileInfo in rootDirectoryInfo.EnumerateFiles())
                {
                    var file = fileInfo.FullName;
                    if (cutDirectoryPrefix)
                    {
                        file = file.Remove(0, dirInfo.FullName.Length + 1);
                    }
                    file = CsprojSynchronization.ToUnixSlashes(file);
                    files.Add(new FileInfo {
                        Path = file, LastWriteTime = fileInfo.LastWriteTime
                    });
                }
                foreach (var directoryInfo in rootDirectoryInfo.EnumerateDirectories())
                {
                    if (scanFilter?.Invoke(directoryInfo) ?? true)
                    {
                        queue.Enqueue(directoryInfo);
                    }
                }
            }
            // According to documentation the file order is not guaranteed.
            files.Sort((a, b) => string.Compare(a.Path, b.Path));
        }
Пример #3
0
        public void Rescan()
        {
            files.Clear();
            var dirInfo = new DirectoryInfo(Directory);
            var queue   = new Queue <DirectoryInfo>();

            queue.Enqueue(new DirectoryInfo(Directory));
            while (queue.Count != 0)
            {
                var rootDirectoryInfo = queue.Dequeue();
                foreach (var fileInfo in rootDirectoryInfo.EnumerateFiles())
                {
                    var file = fileInfo.FullName;
                    if (cutDirectoryPrefix)
                    {
                        file = file.Remove(0, dirInfo.FullName.Length + 1);
                    }
                    file = CsprojSynchronization.ToUnixSlashes(file);
                    files.Add(new FileInfo {
                        Path = file, LastWriteTime = fileInfo.LastWriteTime
                    });
                }
                foreach (var directoryInfo in rootDirectoryInfo.EnumerateDirectories())
                {
                    if (scanFilter(directoryInfo))
                    {
                        queue.Enqueue(directoryInfo);
                    }
                }
            }
        }
Пример #4
0
        public void Rescan()
        {
            files.Clear();
            var dirInfo = new DirectoryInfo(Directory);

            foreach (var fileInfo in dirInfo.GetFiles("*.*", SearchOption.AllDirectories))
            {
                var file = fileInfo.FullName;
                if (file.Contains(".svn"))
                {
                    continue;
                }
                file = file.Remove(0, dirInfo.FullName.Length + 1);
                file = CsprojSynchronization.ToUnixSlashes(file);
                files.Add(new FileInfo {
                    Path = file, LastWriteTime = fileInfo.LastWriteTime
                });
            }
        }
Пример #5
0
        public void Rescan()
        {
            files.Clear();
            var dirInfo = new DirectoryInfo(Directory);

            foreach (var fileInfo in dirInfo.GetFiles("*.*", SearchOption.AllDirectories))
            {
                var file = fileInfo.FullName;
                if (file.Contains(".svn"))
                {
                    continue;
                }
                file = file.Remove(0, dirInfo.FullName.Length + 1);
                file = CsprojSynchronization.ToUnixSlashes(file);
                files.Add(new FileInfo {
                    Path = file, LastWriteTime = fileInfo.LastWriteTime
                });
            }
            // According to documentation the file order is not guaranteed.
            files.Sort((a, b) => string.Compare(a.Path, b.Path));
        }