static void Main(string[] args) { var strategy = VersionStrategy.None; var custom = ""; var testVersion = ""; var optionSet = new OptionSet { { "h|?|help", s => PrintUsageAndExit() }, { "workspace=", s => Environment.CurrentDirectory = s }, { "test", s => _commitChanges = false }, { "test-with=|testwith=", s => testVersion = s }, { "v|version|p|print", s => _printCurrentVersion = true }, { "id|version-id", s => _printCurrentVersionId = true }, { "strategy=", s => strategy = VersionStrategyParser.Parse(s) }, { "custom=", s => custom = s }, { "infinite|no-limit", s => _limit10 = false } }; optionSet.Parse(args); var overrideCurrentVersion = !string.IsNullOrWhiteSpace(testVersion); if (overrideCurrentVersion) { _commitChanges = false; } if (!_commitChanges && !IsPrintAndExit) { Console.WriteLine("TEST RUN - changes will NOT be written to disk"); } if (!string.IsNullOrWhiteSpace(custom)) { strategy = VersionStrategy.Custom; } var currentVersion = overrideCurrentVersion ? Version.Parse(testVersion) : CurrentVersion; var newVersion = strategy == VersionStrategy.Custom ? Version.Parse(custom) : Bump(currentVersion, strategy); if (_printCurrentVersion) { PrintCurrentVersionAndExit(currentVersion); } if (_printCurrentVersionId) { PrintCurrentVersionIdAndExit(currentVersion); } foreach (var filePath in VersionUtils.Files.Where(File.Exists)) { VersionUtils.SetVersion(filePath, newVersion, _commitChanges); } Console.WriteLine("{0} => {1}", currentVersion, newVersion); }
/** * Set translated text into labels */ private void SetTextTitles() { UiUtils.SetResourceText("ScreenTitleSettings", StringIds.IdSettingsTitle); UiUtils.SetResourceText("LanguageLabelSettings", StringIds.IdSettingsLanguageTitle); UiUtils.SetResourceText("GraphicsLabelSettings", StringIds.IdSettingsGraphicsTitle); UiUtils.SetResourceText("RoadObjectsLabelSettings", StringIds.IdSettingsRoadObjectsTitle); UiUtils.SetResourceText("TreesLabelSettings", StringIds.IdSettingsTreesTitle); UiUtils.SetResourceText("ModelLabelSettings", StringIds.IdSettingsModelsTitle); UiUtils.SetResourceText("ModelTypeLabelSettings", StringIds.IdSettingsModelsLoadingStorageTitle); UiUtils.SetResourceText("ShowTutorialLabel", StringIds.IdSettingsTutorialTitle); UiUtils.SetResourceText("TerrainLabelSettings", StringIds.IdSettingsTerrainTitle); UiUtils.SetResourceText("InfoTreesText", StringIds.IdSettingsTreesInfo); UiUtils.SetResourceText("InfoTerrainText", StringIds.IdSettingsTerrainInfo); VersionUtils.SetVersion(); }