Search in sources :

Example 1 with Builder

use of com.google.devtools.build.lib.analysis.ConfiguredAspect.Builder in project bazel by bazelbuild.

the class AndroidStudioInfoAspect method create.

@Override
public ConfiguredAspect create(ConfiguredTarget base, RuleContext ruleContext, AspectParameters parameters) {
    ConfiguredAspect.Builder builder = new Builder(this, parameters, ruleContext);
    AndroidStudioInfoFilesProvider.Builder providerBuilder = new AndroidStudioInfoFilesProvider.Builder();
    DependenciesResult dependenciesResult = processDependencies(base, ruleContext, providerBuilder);
    AndroidStudioInfoFilesProvider provider = createIdeBuildArtifact(base, ruleContext, dependenciesResult, providerBuilder);
    NestedSetBuilder<Artifact> ideCompileArtifacts = NestedSetBuilder.stableOrder();
    // Add artifacts required for compilation
    OutputGroupProvider outputGroupProvider = base.getProvider(OutputGroupProvider.class);
    if (outputGroupProvider != null) {
        ideCompileArtifacts.addTransitive(outputGroupProvider.getOutputGroup(OutputGroupProvider.FILES_TO_COMPILE));
    }
    builder.addOutputGroup(IDE_INFO, provider.getIdeInfoFiles()).addOutputGroup(IDE_INFO_TEXT, provider.getIdeInfoTextFiles()).addOutputGroup(IDE_RESOLVE, provider.getIdeResolveFiles()).addOutputGroup(IDE_COMPILE, ideCompileArtifacts.build()).addProvider(provider);
    return builder.build();
}
Also used : ConfiguredAspect(com.google.devtools.build.lib.analysis.ConfiguredAspect) OutputGroupProvider(com.google.devtools.build.lib.analysis.OutputGroupProvider) NestedSetBuilder(com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder) Builder(com.google.devtools.build.lib.analysis.ConfiguredAspect.Builder) Builder(com.google.devtools.build.lib.analysis.ConfiguredAspect.Builder) 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 ConfiguredAspect (com.google.devtools.build.lib.analysis.ConfiguredAspect)1 Builder (com.google.devtools.build.lib.analysis.ConfiguredAspect.Builder)1 OutputGroupProvider (com.google.devtools.build.lib.analysis.OutputGroupProvider)1 NestedSetBuilder (com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder)1 LibraryArtifact (com.google.devtools.intellij.ideinfo.IntellijIdeInfo.LibraryArtifact)1