Changeset 925
- Timestamp:
- Feb 5, 2014, 4:36:27 PM (11 years ago)
- Location:
- java/installer2/src/net/oni2/aeinstaller/backend/oni
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
java/installer2/src/net/oni2/aeinstaller/backend/oni/XMLTools.java
r924 r925 19 19 20 20 /** 21 * Patch the XML files in the path with the patches in the other path21 * Patch XML files with the given patch list 22 22 * 23 * @param folderWithPatches 24 * Path containing patches to apply 25 * @param folderWithXml 26 * Path containing XML files to patch 23 * @param patch 24 * Patchlist file 27 25 * 28 26 * @return XMLTools output 29 27 */ 30 public static ApplicationInvocationResult patch(File folderWithPatches, 31 File folderWithXml) { 28 public static ApplicationInvocationResult patch(File patch) { 32 29 Vector<String> params = new Vector<String>(); 33 // xmlTools.exe --patch-files PATCH --force-target-files TOPATCH 34 params.add("--patch-files " 35 + new File(folderWithPatches, "*.oni-patch").getPath()); 36 params.add("--use-patch-filename " + folderWithXml.getPath()); 30 params.add("--aei-patch-files-list \"" + patch.getPath() + "\""); 37 31 ApplicationInvocationResult res = null; 38 32 try { -
java/installer2/src/net/oni2/aeinstaller/backend/oni/management/Installer.java
r924 r925 7 7 import java.io.IOException; 8 8 import java.io.InputStream; 9 import java.io.PrintWriter; 9 10 import java.text.SimpleDateFormat; 10 11 import java.util.Date; … … 479 480 log.logAppOutput(res, true); 480 481 481 // Apply patches in levelFolderXML 482 File lastFolder = null; 483 for (File f : patches.get(level)) { 484 File pathOfPatch = f.getParentFile(); 485 if (!pathOfPatch.equals(lastFolder)) { 486 lastFolder = pathOfPatch; 487 488 res = XMLTools.patch(pathOfPatch, levelFolderXML); 489 log.logAppOutput(res, false); 490 } 491 } 482 // Create masterpatch file (containing calls to all individual 483 // patches) 484 File masterpatch = new File(levelFolderXML, "masterpatch.txt"); 485 PrintWriter masterpatchWriter = null; 486 try { 487 masterpatchWriter = new PrintWriter(masterpatch); 488 } catch (FileNotFoundException e) { 489 e.printStackTrace(); 490 } 491 for (File patch : patches.get(level)) { 492 String patternWildcard = patch.getName(); 493 patternWildcard = patternWildcard.substring(0, 494 patternWildcard.indexOf(".oni-patch")); 495 patternWildcard = patternWildcard + ".xml"; 496 patternWildcard = patternWildcard.replace('-', '*'); 497 File xmlFilePath = new File(levelFolderXML, patternWildcard); 498 masterpatchWriter.println(String.format("\"%s\" \"%s\"", 499 patch.getPath(), xmlFilePath.getPath())); 500 } 501 masterpatchWriter.close(); 502 // Apply patches through masterpatch in levelFolderXML 503 res = XMLTools.patch(masterpatch); 504 log.logAppOutput(res, false); 492 505 493 506 // Create .oni files from XML
Note:
See TracChangeset
for help on using the changeset viewer.