use of org.jetbrains.jps.cmdline.ProjectDescriptor in project intellij-community by JetBrains.
the class ChainedTargetsBuildListener method filesGenerated.
@Override
public void filesGenerated(FileGeneratedEvent event) {
final ProjectDescriptor pd = myContext.getProjectDescriptor();
final BuildFSState fsState = pd.fsState;
for (Pair<String, String> pair : event.getPaths()) {
final String relativePath = pair.getSecond();
final File file = relativePath.equals(".") ? new File(pair.getFirst()) : new File(pair.getFirst(), relativePath);
for (BuildRootDescriptor desc : pd.getBuildRootIndex().findAllParentDescriptors(file, myContext)) {
if (!event.getSourceTarget().equals(desc.getTarget())) {
// It is assumed that those files will be explicitly marked dirty by particular builder, if needed.
try {
fsState.markDirty(myContext, file, desc, pd.timestamps.getStorage(), false);
} catch (IOException ignored) {
}
}
}
}
}
use of org.jetbrains.jps.cmdline.ProjectDescriptor in project intellij-community by JetBrains.
the class FSOperations method markDirtyIfNotDeleted.
public static void markDirtyIfNotDeleted(CompileContext context, final CompilationRound round, final File file) throws IOException {
final JavaSourceRootDescriptor rd = context.getProjectDescriptor().getBuildRootIndex().findJavaRootDescriptor(context, file);
if (rd != null) {
final ProjectDescriptor pd = context.getProjectDescriptor();
pd.fsState.markDirtyIfNotDeleted(context, round, file, rd, pd.timestamps.getStorage());
}
}
use of org.jetbrains.jps.cmdline.ProjectDescriptor in project intellij-community by JetBrains.
the class IncrementalTestCase method doTestBuild.
protected BuildResult doTestBuild(int makesCount) {
StringBuilder log = new StringBuilder();
String rootPath = FileUtil.toSystemIndependentName(workDir.getAbsolutePath()) + "/";
final ProjectDescriptor pd = createProjectDescriptor(new BuildLoggingManager(new StringProjectBuilderLogger(rootPath, log)));
BuildResult result = null;
try {
doBuild(pd, CompileScopeTestBuilder.rebuild().allModules()).assertSuccessful();
for (int idx = 0; idx < makesCount; idx++) {
modify(idx);
result = doBuild(pd, CompileScopeTestBuilder.make().allModules());
}
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;
}
Aggregations