コード例 #1
0
        private void SmartCleanSdkCompiledScripts()
        {
            Report.Verbose("Smart-cleaning compiled scripts");
            foreach (var filePath in Directory.GetFiles(edition.SdkXComGameCompiledScriptPath))
            {
                var fileName = Path.GetFileName(filePath);
                if (!StandardCompiledScripts.Any(x => string.Equals(x, fileName, StringComparison.OrdinalIgnoreCase)))
                {
                    Report.Verbose($"  Deleting non-standard compiled script file {fileName}", Verbosity.Loquacious);
                    DirectoryHelper.Delete(filePath);
                }
            }

            Report.Verbose("Smart-cleaning compiled script manifest", Verbosity.Loquacious);
            var manifestPath = Path.Combine(edition.SdkXComGameCompiledScriptPath, CompiledScriptManifestName);
            var lines        = File.ReadAllLines(manifestPath).ToList();

            for (var i = 0; i < lines.Count; ++i)
            {
                var line  = lines[i];
                var parts = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                if (parts.Length >= 3)
                {
                    var module = parts[2];
                    if (!StandardManifestModules.Any(x => string.Equals(x, module, StringComparison.OrdinalIgnoreCase)))
                    {
                        Report.Verbose($"  Removing line {line}", Verbosity.Periphrastic);
                        lines.RemoveAt(i);
                        --i;
                    }
                }
            }
            File.WriteAllLines(manifestPath, lines, Program.DefaultEncoding);
        }
コード例 #2
0
 private void CleanModSdkCompiledScripts()
 {
     if (File.Exists(modSdkCompiledScriptPath))
     {
         Report.Verbose("Deleting mod compiled script");
         DirectoryHelper.Delete(modSdkCompiledScriptPath);
     }
 }
コード例 #3
0
 private void CleanModStaging()
 {
     if (Directory.Exists(modStagingPath))
     {
         Report.Verbose($"Cleaning staging folder");
         DirectoryHelper.Delete(modStagingPath);
     }
     else
     {
         Report.Verbose($"Staging is clean");
     }
 }
コード例 #4
0
        private void SmartCleanSdkSourceCode()
        {
            Report.Verbose("Smart-cleaning SDK source");
            foreach (var folderPath in Directory.GetDirectories(edition.SdkSourceCodePath))
            {
                var folderName = Path.GetFileName(folderPath);
                if (!StandardSourceCodeFolderNames.Any(x => string.Equals(x, folderName, StringComparison.OrdinalIgnoreCase)) &&
                    (!Settings.Default.Highlander || !string.Equals(folderName, edition.SdkHighlanderSourceCodeFolderName)))
                {
                    Report.Verbose($"  Deleting non-standard source {folderName}", Verbosity.Loquacious);
                    DirectoryHelper.Delete(folderPath);
                }
            }

            foreach (var filePath in Directory.GetFiles(edition.SdkSourceCodePath))
            {
                Report.Verbose($"  Deleting non-standard file {Path.GetFileName(filePath)}");
                DirectoryHelper.Delete(filePath);
            }
        }
コード例 #5
0
 private void DeployMod()
 {
     Report.Verbose("Deploying mod");
     DirectoryHelper.Delete(modInstallPath);
     DirectoryHelper.CopyDirectory(modStagingPath, modInstallPath);
 }
コード例 #6
0
 private void CleanSdkSourceCode()
 {
     Report.Verbose("Cleaning SDK source");
     DirectoryHelper.Delete(edition.SdkSourceCodePath);
     Directory.CreateDirectory(edition.SdkSourceCodePath);
 }