From 7f305ce77069cf8432374f12392a3ce3a476bdce Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Mon, 2 Nov 2009 18:31:46 -0800 Subject: [PATCH] Ignore hidden files and vi swap files during packaging. (do not merge) BUG #2233458 This is integrated from eclair. --- .../src/com/android/jarutils/JavaResourceFilter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/jarutils/src/com/android/jarutils/JavaResourceFilter.java b/tools/jarutils/src/com/android/jarutils/JavaResourceFilter.java index 1a97e288d..867851034 100644 --- a/tools/jarutils/src/com/android/jarutils/JavaResourceFilter.java +++ b/tools/jarutils/src/com/android/jarutils/JavaResourceFilter.java @@ -83,11 +83,17 @@ public class JavaResourceFilter implements IZipEntryFilter { * @param extension the extension of the file (excluding '.') * @return true if the file should be packaged as standard java resources. */ - public static boolean checkFileForPackaging(String fileName, String extension) { + public static boolean checkFileForPackaging(String fileName, String extension) { + // Note: this method is used by com.android.ide.eclipse.adt.internal.build.ApkBuilder + if (fileName.charAt(0) == '.') { // ignore hidden files. + return false; + } + return "aidl".equalsIgnoreCase(extension) == false && // Aidl files "java".equalsIgnoreCase(extension) == false && // Java files "class".equalsIgnoreCase(extension) == false && // Java class files "scc".equalsIgnoreCase(extension) == false && // VisualSourceSafe + "swp".equalsIgnoreCase(extension) == false && // vi swap file "package.html".equalsIgnoreCase(fileName) == false && // Javadoc "overview.html".equalsIgnoreCase(fileName) == false && // Javadoc ".cvsignore".equalsIgnoreCase(fileName) == false && // CVS