Skip to content

Commit

Permalink
C++: Expose functionality needed for cc_embed_data Skylark implementa…
Browse files Browse the repository at this point in the history
…tion

RELNOTES:none
PiperOrigin-RevId: 193919970
  • Loading branch information
oquenchil authored and Copybara-Service committed Apr 23, 2018
1 parent 538c3eb commit 27b0bcf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
import com.google.devtools.build.lib.syntax.SkylarkNestedSet;
import com.google.devtools.build.lib.syntax.Type;
import com.google.devtools.build.lib.util.FileTypeSet;
import com.google.devtools.build.lib.util.Pair;
Expand Down Expand Up @@ -170,6 +171,16 @@ public Map<String, NestedSet<Artifact>> getOutputGroups() {
return outputGroups;
}

@SkylarkCallable(name = "cc_output_groups", documented = false)
public Map<String, SkylarkNestedSet> getSkylarkOutputGroups() {
Map<String, SkylarkNestedSet> skylarkOutputGroups = new TreeMap<>();
for (Map.Entry<String, NestedSet<Artifact>> entry : outputGroups.entrySet()) {
skylarkOutputGroups.put(
entry.getKey(), SkylarkNestedSet.of(Artifact.class, entry.getValue()));
}
return skylarkOutputGroups;
}

@SkylarkCallable(name = "cc_compilation_outputs", documented = false)
public CcCompilationOutputs getCcCompilationOutputs() {
return compilationOutputs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ NestedSet<Artifact> getFilesToCompile(
return files.build();
}


/** Builder for CcCompilationOutputs. */
public static final class Builder {
private final Set<Artifact> objectFiles = new LinkedHashSet<>();
private final Set<Artifact> picObjectFiles = new LinkedHashSet<>();
Expand Down

0 comments on commit 27b0bcf

Please sign in to comment.