Search in sources :

Example 56 with TargetIdeInfo

use of com.google.idea.blaze.base.ideinfo.TargetIdeInfo in project intellij by bazelbuild.

the class FastBuildIncrementalCompilerImpl method recursivelyAddModifiedJavaSources.

private void recursivelyAddModifiedJavaSources(ArtifactLocationDecoder artifactLocationDecoder, TargetMap targetMap, TargetKey targetKey, Set<TargetKey> seenTargets, Set<File> sourceFiles, Set<File> modifiedSinceBuild) {
    if (seenTargets.contains(targetKey)) {
        return;
    }
    seenTargets.add(targetKey);
    TargetIdeInfo targetIdeInfo = targetMap.get(targetKey);
    if (targetIdeInfo == null) {
        return;
    }
    artifactLocationDecoder.decodeAll(targetIdeInfo.sources).stream().filter(file -> file.getName().endsWith(".java")).filter(modifiedSinceBuild::contains).forEach(sourceFiles::add);
    targetIdeInfo.dependencies.forEach(dep -> recursivelyAddModifiedJavaSources(artifactLocationDecoder, targetMap, dep.targetKey, seenTargets, sourceFiles, modifiedSinceBuild));
}
Also used : TargetIdeInfo(com.google.idea.blaze.base.ideinfo.TargetIdeInfo)

Example 57 with TargetIdeInfo

use of com.google.idea.blaze.base.ideinfo.TargetIdeInfo in project intellij by bazelbuild.

the class FastBuildServiceImpl method checkLabelIsSupported.

private void checkLabelIsSupported(Label label) {
    BlazeProjectData blazeProjectData = projectDataManager.getBlazeProjectData();
    checkState(blazeProjectData != null, "this is not a blaze project");
    TargetIdeInfo ideInfo = blazeProjectData.targetMap.get(TargetKey.forPlainTarget(label));
    checkArgument(ideInfo != null, "label %s is not found, run a blaze sync?", label);
    checkArgument(supportsFastBuilds(ideInfo.kind), "fast builds are not supported for %s targets", ideInfo.kind);
}
Also used : TargetIdeInfo(com.google.idea.blaze.base.ideinfo.TargetIdeInfo) BlazeProjectData(com.google.idea.blaze.base.model.BlazeProjectData)

Aggregations

TargetIdeInfo (com.google.idea.blaze.base.ideinfo.TargetIdeInfo)57 TargetKey (com.google.idea.blaze.base.ideinfo.TargetKey)28 File (java.io.File)20 BlazeProjectData (com.google.idea.blaze.base.model.BlazeProjectData)19 Nullable (javax.annotation.Nullable)16 Kind (com.google.idea.blaze.base.model.primitives.Kind)15 ImmutableList (com.google.common.collect.ImmutableList)14 ArtifactLocation (com.google.idea.blaze.base.ideinfo.ArtifactLocation)14 TargetMap (com.google.idea.blaze.base.ideinfo.TargetMap)14 ArtifactLocationDecoder (com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder)14 Project (com.intellij.openapi.project.Project)14 List (java.util.List)12 LibraryArtifact (com.google.idea.blaze.base.ideinfo.LibraryArtifact)11 ProjectViewSet (com.google.idea.blaze.base.projectview.ProjectViewSet)11 LanguageClass (com.google.idea.blaze.base.model.primitives.LanguageClass)10 BlazeCommandRunConfigurationCommonState (com.google.idea.blaze.base.run.state.BlazeCommandRunConfigurationCommonState)10 Collection (java.util.Collection)10 AndroidIdeInfo (com.google.idea.blaze.base.ideinfo.AndroidIdeInfo)9 BlazeJarLibrary (com.google.idea.blaze.java.sync.model.BlazeJarLibrary)9 Set (java.util.Set)9