use of org.jetbrains.jps.indices.IgnoredFileIndex in project android by JetBrains.
the class AndroidResourcePackagingBuilder method doPackageResources.
private static boolean doPackageResources(@NotNull final CompileContext context, @NotNull File manifestFile, @NotNull IAndroidTarget target, @NotNull String[] resourceDirPaths, @NotNull String[] assetsDirPaths, @NotNull String outputPath, boolean releasePackage, @NotNull String moduleName, @NotNull BuildOutputConsumer outputConsumer, @Nullable String customManifestPackage, @Nullable String additionalParameters) {
try {
final IgnoredFileIndex ignoredFileIndex = context.getProjectDescriptor().getIgnoredFileIndex();
final Map<AndroidCompilerMessageKind, List<String>> messages = AndroidApt.packageResources(target, -1, manifestFile.getPath(), resourceDirPaths, assetsDirPaths, outputPath, null, !releasePackage, 0, customManifestPackage, additionalParameters, new FileFilter() {
@Override
public boolean accept(File pathname) {
return !ignoredFileIndex.isIgnored(PathUtilRt.getFileName(pathname.getPath()));
}
});
AndroidJpsUtil.addMessages(context, messages, BUILDER_NAME, moduleName);
final boolean success = messages.get(AndroidCompilerMessageKind.ERROR).size() == 0;
if (success) {
final List<String> srcFiles = new ArrayList<String>();
srcFiles.add(manifestFile.getPath());
fillRecursively(resourceDirPaths, srcFiles);
fillRecursively(assetsDirPaths, srcFiles);
outputConsumer.registerOutputFile(new File(outputPath), srcFiles);
}
return success;
} catch (final IOException e) {
AndroidJpsUtil.reportExceptionError(context, null, e, BUILDER_NAME);
return false;
}
}
Aggregations