FilterResourcesStep.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:buck-cutom 作者:
/**
 * Creates a command that filters a specified set of directories.
 * @param inResDirToOutResDirMap set of {@code res} directories to filter
 * @param filterDrawables whether to filter drawables (images)
 * @param filterStrings whether to filter non-english strings
 * @param whitelistedStringDirs set of directories containing string resource files that must not
 *     be filtered out.
 * @param filteredDirectoryCopier refer {@link FilteredDirectoryCopier}
 * @param targetDensities densities we're interested in keeping (e.g. {@code mdpi}, {@code hdpi}
 *     etc.) Only applicable if filterDrawables is true
 * @param drawableFinder refer {@link DrawableFinder}. Only applicable if filterDrawables is true.
 * @param imageScaler if not null, use the {@link ImageScaler} to downscale higher-density
 *     drawables for which we weren't able to find an image file of the proper density (as opposed
 *     to allowing Android to do it at runtime). Only applicable if filterDrawables. is true.
 */
@VisibleForTesting
FilterResourcesStep(
    ImmutableBiMap<Path, Path> inResDirToOutResDirMap,
    boolean filterDrawables,
    boolean filterStrings,
    ImmutableSet<Path> whitelistedStringDirs,
    FilteredDirectoryCopier filteredDirectoryCopier,
    @Nullable Set<Filters.Density> targetDensities,
    @Nullable DrawableFinder drawableFinder,
    @Nullable ImageScaler imageScaler) {

  Preconditions.checkArgument(filterDrawables || filterStrings);
  Preconditions.checkArgument(!filterDrawables ||
      (targetDensities != null && drawableFinder != null));
  this.inResDirToOutResDirMap = Preconditions.checkNotNull(inResDirToOutResDirMap);
  this.filterDrawables = filterDrawables;
  this.filterStrings = filterStrings;
  this.whitelistedStringDirs = Preconditions.checkNotNull(whitelistedStringDirs);
  this.filteredDirectoryCopier = Preconditions.checkNotNull(filteredDirectoryCopier);
  this.targetDensities = targetDensities;
  this.drawableFinder = drawableFinder;
  this.imageScaler = imageScaler;
  this.nonEnglishStringFilesBuilder = ImmutableSet.builder();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号