Search in sources :

Example 6 with ProjectDescriptor

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);
        }
    }
}
Also used : Timestamps(org.jetbrains.jps.incremental.storage.Timestamps) BuildFSState(org.jetbrains.jps.incremental.fs.BuildFSState) ProjectDescriptor(org.jetbrains.jps.cmdline.ProjectDescriptor)

Example 7 with ProjectDescriptor

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);
    }
}
Also used : Timestamps(org.jetbrains.jps.incremental.storage.Timestamps) ProjectDescriptor(org.jetbrains.jps.cmdline.ProjectDescriptor) BuildTargetConfiguration(org.jetbrains.jps.incremental.storage.BuildTargetConfiguration)

Example 8 with ProjectDescriptor

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());
    }
}
Also used : ProjectDescriptor(org.jetbrains.jps.cmdline.ProjectDescriptor) JavaSourceRootDescriptor(org.jetbrains.jps.builders.java.JavaSourceRootDescriptor)

Example 9 with ProjectDescriptor

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);
    }
}
Also used : ProjectTimestamps(org.jetbrains.jps.incremental.storage.ProjectTimestamps) BuildTargetRegistryImpl(org.jetbrains.jps.builders.impl.BuildTargetRegistryImpl) BuildRootIndexImpl(org.jetbrains.jps.builders.impl.BuildRootIndexImpl) IgnoredFileIndexImpl(org.jetbrains.jps.indices.impl.IgnoredFileIndexImpl) BuildTargetIndexImpl(org.jetbrains.jps.builders.impl.BuildTargetIndexImpl) IOException(java.io.IOException) BuildTargetsState(org.jetbrains.jps.incremental.storage.BuildTargetsState) BuildFSState(org.jetbrains.jps.incremental.fs.BuildFSState) BuildDataPaths(org.jetbrains.jps.builders.storage.BuildDataPaths) ModuleExcludeIndex(org.jetbrains.jps.indices.ModuleExcludeIndex) ProjectDescriptor(org.jetbrains.jps.cmdline.ProjectDescriptor) ModuleExcludeIndexImpl(org.jetbrains.jps.indices.impl.ModuleExcludeIndexImpl) BuildDataPathsImpl(org.jetbrains.jps.builders.impl.BuildDataPathsImpl) BuildDataManager(org.jetbrains.jps.incremental.storage.BuildDataManager)

Example 10 with ProjectDescriptor

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);
    }
}
Also used : ProjectDescriptor(org.jetbrains.jps.cmdline.ProjectDescriptor) JavaSourceRootDescriptor(org.jetbrains.jps.builders.java.JavaSourceRootDescriptor)

Aggregations

ProjectDescriptor (org.jetbrains.jps.cmdline.ProjectDescriptor)18 IOException (java.io.IOException)6 BuildFSState (org.jetbrains.jps.incremental.fs.BuildFSState)6 File (java.io.File)5 JavaSourceRootDescriptor (org.jetbrains.jps.builders.java.JavaSourceRootDescriptor)4 THashSet (gnu.trove.THashSet)3 Timestamps (org.jetbrains.jps.incremental.storage.Timestamps)3 ModuleExcludeIndex (org.jetbrains.jps.indices.ModuleExcludeIndex)3 MultiMap (com.intellij.util.containers.MultiMap)2 BuildDataPathsImpl (org.jetbrains.jps.builders.impl.BuildDataPathsImpl)2 BuildRootIndexImpl (org.jetbrains.jps.builders.impl.BuildRootIndexImpl)2 BuildTargetIndexImpl (org.jetbrains.jps.builders.impl.BuildTargetIndexImpl)2 BuildTargetRegistryImpl (org.jetbrains.jps.builders.impl.BuildTargetRegistryImpl)2 BuildDataPaths (org.jetbrains.jps.builders.storage.BuildDataPaths)2 SourceToOutputMapping (org.jetbrains.jps.builders.storage.SourceToOutputMapping)2 CompilerMessage (org.jetbrains.jps.incremental.messages.CompilerMessage)2 ProgressMessage (org.jetbrains.jps.incremental.messages.ProgressMessage)2 BuildDataManager (org.jetbrains.jps.incremental.storage.BuildDataManager)2 BuildTargetsState (org.jetbrains.jps.incremental.storage.BuildTargetsState)2 ProjectTimestamps (org.jetbrains.jps.incremental.storage.ProjectTimestamps)2