use of org.jetbrains.jps.cmdline.ProjectDescriptor in project intellij-community by JetBrains.
the class BuildOperations method markTargetsUpToDate.
public static void markTargetsUpToDate(CompileContext context, BuildTargetChunk chunk) throws IOException {
final ProjectDescriptor pd = context.getProjectDescriptor();
final BuildFSState fsState = pd.fsState;
for (BuildTarget<?> target : chunk.getTargets()) {
pd.getTargetsState().getTargetConfiguration(target).storeNonexistentOutputRoots(context);
}
if (!Utils.errorsDetected(context) && !context.getCancelStatus().isCanceled()) {
boolean marked = dropRemovedPaths(context, chunk);
for (BuildTarget<?> target : chunk.getTargets()) {
if (target instanceof ModuleBuildTarget) {
context.clearNonIncrementalMark((ModuleBuildTarget) target);
}
final Timestamps timestamps = pd.timestamps.getStorage();
for (BuildRootDescriptor rd : pd.getBuildRootIndex().getTargetRoots(target, context)) {
marked |= fsState.markAllUpToDate(context, rd, timestamps);
}
}
if (marked) {
context.processMessage(DoneSomethingNotification.INSTANCE);
}
}
}
use of org.jetbrains.jps.cmdline.ProjectDescriptor in project intellij-community by JetBrains.
the class BuildOperations method ensureFSStateInitialized.
public static void ensureFSStateInitialized(CompileContext context, BuildTarget<?> target) throws IOException {
final ProjectDescriptor pd = context.getProjectDescriptor();
final Timestamps timestamps = pd.timestamps.getStorage();
final BuildTargetConfiguration configuration = pd.getTargetsState().getTargetConfiguration(target);
if (JavaBuilderUtil.isForcedRecompilationAllJavaModules(context)) {
FSOperations.markDirtyFiles(context, target, CompilationRound.CURRENT, timestamps, true, null, null);
pd.fsState.markInitialScanPerformed(target);
configuration.save(context);
} else if (context.getScope().isBuildForced(target) || configuration.isTargetDirty(context) || configuration.outputRootWasDeleted(context)) {
initTargetFSState(context, target, true);
if (!context.getScope().isBuildForced(target)) {
// case when target build is forced, is handled separately
IncProjectBuilder.clearOutputFiles(context, target);
}
pd.dataManager.cleanTargetStorages(target);
configuration.save(context);
} else if (!pd.fsState.isInitialScanPerformed(target)) {
initTargetFSState(context, target, false);
}
}
use of org.jetbrains.jps.cmdline.ProjectDescriptor in project intellij-community by JetBrains.
the class FSOperations method markDeleted.
public static void markDeleted(CompileContext context, File file) throws IOException {
final JavaSourceRootDescriptor rd = context.getProjectDescriptor().getBuildRootIndex().findJavaRootDescriptor(context, file);
if (rd != null) {
final ProjectDescriptor pd = context.getProjectDescriptor();
pd.fsState.registerDeleted(context, rd.target, file, pd.timestamps.getStorage());
}
}
use of org.jetbrains.jps.cmdline.ProjectDescriptor in project intellij-elixir by KronicDeth.
the class JpsBuildTestCase method createProjectDescriptor.
protected ProjectDescriptor createProjectDescriptor(BuildLoggingManager buildLoggingManager) {
try {
BuildTargetRegistryImpl targetRegistry = new BuildTargetRegistryImpl(myModel);
ModuleExcludeIndex index = new ModuleExcludeIndexImpl(myModel);
IgnoredFileIndexImpl ignoredFileIndex = new IgnoredFileIndexImpl(myModel);
BuildDataPaths dataPaths = new BuildDataPathsImpl(myDataStorageRoot);
BuildRootIndexImpl buildRootIndex = new BuildRootIndexImpl(targetRegistry, myModel, index, dataPaths, ignoredFileIndex);
BuildTargetIndexImpl targetIndex = new BuildTargetIndexImpl(targetRegistry, buildRootIndex);
BuildTargetsState targetsState = new BuildTargetsState(dataPaths, myModel, buildRootIndex);
ProjectTimestamps timestamps = new ProjectTimestamps(myDataStorageRoot, targetsState);
BuildDataManager dataManager = new BuildDataManager(dataPaths, targetsState, true);
return new ProjectDescriptor(myModel, new BuildFSState(true), timestamps, dataManager, buildLoggingManager, index, targetsState, targetIndex, buildRootIndex, ignoredFileIndex);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
use of org.jetbrains.jps.cmdline.ProjectDescriptor in project intellij-community by JetBrains.
the class FSOperations method markDirty.
public static void markDirty(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.markDirty(context, round, file, rd, pd.timestamps.getStorage(), false);
}
}
Aggregations