Search in sources :

Example 1 with PyIdeInfo

use of com.google.devtools.intellij.ideinfo.IntellijIdeInfo.PyIdeInfo in project bazel by bazelbuild.

the class AndroidStudioInfoAspect method makePyIdeInfo.

private static PyIdeInfo makePyIdeInfo(ConfiguredTarget base, RuleContext ruleContext, NestedSetBuilder<Artifact> ideResolveArtifacts) {
    PyIdeInfo.Builder builder = PyIdeInfo.newBuilder();
    Collection<Artifact> sourceFiles = getSources(ruleContext);
    for (Artifact sourceFile : sourceFiles) {
        builder.addSources(makeArtifactLocation(sourceFile));
    }
    // Ensure we add all generated sources to the ide-resolve output group.
    // See {@link PyCommon#collectTransitivePythonSources}.
    OutputGroupProvider outputGroupProvider = base.getProvider(OutputGroupProvider.class);
    if (outputGroupProvider != null) {
        ideResolveArtifacts.addTransitive(outputGroupProvider.getOutputGroup(OutputGroupProvider.FILES_TO_COMPILE));
    }
    return builder.build();
}
Also used : PyIdeInfo(com.google.devtools.intellij.ideinfo.IntellijIdeInfo.PyIdeInfo) OutputGroupProvider(com.google.devtools.build.lib.analysis.OutputGroupProvider) Artifact(com.google.devtools.build.lib.actions.Artifact) LibraryArtifact(com.google.devtools.intellij.ideinfo.IntellijIdeInfo.LibraryArtifact)

Aggregations

Artifact (com.google.devtools.build.lib.actions.Artifact)1 OutputGroupProvider (com.google.devtools.build.lib.analysis.OutputGroupProvider)1 LibraryArtifact (com.google.devtools.intellij.ideinfo.IntellijIdeInfo.LibraryArtifact)1 PyIdeInfo (com.google.devtools.intellij.ideinfo.IntellijIdeInfo.PyIdeInfo)1