use of com.android.ide.common.process.ProcessExecutor in project atlas by alibaba.
the class AtlasBuilder method processResources.
@Override
public void processResources(Aapt aapt, Builder aaptConfigBuilder, boolean enforceUniquePackageName) throws IOException, InterruptedException, ProcessException {
if (aapt instanceof AaptV1) {
try {
getTargetInfo();
AaptOptions aaptOptions = (AaptOptions) FieldUtils.readField(aaptConfigBuilder.build(), "mAaptOptions", true);
ProcessExecutor processExecutor = (ProcessExecutor) FieldUtils.readField(aapt, "mProcessExecutor", true);
ProcessOutputHandler processOutputHandler = (ProcessOutputHandler) FieldUtils.readField(aapt, "mProcessOutputHandler", true);
BuildToolInfo buildToolInfo = (BuildToolInfo) FieldUtils.readField(aapt, "mBuildToolInfo", true);
PngProcessMode processMode = (PngProcessMode) FieldUtils.readField(aapt, "mProcessMode", true);
int cruncherProcesses = aaptOptions.getCruncherProcesses();
aapt = new AtlasAapt(processExecutor, processOutputHandler, buildToolInfo, getLogger(), processMode, cruncherProcesses);
} catch (Throwable e) {
throw new GradleException("aapt exception", e);
}
}
super.processResources(aapt, aaptConfigBuilder, enforceUniquePackageName);
}
Aggregations