Skip to content

Commit

Permalink
Allow local spawns to add custom execution info.
Browse files Browse the repository at this point in the history
--
MOS_MIGRATED_REVID=129994187
  • Loading branch information
ericfelly authored and hermione521 committed Aug 12, 2016
1 parent 5ae3b79 commit c0af31d
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,21 @@ public static String asShellCommand(Collection<String> arguments,
public static class Local extends BaseSpawn {
public Local(List<String> arguments, Map<String, String> environment,
ActionExecutionMetadata action) {
super(arguments, environment, ImmutableMap.<String, String>of("local", ""),
this(arguments, environment, ImmutableMap.<String, String>of(), action);
}

public Local(List<String> arguments, Map<String, String> environment,
Map<String, String> executionInfo, ActionExecutionMetadata action) {
super(arguments, environment, buildExecutionInfo(executionInfo),
action, ResourceSet.ZERO);
}

private static ImmutableMap<String, String> buildExecutionInfo(
Map<String, String> additionalExecutionInfo) {
ImmutableMap.Builder<String, String> executionInfo = ImmutableMap.builder();
executionInfo.putAll(additionalExecutionInfo);
executionInfo.put("local", "");
return executionInfo.build();
}
}
}

0 comments on commit c0af31d

Please sign in to comment.