diff --git a/NanaBox.RefreshPackageVersion/Program.cs b/NanaBox.RefreshPackageVersion/Program.cs index 6bb36e4..cf46a77 100644 --- a/NanaBox.RefreshPackageVersion/Program.cs +++ b/NanaBox.RefreshPackageVersion/Program.cs @@ -115,12 +115,66 @@ static void SwitchDevelopmentChannel() } } + static void GenerateAppxManifestResourceIdentifies() + { + string FilePath = string.Format( + @"{0}\NanaBoxPackage\Package.appxmanifest", + RepositoryRoot); + + string Content = File.ReadAllText(FilePath); + + string PreviousContent = string.Empty; + { + string StartString = " \r\n"; + string EndString = " "; + + int Start = Content.IndexOf(StartString) + StartString.Length; + int End = Content.IndexOf(EndString); + + PreviousContent = Content.Substring(Start, End - Start); + } + + if (string.IsNullOrEmpty(PreviousContent)) + { + return; + } + + string NewContent = string.Empty; + { + DirectoryInfo Folder = new DirectoryInfo(string.Format( + @"{0}\NanaBox\Strings", + RepositoryRoot)); + foreach (var item in Folder.GetDirectories()) + { + NewContent += string.Format( + " \r\n", + item.Name); + } + + int[] Scales = [ 100, 125, 150, 200, 400 ]; + foreach (var Scale in Scales) + { + NewContent += string.Format( + " \r\n", + Scale.ToString()); + } + } + + FileUtilities.SaveTextToFileAsUtf8Bom( + FilePath, + File.ReadAllText(FilePath).Replace( + PreviousContent, + NewContent)); + } + static void Main(string[] args) { RefreshAppxManifestVersion(); SwitchDevelopmentChannel(); + GenerateAppxManifestResourceIdentifies(); + Console.WriteLine( "NanaBox.RefreshPackageVersion task has been completed."); Console.ReadKey();