//EXPERIMENT! private void cmdMacApplyPatches_Click(object sender, EventArgs e) { throw new NotSupportedException(); //EXPERIMENT! //cef_binary_3.3071.1647 string srcRootDir = @"D:\projects\cef_binary_3.3071.1647.macos\tests"; string patchSrcFolder = "d:\\WImageTest\\cefbridge_patches_mac"; PatchBuilder builder2 = new PatchBuilder(new string[] { srcRootDir, }); builder2.LoadPatchesFromFolder(patchSrcFolder); List <PatchFile> pfiles = builder2.GetAllPatchFiles(); string newPathName = srcRootDir; for (int i = pfiles.Count - 1; i >= 0; --i) { //can change original filename before patch PatchFile pfile = pfiles[i]; string onlyFileName = System.IO.Path.GetFileName(pfile.OriginalFileName); string onlyPath = System.IO.Path.GetDirectoryName(pfile.OriginalFileName); int indexOfCefClient = onlyPath.IndexOf("\\cefclient\\"); if (indexOfCefClient < 0) { indexOfCefClient = onlyPath.IndexOf("\\shared\\"); if (indexOfCefClient < 0) { throw new NotSupportedException(); } } string rightSide = onlyPath.Substring(indexOfCefClient); //string replaceName = onlyPath.Replace("D:\\projects\\cef_binary_3.2623.1399\\cefclient", newPathName); string replaceName = newPathName + rightSide; pfile.OriginalFileName = replaceName + "//" + onlyFileName; pfile.PatchContent(); } ManualPatcher manualPatcher = new ManualPatcher(newPathName); string extTargetDir = newPathName + "\\cefclient\\myext"; //manualPatcher.CopyExtensionSources(extTargetDir); manualPatcher.Do_CefClient_CMake_txt(); }
private void cmdLoadPatchAndApplyPatch_Click(object sender, EventArgs e) { string backup_nativePatcher = _selectedPreSet.Backup_NativePatcher_Folder; string backup_NativePatcher_BridgeBuilder_folder = _selectedPreSet.Backup_NativePatcher_BridgeBuilder; string srcRootDir0 = _cefSrcRootDir; //where is patch folder string cefBridge_PatchFolder = _selectedPreSet.PatchFolder; string org_cefclient_test_folder = srcRootDir0 + "\\tests"; //copy my extension file relative folder to this project FolderUtils.CopyFolder(backup_NativePatcher_BridgeBuilder_folder + @"\Patcher_ExtCode\myext", org_cefclient_test_folder + "\\cefclient"); //copy my extension file FolderUtils.CopyFolder(backup_NativePatcher_BridgeBuilder_folder + @"\Patcher_ExtCode_libcef_dll\myext", srcRootDir0 + "\\libcef_dll"); //----------- ManualPatcher manualPatcher = new ManualPatcher(org_cefclient_test_folder); //1. System.IO.File.Copy(backup_NativePatcher_BridgeBuilder_folder + @"\Patcher_ExtCode_Others\cef_base.h", srcRootDir0 + "\\include\\cef_base.h", true); //2. System.IO.File.Copy(backup_NativePatcher_BridgeBuilder_folder + @"\Patcher_ExtCode_Others\cpptoc_ref_counted.h", srcRootDir0 + "\\libcef_dll\\cpptoc\\cpptoc_ref_counted.h", true); //3. System.IO.File.Copy(backup_NativePatcher_BridgeBuilder_folder + @"\Patcher_ExtCode_Others\ctocpp_ref_counted.h", srcRootDir0 + "\\libcef_dll\\ctocpp\\ctocpp_ref_counted.h", true); //----------- manualPatcher.Do_LibCefDll_CMake_txt(srcRootDir0 + "\\libcef_dll\\CMakeLists.txt"); manualPatcher.Do_CefClient_CMake_txt(); //----------- PatchBuilder builder2 = new PatchBuilder(new string[] { org_cefclient_test_folder, }); builder2.LoadPatchesFromFolder(cefBridge_PatchFolder); List <PatchFile> pfiles = builder2.GetAllPatchFiles(); //string oldPathName = srcRootDir; for (int i = pfiles.Count - 1; i >= 0; --i) { //can change original filename before patch PatchFile pfile = pfiles[i]; string onlyFileName = System.IO.Path.GetFileName(pfile.OriginalFileName); string onlyPath = System.IO.Path.GetDirectoryName(pfile.OriginalFileName); int indexOfCefClient = onlyPath.IndexOf("\\cefclient\\"); if (indexOfCefClient < 0) { indexOfCefClient = onlyPath.IndexOf("\\shared\\"); if (indexOfCefClient < 0) { indexOfCefClient = onlyPath.IndexOf("\\cefclient"); if (indexOfCefClient < 0) { throw new NotSupportedException(); } } } string rightSide = onlyPath.Substring(indexOfCefClient); string replaceName = org_cefclient_test_folder + rightSide; if (onlyFileName.Contains("performance_test.cc")) { } pfile.OriginalFileName = replaceName + "//" + onlyFileName; pfile.PatchContent(); } }
private void cmdLoadPatchAndApplyPatch_Click(object sender, EventArgs e) { //string srcRootDir = @"D:\projects\cef_binary_3.2526.1366" + "\\cefclient"; //2526.1366 //string srcRootDir = @"D:\projects\cef_binary_3.2623.1395" + "\\cefclient"; //2526.1366 //string srcRootDir = @"D:\projects\cef_binary_3.2623.1399" + "\\cefclient"; //2526.1366 //string srcRootDir = @"D:\projects\cef_binary_3.2704.1418"; //string srcRootDir = @"D:\projects\cef_binary_3.2785.1466"; //string srcRootDir = @"D:\projects\cef_binary_3.2883.1548\\tests"; string srcRootDir = @"D:\projects\cef_binary_3.2883.1553\\tests"; string saveFolder = "d:\\WImageTest\\cefbridge_patches"; PatchBuilder builder2 = new PatchBuilder(new string[] { srcRootDir, @"D:\projects\cef_binary_3.2883.1553\\shared" }); builder2.LoadPatchesFromFolder(saveFolder); List <PatchFile> pfiles = builder2.GetAllPatchFiles(); //string oldPathName = srcRootDir; string newPathName = srcRootDir;// "d:\\projects\\CefBridge\\cef3\\cefclient"; for (int i = pfiles.Count - 1; i >= 0; --i) { //can change original filename before patch PatchFile pfile = pfiles[i]; string onlyFileName = System.IO.Path.GetFileName(pfile.OriginalFileName); string onlyPath = System.IO.Path.GetDirectoryName(pfile.OriginalFileName); int indexOfCefClient = onlyPath.IndexOf("\\cefclient\\"); if (indexOfCefClient < 0) { indexOfCefClient = onlyPath.IndexOf("\\shared\\"); if (indexOfCefClient < 0) { throw new NotSupportedException(); } } string rightSide = onlyPath.Substring(indexOfCefClient); //string replaceName = onlyPath.Replace("D:\\projects\\cef_binary_3.2623.1399\\cefclient", newPathName); string replaceName = newPathName + rightSide; pfile.OriginalFileName = replaceName + "//" + onlyFileName; pfile.PatchContent(); } ManualPatcher manualPatcher = new ManualPatcher(newPathName); string extTargetDir = newPathName + "\\cefclient\\myext"; manualPatcher.CopyExtensionSources(extTargetDir); manualPatcher.Do_CMake_txt_New_3_2704_up(); //bool is3_2704 = true; //if (is3_2704) //{ // string extTargetDir = newPathName + "\\cefclient\\myext"; // manualPatcher.CopyExtensionSources(extTargetDir); // manualPatcher.Do_CMake_txt_New_3_2704_up(); //} //else //{ // string extTargetDir = newPathName + "\\myext"; // manualPatcher.CopyExtensionSources(extTargetDir); // manualPatcher.Do_CMake_txt_old(); ; //} }