Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Add java_runtime contents to runfiles
Browse files Browse the repository at this point in the history
This is required for compatibility with existing runtimes specified
as filegroups.

--
PiperOrigin-RevId: 145314598
MOS_MIGRATED_REVID=145314598
  • Loading branch information
cushon authored and laszlocsomor committed Jan 24, 2017
1 parent 4e267c8 commit 214542f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.devtools.build.lib.analysis.RuleConfiguredTarget.Mode;
import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.Runfiles;
import com.google.devtools.build.lib.analysis.RunfilesProvider;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.rules.RuleConfiguredTargetFactory;
Expand All @@ -37,8 +38,13 @@ public ConfiguredTarget create(RuleContext ruleContext)
NestedSet<Artifact> middleman =
CompilationHelper.getAggregatingMiddleman(
ruleContext, Actions.escapeLabel(ruleContext.getLabel()), filesToBuild);
// TODO(cushon): clean up uses of java_runtime in data deps and remove this
Runfiles runfiles =
new Runfiles.Builder(ruleContext.getWorkspaceName())
.addTransitiveArtifacts(filesToBuild)
.build();
return new RuleConfiguredTargetBuilder(ruleContext)
.addProvider(RunfilesProvider.class, RunfilesProvider.EMPTY)
.addProvider(RunfilesProvider.class, RunfilesProvider.simple(runfiles))
.setFilesToBuild(filesToBuild)
.addProvider(JavaRuntimeProvider.class, JavaRuntimeProvider.create(filesToBuild))
.addProvider(MiddlemanProvider.class, new MiddlemanProvider(middleman))
Expand Down

0 comments on commit 214542f

Please sign in to comment.