public void BumpAssemblyFile() { WXSBumper.BumpIt(new FileInfo(@".\TestInputs\Project3\Product.wxs"), 9, 9, 9, 9); string content = new FileInfo(@".\TestInputs\Project3\Product.wxs").OpenText().ReadToEnd(); Assert.IsTrue(content.Contains(@"Version=""9.9.9.9""")); }
public void BumpProductWXS() { string input = @"<Product Id=""9FD5BFCE-4B47-4CD0-9400-350C0C2A4E10"" Name=""GCS.StandardCosting.CentralService.Setup"" Language=""1033"" Version=""2.0.0.2"" Manufacturer=""GCS.StandardCosting.CentralService.Setup"" UpgradeCode=""D3FB2C99-0BC2-4BFA-914C-DD49CC628F70""> <Package InstallerVersion=""200"" Compressed=""yes"" /> <Media Id=""1"" Cabinet=""media1.cab"" EmbedCab=""yes"" />" ; input = WXSBumper.BumpIt(input, 9, 9, 9, 9); Assert.IsTrue(input.Contains(@"Version=""9.9.9.9""")); }
/// <summary> /// Bumps it. /// </summary> /// <param name="srcDir">The SRC dir.</param> /// <param name="major">The major.</param> /// <param name="minor">The minor.</param> /// <param name="build">The build.</param> /// <param name="revision">The revision.</param> public static void BumpIt(DirectoryInfo srcDir, int major, int minor, int build, int revision) { foreach (FileInfo fi in FileSearcher.SearchForfiles(srcDir)) { switch (fi.Extension) { case ".cs": if (fi.Name == "AssemblyInfo.cs") { AssemblyBumper.BumpIt(fi, major, minor, build, revision); } break; case ".wxs": WXSBumper.BumpIt(fi, major, minor, build, revision); break; default: throw new Exception("can not handle such a file yet: " + fi.Name); } } }