Enable params files for resource jar actions
to avoid exceeding the command line length limit for libraries
with very large numbers of resources.
@@ -19,6 +19,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.actions.Artifact;
+import com.google.devtools.build.lib.actions.ParameterFile.ParameterFileType;
import com.google.devtools.build.lib.analysis.RuleConfiguredTarget.Mode;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.actions.CustomCommandLine;
@@ -125,6 +126,7 @@ public class ResourceJarActionBuilder {
.addInputs(resources.values())
.addTransitiveInputs(resourceJars)
.addInputs(classpathResources)
+ .useParameterFile(ParameterFileType.SHELL_QUOTED)
.setCommandLine(command.build())
.setProgressMessage("Building Java resource jar")
.setMnemonic("JavaResourceJar")
