BuildResult (int makesCount) { StringBuilder log = new StringBuilder(); String rootPath = FileUtil.toSystemIndependentName(workDir.getAbsolutePath()) + "/"; ProjectDescriptor pd = createProjectDescriptor(new BuildLoggingManager(new StringProjectBuilderLogger(rootPath, log))); BuildResult result = null; try { final boolean reuseProjectId = useCachedProjectDescriptorOnEachMake(); doBuild(pd, CompileScopeTestBuilder.rebuild().allModules()).assertSuccessful(); for (int idx = 0; idx < makesCount; idx++) { // this will save the current build data state before any changes were done to the project model if (!reuseProjectId) { pd.release(); } modify(idx); if (!reuseProjectId) { pd = createProjectDescriptor(new BuildLoggingManager(new StringProjectBuilderLogger(rootPath, log))); } result = doBuild(pd, createCompileScope(idx)); } File logFile = new File(baseDir.getAbsolutePath() + ".log"); if (!logFile.exists()) { logFile = new File(baseDir, "build.log"); } assertSameLinesWithFile(logFile.getAbsolutePath(), log.toString()); } finally { pd.release(); } assertNotNull(result); if (result.isSuccessful()) { checkMappingsAreSameAfterRebuild(result); } return result; }