You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AjdeInteractionTestbed.java 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. /********************************************************************
  2. * Copyright (c) 2005 Contributors.All rights reserved.
  3. * This program and the accompanying materials are made available
  4. * under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution and is available at
  6. * http://eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * Andy Clement initial implementation
  10. * Helen Hawkins Converted to new interface (bug 148190)
  11. *******************************************************************/
  12. package org.aspectj.systemtest.incremental.tools;
  13. import java.io.File;
  14. import java.io.IOException;
  15. import java.util.ArrayList;
  16. import java.util.HashSet;
  17. import java.util.Iterator;
  18. import java.util.List;
  19. import java.util.Map;
  20. import java.util.Set;
  21. import junit.framework.TestCase;
  22. import org.aspectj.ajde.core.AjCompiler;
  23. import org.aspectj.ajde.core.IBuildMessageHandler;
  24. import org.aspectj.ajde.core.ICompilerConfiguration;
  25. import org.aspectj.ajde.core.IOutputLocationManager;
  26. import org.aspectj.ajdt.internal.core.builder.AbstractStateListener;
  27. import org.aspectj.ajdt.internal.core.builder.AjState;
  28. import org.aspectj.ajdt.internal.core.builder.IncrementalStateManager;
  29. import org.aspectj.asm.AsmManager;
  30. import org.aspectj.bridge.IMessage;
  31. import org.aspectj.tools.ajc.Ajc;
  32. /**
  33. * This class uses Ajde in the same way that an IDE (e.g. AJDT) does.
  34. *
  35. * The build is driven through 'doBuild(projectName)' but the build can be configured by the methods beginning 'configure***'.
  36. * Information about what happened during a build is accessible through the get*, was*, print* public methods...
  37. *
  38. */
  39. public class AjdeInteractionTestbed extends TestCase {
  40. public static boolean VERBOSE = false; // do you want the gory details?
  41. public static String testdataSrcDir = "../tests/multiIncremental";
  42. protected static File sandboxDir;
  43. private static boolean buildModel;
  44. // Methods for configuring the build
  45. public void configureNewProjectDependency(String fromProjectName, String projectItDependsOn) {
  46. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + fromProjectName);
  47. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).addDependancy(projectItDependsOn);
  48. }
  49. public void addSourceFolderForSourceFile(String projectName, File f, String sourceFolder) {
  50. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  51. ((MultiProjTestOutputLocationManager) ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration())
  52. .getOutputLocationManager()).setSourceFolderFor(f, sourceFolder);
  53. }
  54. public void setNextChangeResponse(String projName, int flags) {
  55. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projName);
  56. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).changed = flags;
  57. }
  58. public void addProjectSourceFileChanged(String projectName, File changedFile) {
  59. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  60. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).addProjectSourceFileChanged(changedFile);
  61. }
  62. public void addXmlConfigFile(String projectName, String xmlfile) {
  63. List l = new ArrayList();
  64. l.add(xmlfile);
  65. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  66. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setProjectXmlConfigFiles(l);
  67. }
  68. public void addClasspathEntry(String projectName, File classpathEntry) {
  69. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  70. MultiProjTestCompilerConfiguration config = ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration());
  71. config.setClasspath(config.getClasspath() + File.pathSeparator + classpathEntry.toString());
  72. }
  73. public void addClasspathEntryChanged(String projectName, String changedDir) {
  74. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  75. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).addClasspathEntryChanged(changedDir);
  76. }
  77. public void configureNonStandardCompileOptions(String projectName, String options) {
  78. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  79. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setNonStandardOptions(options);
  80. }
  81. public void configureAspectPath(String projectName, Set aspectpath) {
  82. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  83. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setAspectPath(aspectpath);
  84. }
  85. public void configureAspectPath(String projectName, File aspectpath) {
  86. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  87. Set s = new HashSet();
  88. s.add(aspectpath);
  89. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setAspectPath(s);
  90. }
  91. public void configureResourceMap(String projectName, Map resourcesMap) {
  92. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  93. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setSourcePathResources(resourcesMap);
  94. }
  95. public void configureJavaOptionsMap(String projectName, Map options) {
  96. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  97. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setJavaOptions(options);
  98. }
  99. public static void configureInPath(String projectName, Set inpath) {
  100. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  101. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setInpath(inpath);
  102. }
  103. public static void configureInPath(String projectName, File inpath) {
  104. Set<File> s = new HashSet<File>();
  105. s.add(inpath);
  106. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  107. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setInpath(s);
  108. }
  109. public static void configureOutputLocationManager(String projectName, IOutputLocationManager mgr) {
  110. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  111. ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setOutputLocationManager(mgr);
  112. }
  113. public void configureShowWeaveInfoMessages(String projectName, boolean showWeaveInfo) {
  114. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  115. IBuildMessageHandler handler = compiler.getMessageHandler();
  116. if (showWeaveInfo) {
  117. handler.dontIgnore(IMessage.WEAVEINFO);
  118. } else {
  119. handler.ignore(IMessage.WEAVEINFO);
  120. }
  121. }
  122. // End of methods for configuring the build
  123. public AjCompiler getCompilerForProjectWithName(String projectName) {
  124. return CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  125. }
  126. protected File getWorkingDir() {
  127. return sandboxDir;
  128. }
  129. protected void setUp() throws Exception {
  130. super.setUp();
  131. // need this line because otherwise reset in previous tests
  132. AsmManager.attemptIncrementalModelRepairs = true;
  133. if (AjState.stateListener == null) {
  134. AjState.stateListener = MyStateListener.getInstance();
  135. }
  136. MyStateListener.reset();
  137. // Create a sandbox in which to work
  138. sandboxDir = Ajc.createEmptySandbox();
  139. }
  140. protected void tearDown() throws Exception {
  141. super.tearDown();
  142. AjState.stateListener = null;
  143. CompilerFactory.clearCompilerMap();
  144. IncrementalStateManager.clearIncrementalStates();
  145. }
  146. /** Drives a build */
  147. public boolean doBuild(String projectName) {
  148. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  149. resetCompilerRecords(compiler);
  150. addSourceFilesToBuild(projectName, compiler);
  151. // addXmlConfigFilesToBuild(projectName, compiler);
  152. pause(1000); // delay to allow previous runs build stamps to be OK
  153. lognoln("Building project '" + projectName + "'");
  154. compiler.build();
  155. log("");
  156. checkForErrors(compiler);
  157. log("Build finished, time taken = "
  158. + ((MultiProjTestBuildProgressMonitor) compiler.getBuildProgressMonitor()).getTimeTaken() + "ms");
  159. return true;
  160. }
  161. // public AsmManager getStructureModelFor(String projectName) {
  162. // AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  163. // returnc compiler.getStructureModelFor(projectName)
  164. // }
  165. /** Drives a full build **/
  166. public boolean doFullBuild(String projectName) {
  167. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  168. resetCompilerRecords(compiler);
  169. addSourceFilesToBuild(projectName, compiler);
  170. addXmlConfigFilesToBuild(projectName, compiler);
  171. pause(1000); // delay to allow previous runs build stamps to be OK
  172. lognoln("Building project '" + projectName + "'");
  173. compiler.buildFresh();
  174. log("");
  175. checkForErrors(compiler);
  176. log("Build finished, time taken = "
  177. + ((MultiProjTestBuildProgressMonitor) compiler.getBuildProgressMonitor()).getTimeTaken() + "ms");
  178. return true;
  179. }
  180. /**
  181. * Clears any maps associated with the compiler
  182. */
  183. private void resetCompilerRecords(AjCompiler compiler) {
  184. ((MultiProjTestBuildProgressMonitor) compiler.getBuildProgressMonitor()).reset();
  185. ((MultiProjTestMessageHandler) compiler.getMessageHandler()).reset();
  186. }
  187. /**
  188. * Find the source files associated with the given project and add them to the list of projectSourceFiles in the
  189. * MultiProjTestCompilerConfiguration to be used in the subsequent build
  190. */
  191. private void addSourceFilesToBuild(String pname, AjCompiler compiler) {
  192. File projectBase = new File(sandboxDir, pname);
  193. ICompilerConfiguration icc = compiler.getCompilerConfiguration();
  194. List currentFiles = icc.getProjectSourceFiles();
  195. List filesForCompilation = new ArrayList();
  196. collectUpFiles(projectBase, projectBase, filesForCompilation);
  197. boolean changed = false;
  198. for (int i = 0; i < filesForCompilation.size(); i++) {
  199. if (!currentFiles.contains(filesForCompilation.get(i))) {
  200. changed = true;
  201. }
  202. }
  203. for (int i = 0; i < currentFiles.size(); i++) {
  204. if (!filesForCompilation.contains(currentFiles.get(i))) {
  205. changed = true;
  206. }
  207. }
  208. if (changed) {
  209. ((MultiProjTestCompilerConfiguration) icc).setProjectSourceFiles(filesForCompilation);
  210. }
  211. }
  212. private void addXmlConfigFilesToBuild(String pname, AjCompiler compiler) {
  213. File projectBase = new File(sandboxDir, pname);
  214. ICompilerConfiguration icc = compiler.getCompilerConfiguration();
  215. List currentXmlFiles = icc.getProjectXmlConfigFiles();
  216. List collector = new ArrayList();
  217. collectUpXmlFiles(projectBase, projectBase, collector);
  218. boolean changed = false;
  219. for (int i = 0; i < collector.size(); i++) {
  220. if (!currentXmlFiles.contains(collector.get(i))) {
  221. changed = true;
  222. }
  223. }
  224. for (int i = 0; i < currentXmlFiles.size(); i++) {
  225. if (!collector.contains(currentXmlFiles.get(i))) {
  226. changed = true;
  227. }
  228. }
  229. if (changed) {
  230. ((MultiProjTestCompilerConfiguration) icc).setProjectXmlConfigFiles(collector);
  231. }
  232. }
  233. private void collectUpFiles(File location, File base, List collectionPoint) {
  234. String contents[] = location.list();
  235. if (contents == null) {
  236. return;
  237. }
  238. for (int i = 0; i < contents.length; i++) {
  239. String string = contents[i];
  240. File f = new File(location, string);
  241. if (f.isDirectory()) {
  242. collectUpFiles(f, base, collectionPoint);
  243. } else if (f.isFile() && (f.getName().endsWith(".aj") || f.getName().endsWith(".java"))) {
  244. String fileFound;
  245. try {
  246. fileFound = f.getCanonicalPath();
  247. collectionPoint.add(fileFound);
  248. // String toRemove = base.getCanonicalPath();
  249. // if (!fileFound.startsWith(toRemove)) throw new RuntimeException("eh? "+fileFound+" "+toRemove);
  250. // collectionPoint.add(fileFound.substring(toRemove.length()+1));//+1 captures extra separator
  251. } catch (IOException e) {
  252. e.printStackTrace();
  253. }
  254. }
  255. }
  256. }
  257. private void collectUpXmlFiles(File location, File base, List collectionPoint) {
  258. String contents[] = location.list();
  259. if (contents == null) {
  260. return;
  261. }
  262. for (int i = 0; i < contents.length; i++) {
  263. String string = contents[i];
  264. File f = new File(location, string);
  265. if (f.isDirectory()) {
  266. collectUpXmlFiles(f, base, collectionPoint);
  267. } else if (f.isFile() && f.getName().endsWith(".xml")) {
  268. String fileFound;
  269. try {
  270. fileFound = f.getCanonicalPath();
  271. collectionPoint.add(fileFound);
  272. } catch (IOException e) {
  273. e.printStackTrace();
  274. }
  275. }
  276. }
  277. }
  278. /**
  279. * Make sure no errors have been recorded
  280. */
  281. private void checkForErrors(AjCompiler compiler) {
  282. MultiProjTestMessageHandler handler = (MultiProjTestMessageHandler) compiler.getMessageHandler();
  283. if (handler.hasErrorMessages()) {
  284. System.err.println("Build errors:");
  285. for (Iterator<IMessage> iter = handler.getErrorMessages().iterator(); iter.hasNext();) {
  286. IMessage element = iter.next();
  287. System.err.println(element);
  288. }
  289. System.err.println("---------");
  290. }
  291. }
  292. public List<IMessage> getErrorMessages(String projectName) {
  293. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  294. return ((MultiProjTestMessageHandler) compiler.getMessageHandler()).getErrorMessages();
  295. }
  296. public List<IMessage> getWarningMessages(String projectName) {
  297. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  298. return ((MultiProjTestMessageHandler) compiler.getMessageHandler()).getWarningMessages();
  299. }
  300. public List<IMessage> getWeavingMessages(String projectName) {
  301. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  302. return ((MultiProjTestMessageHandler) compiler.getMessageHandler()).getWeavingMessages();
  303. }
  304. public List getCompilerErrorMessages(String projectName) {
  305. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  306. return ((MultiProjTestMessageHandler) compiler.getMessageHandler()).getCompilerErrors();
  307. }
  308. public void checkForError(String projectName, String anError) {
  309. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  310. List<IMessage> messages = ((MultiProjTestMessageHandler) compiler.getMessageHandler()).getErrorMessages();
  311. for (Iterator<IMessage> iter = messages.iterator(); iter.hasNext();) {
  312. IMessage element = iter.next();
  313. if (element.getMessage().indexOf(anError) != -1) {
  314. return;
  315. }
  316. }
  317. fail("Didn't find the error message:\n'" + anError + "'.\nErrors that occurred:\n" + messages);
  318. }
  319. private void pause(int millis) {
  320. try {
  321. Thread.sleep(millis);
  322. } catch (InterruptedException ie) {
  323. }
  324. }
  325. // Methods for querying what happened during a build and accessing information
  326. // about the build:
  327. /**
  328. * Helper method for dumping info about which files were compiled and woven during the last build.
  329. */
  330. public String printCompiledAndWovenFiles(String projectName) {
  331. StringBuffer sb = new StringBuffer();
  332. if (getCompiledFiles(projectName).size() == 0 && getWovenClasses(projectName).size() == 0) {
  333. sb.append("No files were compiled or woven\n");
  334. }
  335. for (Iterator iter = getCompiledFiles(projectName).iterator(); iter.hasNext();) {
  336. Object element = iter.next();
  337. sb.append("compiled: " + element + "\n");
  338. }
  339. for (Iterator iter = getWovenClasses(projectName).iterator(); iter.hasNext();) {
  340. Object element = iter.next();
  341. sb.append("woven: " + element + "\n");
  342. }
  343. return sb.toString();
  344. }
  345. /**
  346. * Summary report on what happened in the most recent build
  347. */
  348. public void printBuildReport(String projectName) {
  349. System.out.println("\n====== BUILD REPORT (Project " + projectName + ") ===========");
  350. System.out.println("Build took: " + getTimeTakenForBuild(projectName) + "ms");
  351. List compiled = getCompiledFiles(projectName);
  352. System.out.println("Compiled: " + compiled.size() + " files");
  353. for (Iterator iter = compiled.iterator(); iter.hasNext();) {
  354. System.out.println(" :" + iter.next());
  355. }
  356. List woven = getWovenClasses(projectName);
  357. System.out.println("Wove: " + woven.size() + " files");
  358. for (Iterator iter = woven.iterator(); iter.hasNext();) {
  359. System.out.println(" :" + iter.next());
  360. }
  361. if (wasFullBuild()) {
  362. System.out.println("It was a batch (full) build");
  363. }
  364. System.out.println("=============================================");
  365. }
  366. /**
  367. * Check we compiled/wove the right number of files, passing '-1' indicates you don't care about that number.
  368. */
  369. public void checkCompileWeaveCount(String projectName, int expCompile, int expWoven) {
  370. if (expCompile != -1 && getCompiledFiles(projectName).size() != expCompile) {
  371. fail("Expected compilation of " + expCompile + " files but compiled " + getCompiledFiles(projectName).size() + "\n"
  372. + printCompiledAndWovenFiles(projectName));
  373. }
  374. if (expWoven != -1 && getWovenClasses(projectName).size() != expWoven) {
  375. fail("Expected weaving of " + expWoven + " files but wove " + getWovenClasses(projectName).size() + "\n"
  376. + printCompiledAndWovenFiles(projectName));
  377. }
  378. }
  379. public void checkWasntFullBuild() {
  380. assertTrue("Shouldn't have been a full (batch) build", !wasFullBuild());
  381. }
  382. public void checkWasFullBuild() {
  383. assertTrue("Should have been a full (batch) build", wasFullBuild());
  384. }
  385. public boolean wasFullBuild() {
  386. // alternatives: statelistener is debug interface, progressmonitor is new proper interface (see pr145689)
  387. // return MyBuildProgressMonitor.wasFullBuild();
  388. return MyStateListener.wasFullBuild();
  389. }
  390. public long getTimeTakenForBuild(String projectName) {
  391. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  392. return ((MultiProjTestBuildProgressMonitor) compiler.getBuildProgressMonitor()).getTimeTaken();
  393. }
  394. public List<String> getCompiledFiles(String projectName) {
  395. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  396. return ((MultiProjTestBuildProgressMonitor) compiler.getBuildProgressMonitor()).getCompiledFiles();
  397. }
  398. public AsmManager getModelFor(String projectName) {
  399. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  400. return compiler.getModel();
  401. }
  402. public List<String> getWovenClasses(String projectName) {
  403. AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName);
  404. return ((MultiProjTestBuildProgressMonitor) compiler.getBuildProgressMonitor()).getWovenClasses();
  405. }
  406. // Infrastructure below here
  407. private static void log(String msg) {
  408. if (VERBOSE) {
  409. System.out.println(msg);
  410. }
  411. }
  412. private static void lognoln(String msg) {
  413. if (VERBOSE) {
  414. System.out.print(msg);
  415. }
  416. }
  417. /** Return the *full* path to this file which is taken relative to the project dir */
  418. protected static String getFile(String projectName, String path) {
  419. return new File(sandboxDir, projectName + File.separatorChar + path).getAbsolutePath();
  420. }
  421. static class MyStateListener extends AbstractStateListener {
  422. private static MyStateListener _instance = new MyStateListener();
  423. private MyStateListener() {
  424. reset();
  425. }
  426. public static MyStateListener getInstance() {
  427. return _instance;
  428. }
  429. public static boolean informedAboutKindOfBuild;
  430. public static boolean fullBuildOccurred;
  431. public static List detectedDeletions = new ArrayList();
  432. public static StringBuffer decisions = new StringBuffer();
  433. public static void reset() {
  434. informedAboutKindOfBuild = false;
  435. decisions = new StringBuffer();
  436. fullBuildOccurred = false;
  437. if (detectedDeletions != null) {
  438. detectedDeletions.clear();
  439. }
  440. }
  441. public boolean pathChange = false;
  442. public void pathChangeDetected() {
  443. pathChange = true;
  444. }
  445. public void aboutToCompareClasspaths(List oldClasspath, List newClasspath) {
  446. }
  447. public void detectedClassChangeInThisDir(File f) {
  448. recordDecision("Detected class change in this directory: " + f.toString());
  449. }
  450. public void detectedAspectDeleted(File f) {
  451. detectedDeletions.add(f.toString());
  452. }
  453. public void buildSuccessful(boolean wasFullBuild) {
  454. informedAboutKindOfBuild = true;
  455. fullBuildOccurred = wasFullBuild;
  456. }
  457. public static String getDecisions() {
  458. return decisions.toString();
  459. }
  460. public static boolean wasFullBuild() {
  461. if (!informedAboutKindOfBuild) {
  462. throw new RuntimeException("I never heard about what kind of build it was!!");
  463. }
  464. return fullBuildOccurred;
  465. }
  466. // not needed just yet...
  467. // public void recordInformation(String s) { decisions.append(s).append("\n");}
  468. public void recordDecision(String s) {
  469. decisions.append(s).append("\n");
  470. log(s);
  471. }
  472. };
  473. }