選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

MultiProjectIncrementalTests.java 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. /* *******************************************************************
  2. * Copyright (c) 2005 Contributors.
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * Andy Clement initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.systemtest.incremental.tools;
  13. import java.io.DataOutputStream;
  14. import java.io.File;
  15. import java.io.FileOutputStream;
  16. import java.io.IOException;
  17. import java.util.ArrayList;
  18. import java.util.Iterator;
  19. import java.util.List;
  20. import org.aspectj.ajdt.internal.core.builder.AjState;
  21. import org.aspectj.ajdt.internal.core.builder.IncrementalStateManager;
  22. import org.aspectj.asm.AsmManager;
  23. import org.aspectj.asm.IProgramElement;
  24. import org.aspectj.bridge.IMessage;
  25. import org.aspectj.testing.util.FileUtil;
  26. /**
  27. * The superclass knows all about talking through Ajde to the compiler.
  28. * The superclass isn't in charge of knowing how to simulate overlays
  29. * for incremental builds, that is in here. As is the ability to
  30. * generate valid build configs based on a directory structure. To
  31. * support this we just need access to a sandbox directory - this
  32. * sandbox is managed by the superclass (it only assumes all builds occur
  33. * in <sandboxDir>/<projectName>/ )
  34. *
  35. * The idea is you can initialize multiple projects in the sandbox and
  36. * they can all be built independently, hopefully exploiting
  37. * incremental compilation. Between builds you can alter the contents
  38. * of a project using the alter() method that overlays some set of
  39. * new files onto the current set (adding new files/changing existing
  40. * ones) - you can then drive a new build and check it behaves as
  41. * expected.
  42. */
  43. public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
  44. private static boolean VERBOSE = false;
  45. protected void setUp() throws Exception {
  46. super.setUp();
  47. AjdeInteractionTestbed.VERBOSE = VERBOSE;
  48. }
  49. // Compile a single simple project
  50. public void testTheBasics() {
  51. initialiseProject("P1");
  52. build("P1"); // This first build will be batch
  53. build("P1");
  54. checkWasntFullBuild();
  55. checkCompileWeaveCount(0,0);
  56. }
  57. // Make simple changes to a project, adding a class
  58. public void testSimpleChanges() {
  59. initialiseProject("P1");
  60. build("P1"); // This first build will be batch
  61. alter("P1","inc1"); // adds a single class
  62. build("P1");
  63. checkCompileWeaveCount(1,-1);
  64. build("P1");
  65. checkCompileWeaveCount(0,-1);
  66. }
  67. // Make simple changes to a project, adding a class and an aspect
  68. public void testAddingAnAspect() {
  69. initialiseProject("P1");
  70. build("P1");
  71. alter("P1","inc1"); // adds a class
  72. alter("P1","inc2"); // adds an aspect
  73. build("P1");
  74. long timeTakenForFullBuildAndWeave = getTimeTakenForBuild();
  75. checkWasntFullBuild();
  76. checkCompileWeaveCount(2,3);
  77. build("P1");
  78. long timeTakenForSimpleIncBuild = getTimeTakenForBuild();
  79. // I don't think this test will have timing issues as the times should be *RADICALLY* different
  80. // On my config, first build time is 2093ms and the second is 30ms
  81. assertTrue("Should not take longer for the trivial incremental build! first="+timeTakenForFullBuildAndWeave+
  82. "ms second="+timeTakenForSimpleIncBuild+"ms",
  83. timeTakenForSimpleIncBuild<timeTakenForFullBuildAndWeave);
  84. }
  85. public void testBuildingTwoProjectsInTurns() {
  86. configureBuildStructureModel(true);
  87. initialiseProject("P1");
  88. initialiseProject("P2");
  89. build("P1");
  90. build("P2");
  91. build("P1");
  92. checkWasntFullBuild();
  93. build("P2");
  94. checkWasntFullBuild();
  95. }
  96. /**
  97. * In order for this next test to run, I had to move the weaver/world pair we keep in the
  98. * AjBuildManager instance down into the state object - this makes perfect sense - otherwise
  99. * when reusing the state for another project we'd not be switching to the right weaver/world
  100. * for that project.
  101. */
  102. public void testBuildingTwoProjectsMakingSmallChanges() {
  103. configureBuildStructureModel(true);
  104. initialiseProject("P1");
  105. initialiseProject("P2");
  106. build("P1");
  107. build("P2");
  108. build("P1");
  109. checkWasntFullBuild();
  110. build("P2");
  111. checkWasntFullBuild();
  112. alter("P1","inc1"); // adds a class
  113. alter("P1","inc2"); // adds an aspect
  114. build("P1");
  115. checkWasntFullBuild();
  116. }
  117. /**
  118. * Setup up two simple projects and build them in turn - check the
  119. * structure model is right after each build
  120. */
  121. public void testBuildingTwoProjectsAndVerifyingModel() {
  122. configureBuildStructureModel(true);
  123. initialiseProject("P1");
  124. initialiseProject("P2");
  125. build("P1");
  126. checkForNode("pkg","C",true);
  127. build("P2");
  128. checkForNode("pkg","C",false);
  129. build("P1");
  130. checkForNode("pkg","C",true);
  131. build("P2");
  132. checkForNode("pkg","C",false);
  133. }
  134. // Setup up two simple projects and build them in turn - check the
  135. // structure model is right after each build
  136. public void testBuildingTwoProjectsAndVerifyingStuff() {
  137. configureBuildStructureModel(true);
  138. initialiseProject("P1");
  139. initialiseProject("P2");
  140. build("P1");
  141. checkForNode("pkg","C",true);
  142. build("P2");
  143. checkForNode("pkg","C",false);
  144. build("P1");
  145. checkForNode("pkg","C",true);
  146. build("P2");
  147. checkForNode("pkg","C",false);
  148. }
  149. /**
  150. * Complex. Here we are testing that a state object records structural changes since
  151. * the last full build correctly. We build a simple project from scratch - this will
  152. * be a full build and so the structural changes since last build count should be 0.
  153. * We then alter a class, adding a new method and check structural changes is 1.
  154. */
  155. public void testStateManagement1() {
  156. File binDirectoryForP1 = new File(getFile("P1","bin"));
  157. initialiseProject("P1");
  158. build("P1"); // full build
  159. AjState ajs = IncrementalStateManager.findStateManagingOutputLocation(binDirectoryForP1);
  160. assertTrue("There should be a state object for project P1",ajs!=null);
  161. assertTrue("Should be no structural changes as it was a full build but found: "+
  162. ajs.getNumberOfStructuralChangesSinceLastFullBuild(),
  163. ajs.getNumberOfStructuralChangesSinceLastFullBuild()==0);
  164. alter("P1","inc3"); // adds a method to the class C.java
  165. build("P1");
  166. checkWasntFullBuild();
  167. ajs = IncrementalStateManager.findStateManagingOutputLocation(new File(getFile("P1","bin")));
  168. assertTrue("There should be state for project P1",ajs!=null);
  169. checkWasntFullBuild();
  170. assertTrue("Should be one structural changes as it was a full build but found: "+
  171. ajs.getNumberOfStructuralChangesSinceLastFullBuild(),
  172. ajs.getNumberOfStructuralChangesSinceLastFullBuild()==1);
  173. }
  174. /**
  175. * Complex. Here we are testing that a state object records structural changes since
  176. * the last full build correctly. We build a simple project from scratch - this will
  177. * be a full build and so the structural changes since last build count should be 0.
  178. * We then alter a class, changing body of a method, not the structure and
  179. * check struc changes is still 0.
  180. */
  181. public void testStateManagement2() {
  182. File binDirectoryForP1 = new File(getFile("P1","bin"));
  183. initialiseProject("P1");
  184. alter("P1","inc3"); // need this change in here so 'inc4' can be applied without making
  185. // it a structural change
  186. build("P1"); // full build
  187. AjState ajs = IncrementalStateManager.findStateManagingOutputLocation(binDirectoryForP1);
  188. assertTrue("There should be state for project P1",ajs!=null);
  189. assertTrue("Should be no struc changes as its a full build: "+
  190. ajs.getNumberOfStructuralChangesSinceLastFullBuild(),
  191. ajs.getNumberOfStructuralChangesSinceLastFullBuild()==0);
  192. alter("P1","inc4"); // changes body of main() method but does *not* change the structure of C.java
  193. build("P1");
  194. checkWasntFullBuild();
  195. ajs = IncrementalStateManager.findStateManagingOutputLocation(new File(getFile("P1","bin")));
  196. assertTrue("There should be state for project P1",ajs!=null);
  197. checkWasntFullBuild();
  198. assertTrue("Shouldn't be any structural changes but there were "+
  199. ajs.getNumberOfStructuralChangesSinceLastFullBuild(),
  200. ajs.getNumberOfStructuralChangesSinceLastFullBuild()==0);
  201. }
  202. /**
  203. * Now the most complex test. Create a dependancy between two projects. Building
  204. * one may affect whether the other does an incremental or full build. The
  205. * structural information recorded in the state object should be getting used
  206. * to control whether a full build is necessary...
  207. */
  208. public void testBuildingDependantProjects() {
  209. initialiseProject("P1");
  210. initialiseProject("P2");
  211. configureNewProjectDependency("P2","P1");
  212. build("P1");
  213. build("P2"); // now everything is consistent and compiled
  214. alter("P1","inc1"); // adds a second class
  215. build("P1");
  216. build("P2"); // although a second class was added - P2 can't be using it, so we don't full build here :)
  217. checkWasntFullBuild();
  218. alter("P1","inc3"); // structurally changes one of the classes
  219. build("P1");
  220. build("P2"); // build notices the structural change
  221. checkWasFullBuild();
  222. alter("P1","inc4");
  223. build("P1");
  224. build("P2"); // build sees a change but works out its not structural
  225. checkWasntFullBuild();
  226. }
  227. public void testPr85132() {
  228. initialiseProject("PR85132");
  229. build("PR85132");
  230. alter("PR85132","inc1");
  231. build("PR85132");
  232. }
  233. public void testPr92837() {
  234. initialiseProject("PR92837");
  235. build("PR92837");
  236. alter("PR92837","inc1");
  237. build("PR92837");
  238. }
  239. public void testPr119570() {
  240. initialiseProject("PR119570");
  241. build("PR119570");
  242. assertTrue("Should be no errors, but got "+MyTaskListManager.getErrorMessages(),MyTaskListManager.getErrorMessages().size()==0);
  243. }
  244. public void testPr119570_2() {
  245. initialiseProject("PR119570_2");
  246. build("PR119570_2");
  247. List l = MyTaskListManager.getWarningMessages();
  248. assertTrue("Should be no warnings, but got "+l,l.size()==0);
  249. }
  250. // If you fiddle with the compiler options - you must manually reset the options at the end of the test
  251. public void testPr117209() {
  252. try {
  253. initialiseProject("pr117209");
  254. configureNonStandardCompileOptions("-proceedOnError");
  255. build("pr117209");
  256. checkCompileWeaveCount(6,6);
  257. } finally {
  258. MyBuildOptionsAdapter.reset();
  259. }
  260. }
  261. public void testPr114875() {
  262. initialiseProject("pr114875");
  263. build("pr114875");
  264. alter("pr114875","inc1");
  265. build("pr114875");
  266. checkWasntFullBuild();
  267. alter("pr114875","inc2");
  268. build("pr114875");
  269. checkWasntFullBuild();
  270. }
  271. public void testPr117882() {
  272. // AjdeInteractionTestbed.VERBOSE=true;
  273. // AjdeInteractionTestbed.configureBuildStructureModel(true);
  274. initialiseProject("PR117882");
  275. build("PR117882");
  276. checkWasFullBuild();
  277. alter("PR117882","inc1");
  278. build("PR117882");
  279. checkWasntFullBuild();
  280. // AjdeInteractionTestbed.VERBOSE=false;
  281. // AjdeInteractionTestbed.configureBuildStructureModel(false);
  282. }
  283. public void testPr117882_2() {
  284. // AjdeInteractionTestbed.VERBOSE=true;
  285. // AjdeInteractionTestbed.configureBuildStructureModel(true);
  286. initialiseProject("PR117882_2");
  287. build("PR117882_2");
  288. checkWasFullBuild();
  289. alter("PR117882_2","inc1");
  290. build("PR117882_2");
  291. checkWasntFullBuild();
  292. //checkCompileWeaveCount(1,4);
  293. //fullBuild("PR117882_2");
  294. //checkWasFullBuild();
  295. // AjdeInteractionTestbed.VERBOSE=false;
  296. // AjdeInteractionTestbed.configureBuildStructureModel(false);
  297. }
  298. public void testPr115251() {
  299. //AjdeInteractionTestbed.VERBOSE=true;
  300. initialiseProject("PR115251");
  301. build("PR115251");
  302. checkWasFullBuild();
  303. alter("PR115251","inc1");
  304. build("PR115251");
  305. checkWasntFullBuild();
  306. }
  307. public void testPr121384() {
  308. // AjdeInteractionTestbed.VERBOSE=true;
  309. // AsmManager.setReporting("c:/foo.txt",true,true,true,false);
  310. MyBuildOptionsAdapter.setNonStandardOptions("-showWeaveInfo");
  311. configureBuildStructureModel(true);
  312. initialiseProject("pr121384");
  313. build("pr121384");
  314. checkWasFullBuild();
  315. alter("pr121384","inc1");
  316. build("pr121384");
  317. checkWasntFullBuild();
  318. }
  319. /* public void testPr111779() {
  320. super.VERBOSE=true;
  321. initialiseProject("PR111779");
  322. build("PR111779");
  323. alter("PR111779","inc1");
  324. build("PR111779");
  325. }
  326. */
  327. public void testPr93310_1() {
  328. initialiseProject("PR93310_1");
  329. build("PR93310_1");
  330. checkWasFullBuild();
  331. String fileC2 = getWorkingDir().getAbsolutePath() + File.separatorChar + "PR93310_1" + File.separatorChar + "src" + File.separatorChar + "pack" + File.separatorChar + "C2.java";
  332. (new File(fileC2)).delete();
  333. alter("PR93310_1","inc1");
  334. build("PR93310_1");
  335. checkWasFullBuild();
  336. int l = AjdeInteractionTestbed.MyStateListener.detectedDeletions.size();
  337. assertTrue("Expected one deleted file to be noticed, but detected: "+l,l==1);
  338. String name = (String)AjdeInteractionTestbed.MyStateListener.detectedDeletions.get(0);
  339. assertTrue("Should end with C2.java but is "+name,name.endsWith("C2.java"));
  340. }
  341. public void testPr93310_2() {
  342. initialiseProject("PR93310_2");
  343. build("PR93310_2");
  344. checkWasFullBuild();
  345. String fileC2 = getWorkingDir().getAbsolutePath() + File.separatorChar + "PR93310_2" + File.separatorChar + "src" + File.separatorChar + "pack" + File.separatorChar + "C2.java";
  346. (new File(fileC2)).delete();
  347. alter("PR93310_2","inc1");
  348. build("PR93310_2");
  349. checkWasFullBuild();
  350. int l = AjdeInteractionTestbed.MyStateListener.detectedDeletions.size();
  351. assertTrue("Expected one deleted file to be noticed, but detected: "+l,l==1);
  352. String name = (String)AjdeInteractionTestbed.MyStateListener.detectedDeletions.get(0);
  353. assertTrue("Should end with C2.java but is "+name,name.endsWith("C2.java"));
  354. }
  355. // Stage1: Compile two files, pack.A and pack.A1 - A1 sets a protected field in A.
  356. // Stage2: make the field private in class A > gives compile error
  357. // Stage3: Add a new aspect whilst there is a compile error !
  358. public void testPr113531() {
  359. initialiseProject("PR113531");
  360. build("PR113531");
  361. assertFalse("build should have compiled ok",
  362. MyTaskListManager.hasErrorMessages());
  363. alter("PR113531","inc1");
  364. build("PR113531");
  365. assertEquals("error message should be 'foo cannot be resolved' ",
  366. "foo cannot be resolved",
  367. ((IMessage)MyTaskListManager.getErrorMessages().get(0))
  368. .getMessage());
  369. alter("PR113531","inc2");
  370. build("PR113531");
  371. assertTrue("There should be no exceptions handled:\n"+MyErrorHandler.getErrorMessages(),
  372. MyErrorHandler.getErrorMessages().isEmpty());
  373. assertEquals("error message should be 'foo cannot be resolved' ",
  374. "foo cannot be resolved",
  375. ((IMessage)MyTaskListManager.getErrorMessages().get(0))
  376. .getMessage());
  377. }
  378. public void testPr112736() {
  379. AjdeInteractionTestbed.VERBOSE = true;
  380. initialiseProject("PR112736");
  381. build("PR112736");
  382. checkWasFullBuild();
  383. String fileC2 = getWorkingDir().getAbsolutePath() + File.separatorChar + "PR112736" + File.separatorChar + "src" + File.separatorChar + "pack" + File.separatorChar + "A.java";
  384. (new File(fileC2)).delete();
  385. alter("PR112736","inc1");
  386. build("PR112736");
  387. checkWasFullBuild();
  388. }
  389. /**
  390. * We have problems with multiple rewrites of a pointcut across incremental builds.
  391. */
  392. public void testPr113257() {
  393. initialiseProject("PR113257");
  394. build("PR113257");
  395. alter("PR113257","inc1");
  396. build("PR113257");
  397. checkWasntFullBuild();
  398. alter("PR113257","inc1");
  399. build("PR113257");
  400. }
  401. // other possible tests:
  402. // - memory usage (freemem calls?)
  403. // - relationship map
  404. // ---------------------------------------------------------------------------------------------------
  405. /**
  406. * Check we compiled/wove the right number of files, passing '-1' indicates you don't care about
  407. * that number.
  408. */
  409. private void checkCompileWeaveCount(int expCompile,int expWoven) {
  410. if (expCompile!=-1 && getCompiledFiles().size()!=expCompile)
  411. fail("Expected compilation of "+expCompile+" files but compiled "+getCompiledFiles().size()+
  412. "\n"+printCompiledAndWovenFiles());
  413. if (expWoven!=-1 && getWovenClasses().size()!=expWoven)
  414. fail("Expected weaving of "+expWoven+" files but wove "+getWovenClasses().size()+
  415. "\n"+printCompiledAndWovenFiles());
  416. }
  417. private void checkWasntFullBuild() {
  418. assertTrue("Shouldn't have been a full (batch) build",!wasFullBuild());
  419. }
  420. private void checkWasFullBuild() {
  421. assertTrue("Should have been a full (batch) build",wasFullBuild());
  422. }
  423. private void checkForNode(String packageName,String typeName,boolean shouldBeFound) {
  424. IProgramElement ipe = AsmManager.getDefault().getHierarchy().findElementForType(packageName,typeName);
  425. if (shouldBeFound) {
  426. if (ipe==null) printModel();
  427. assertTrue("Should have been able to find '"+packageName+"."+typeName+"' in the asm",ipe!=null);
  428. } else {
  429. if (ipe!=null) printModel();
  430. assertTrue("Should have NOT been able to find '"+packageName+"."+typeName+"' in the asm",ipe==null);
  431. }
  432. }
  433. private void printModel() {
  434. try {
  435. AsmManager.dumptree(AsmManager.getDefault().getHierarchy().getRoot(),0);
  436. } catch (IOException e) {
  437. e.printStackTrace();
  438. }
  439. }
  440. public void build(String projectName) {
  441. constructUpToDateLstFile(projectName,"build.lst");
  442. build(projectName,"build.lst");
  443. if (AjdeInteractionTestbed.VERBOSE) printBuildReport();
  444. }
  445. public void fullBuild(String projectName) {
  446. constructUpToDateLstFile(projectName,"build.lst");
  447. fullBuild(projectName,"build.lst");
  448. if (AjdeInteractionTestbed.VERBOSE) printBuildReport();
  449. }
  450. private void constructUpToDateLstFile(String pname,String configname) {
  451. File projectBase = new File(sandboxDir,pname);
  452. File toConstruct = new File(projectBase,configname);
  453. List filesForCompilation = new ArrayList();
  454. collectUpFiles(projectBase,projectBase,filesForCompilation);
  455. try {
  456. FileOutputStream fos = new FileOutputStream(toConstruct);
  457. DataOutputStream dos = new DataOutputStream(fos);
  458. for (Iterator iter = filesForCompilation.iterator(); iter.hasNext();) {
  459. String file = (String) iter.next();
  460. dos.writeBytes(file+"\n");
  461. }
  462. dos.close();
  463. } catch (IOException ioe) {
  464. ioe.printStackTrace();
  465. }
  466. }
  467. private void collectUpFiles(File location,File base,List collectionPoint) {
  468. String contents[] = location.list();
  469. if (contents==null) return;
  470. for (int i = 0; i < contents.length; i++) {
  471. String string = contents[i];
  472. File f = new File(location,string);
  473. if (f.isDirectory()) {
  474. collectUpFiles(f,base,collectionPoint);
  475. } else if (f.isFile() && (f.getName().endsWith(".aj") || f.getName().endsWith(".java"))) {
  476. String fileFound;
  477. try {
  478. fileFound = f.getCanonicalPath();
  479. String toRemove = base.getCanonicalPath();
  480. if (!fileFound.startsWith(toRemove)) throw new RuntimeException("eh? "+fileFound+" "+toRemove);
  481. collectionPoint.add(fileFound.substring(toRemove.length()+1));//+1 captures extra separator
  482. } catch (IOException e) {
  483. e.printStackTrace();
  484. }
  485. }
  486. }
  487. }
  488. /**
  489. * Fill in the working directory with the project base files,
  490. * from the 'base' folder.
  491. */
  492. private void initialiseProject(String p) {
  493. File projectSrc=new File(testdataSrcDir+File.separatorChar+p+File.separatorChar+"base");
  494. File destination=new File(getWorkingDir(),p);
  495. if (!destination.exists()) {destination.mkdir();}
  496. copy(projectSrc,destination);//,false);
  497. }
  498. /*
  499. * Applies an overlay onto the project being tested - copying
  500. * the contents of the specified overlay directory.
  501. */
  502. private void alter(String projectName,String overlayDirectory) {
  503. File projectSrc =new File(testdataSrcDir+File.separatorChar+projectName+
  504. File.separatorChar+overlayDirectory);
  505. File destination=new File(getWorkingDir(),projectName);
  506. copy(projectSrc,destination);
  507. }
  508. /**
  509. * Copy the contents of some directory to another location - the
  510. * copy is recursive.
  511. */
  512. private void copy(File from, File to) {
  513. String contents[] = from.list();
  514. if (contents==null) return;
  515. for (int i = 0; i < contents.length; i++) {
  516. String string = contents[i];
  517. File f = new File(from,string);
  518. File t = new File(to,string);
  519. if (f.isDirectory() && !f.getName().startsWith("inc")) {
  520. t.mkdir();
  521. copy(f,t);
  522. } else if (f.isFile()) {
  523. StringBuffer sb = new StringBuffer();
  524. //if (VERBOSE) System.err.println("Copying "+f+" to "+t);
  525. FileUtil.copyFile(f,t,sb);
  526. if (sb.length()!=0) { System.err.println(sb.toString());}
  527. }
  528. }
  529. }
  530. private static void log(String msg) {
  531. if (VERBOSE) System.out.println(msg);
  532. }
  533. }