Add aapt2 to the resource compile action.
RELNOTES: None
@@ -45,6 +45,7 @@ public class AndroidResourceParsingActionBuilder {
new ResourceContainerToArg();
private final RuleContext ruleContext;
+ private final AndroidSdkProvider sdk;
private LocalResourceContainer primary;
private Artifact output;
@@ -57,6 +58,7 @@ public class AndroidResourceParsingActionBuilder {
*/
public AndroidResourceParsingActionBuilder(RuleContext ruleContext) {
this.ruleContext = ruleContext;
+ this.sdk = AndroidSdkProvider.fromRuleContext(ruleContext);
}
/**
@@ -177,8 +179,10 @@ public class AndroidResourceParsingActionBuilder {
.add("--tool")
.add("COMPILE_LIBRARY_RESOURCES")
.add("--")
+ .addExecPath("--aapt2", sdk.getAapt2().getExecutable())
.add("--resources", resourceDirectories)
.addExecPath("--output", compiledSymbols);
+ inputs.add(sdk.getAapt2().getExecutable());
outs.add(compiledSymbols);
// The databinding needs to be processed before compilation, so the stripping happens here.
