diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/actions/ParamFileHelper.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/actions/ParamFileHelper.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/ParamFileHelper.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/ParamFileHelper.java index e7869e4f2d..e061961671 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/actions/ParamFileHelper.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/ParamFileHelper.java @@ -58,7 +58,7 @@ public final class ParamFileHelper { * @param analysisEnvironment the analysis environment * @param outputs outputs of the action (used to construct a filename for the params file) */ - public static Artifact getParamsFile( + public static Artifact getParamsFileMaybe( List<String> executableArgs, @Nullable Iterable<String> arguments, @Nullable CommandLine commandLine, @@ -72,15 +72,22 @@ public final class ParamFileHelper { return null; } - PathFragment paramFilePath = ParameterFile.derivePath( - Iterables.getFirst(outputs, null).getRootRelativePath()); + return getParamsFile(analysisEnvironment, configuration, Iterables.getFirst(outputs, null)); + } + + /** + * Returns a params file for the specified output file. + */ + public static Artifact getParamsFile(AnalysisEnvironment analysisEnvironment, + BuildConfiguration configuration, Artifact output) { + PathFragment paramFilePath = ParameterFile.derivePath(output.getRootRelativePath()); return analysisEnvironment.getDerivedArtifact(paramFilePath, configuration.getBinDirectory()); } /** * Creates a command line using an external params file. * - * <p>Call this with the result of {@link #getParamsFile} if it is not null. + * <p>Call this with the result of {@link #getParamsFileMaybe} if it is not null. * * @param executableArgs leading arguments that should never be wrapped in a parameter file * @param arguments arguments to the command (in addition to executableArgs), OR @@ -117,7 +124,7 @@ public final class ParamFileHelper { /** * Creates a command line without using a params file. * - * <p>Call this if {@link #getParamsFile} returns null. + * <p>Call this if {@link #getParamsFileMaybe} returns null. * * @param executableArgs leading arguments that should never be wrapped in a parameter file * @param arguments arguments to the command (in addition to executableArgs), OR |