Пример #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
        private static void SynchronizeAll()
        {
            var dontSynchronizeProject = The.Workspace.ProjectJson["DontSynchronizeProject"] as bool?;

            if (dontSynchronizeProject != null && dontSynchronizeProject.Value)
            {
                return;
            }

            foreach (var target in The.Workspace.Targets)
            {
                var platform = target.Platform;
                var limeProj = The.Workspace.GetLimeCsprojFilePath(platform);
                CsprojSynchronization.SynchronizeProject(limeProj);
                var dirInfo = new System.IO.DirectoryInfo(The.Workspace.ProjectDirectory);
                foreach (var fileInfo in dirInfo.GetFiles("*" + The.Workspace.GetPlatformSuffix(platform) + ".csproj", SearchOption.AllDirectories))
                {
                    CsprojSynchronization.SynchronizeProject(fileInfo.FullName);
                }
                if (target.ProjectPath != null)
                {
                    foreach (var targetCsprojFile in dirInfo.GetFiles(Path.GetFileName(target.ProjectPath), SearchOption.AllDirectories))
                    {
                        CsprojSynchronization.SynchronizeProject(targetCsprojFile.FullName);
                    }
                }
            }
        }
Пример #3
0
        public static void SaveCodeCookerCache(CodeCookerCache codeCookerCache)
        {
            codeCookerCache.GeneratedProjectFileToModificationDate.Clear();
            using (new DirectoryChanger(The.Workspace.ProjectDirectory)) {
                var projectName = The.Workspace.ProjectName;
                foreach (var platform in Enum.GetValues(typeof(TargetPlatform)))
                {
                    var platformName = Enum.GetName(typeof(TargetPlatform), platform);
                    var projectPath  = $"{projectName}.{The.Workspace.GeneratedScenesPath}/{projectName}.GeneratedScenes.{platformName}.csproj";
                    if (File.Exists(projectPath))
                    {
                        CsprojSynchronization.SynchronizeProject(projectPath);
                        codeCookerCache.GeneratedProjectFileToModificationDate.Add(projectPath, File.GetLastWriteTime(projectPath));
                    }
                }
            }
            var codeCookerCachePath = GetCodeCachePath();

            Directory.CreateDirectory(Path.GetDirectoryName(codeCookerCachePath));
            using (FileStream stream = new FileStream(codeCookerCachePath, FileMode.Create, FileAccess.Write, FileShare.None)) {
                var js = new Yuzu.Json.JsonSerializer();
                js.ToStream(codeCookerCache, stream);
            }
        }