use of android.databinding.tool.LayoutXmlProcessor in project atlas by alibaba.
the class AwbXmlProcessor method getLayoutXmlProcessor.
public static LayoutXmlProcessor getLayoutXmlProcessor(AppVariantContext appVariantContext, AwbBundle awbBundle, DataBindingBuilder dataBindingBuilder) {
File resourceBlameLogDir = appVariantContext.getAwbBlameLogFolder(awbBundle);
// if (!resourceBlameLogDir.exists()) {
// resourceBlameLogDir = appVariantContext.getScope().getResourceBlameLogDir();
// }
final MergingLog mergingLog = new MergingLog(resourceBlameLogDir);
LayoutXmlProcessor layoutXmlProcessor = new LayoutXmlProcessor(// "com.taobao.demo2",
appVariantContext.getVariantConfiguration().getOriginalApplicationId(), dataBindingBuilder.createJavaFileWriter(appVariantContext.getAwbClassOutputForDataBinding(awbBundle)), appVariantContext.getVariantConfiguration().getMinSdkVersion().getApiLevel(), false, // appVariantContext.getVariantData().getType() == VariantType.LIBRARY,
new LayoutXmlProcessor.OriginalFileLookup() {
@Override
public File getOriginalFileFor(File file) {
SourceFile input = new SourceFile(file);
SourceFile original = mergingLog.find(input);
// it is not what we want so we alter the response.
return original == input ? null : original.getSourceFile();
}
});
return layoutXmlProcessor;
}
Aggregations