]> git.saurik.com Git - android/aapt.git/commitdiff
am ceb3aae3: am 4e1658af: Merge "Avoid pre-processing images when they won\'t be...
authorXavier Ducrohet <xav@google.com>
Tue, 12 Oct 2010 00:42:54 +0000 (17:42 -0700)
committerAndroid Git Automerger <android-git-automerger@android.com>
Tue, 12 Oct 2010 00:42:54 +0000 (17:42 -0700)
Merge commit 'ceb3aae348d4b17e6282fe7706fc22b699ee9a1d'

* commit 'ceb3aae348d4b17e6282fe7706fc22b699ee9a1d':
  Avoid pre-processing images when they won't be used

Command.cpp
Package.cpp
Resource.cpp
ResourceTable.cpp
StringPool.cpp
XMLNode.cpp
ZipFile.h

index f71ebb98344f289a7801ddc1058269c4f76cb2a2..eaff0f407f056982219159db75701a63651c8428 100644 (file)
@@ -198,8 +198,10 @@ int doList(Bundle* bundle)
         if (&res == NULL) {
             printf("\nNo resource table found.\n");
         } else {
+#ifndef HAVE_ANDROID_OS
             printf("\nResource table:\n");
             res.print(false);
+#endif
         }
 
         Asset* manifestAsset = assets.openNonAsset("AndroidManifest.xml",
@@ -390,8 +392,9 @@ int doDump(Bundle* bundle)
     }
 
     if (strcmp("resources", option) == 0) {
+#ifndef HAVE_ANDROID_OS
         res.print(bundle->getValues());
-
+#endif
     } else if (strcmp("xmltree", option) == 0) {
         if (bundle->getFileSpecCount() < 3) {
             fprintf(stderr, "ERROR: no dump xmltree resource file specified\n");
index 999a5cf82222a4ac6621c0920ea8b10155a28e00..3cb614f8e1395431281b4141b0102f89132d1cad 100644 (file)
@@ -441,7 +441,7 @@ ssize_t processJarFile(ZipFile* jar, ZipFile* out)
 
 ssize_t processJarFiles(Bundle* bundle, ZipFile* zip)
 {
-    ssize_t err;
+    status_t err;
     ssize_t count = 0;
     const android::Vector<const char*>& jars = bundle->getJarFiles();
 
index c8ba9048f8670a0dcd723c14e7567d0341939883..822262eda8bed411255ff816291d0cca9fd3ccc1 100644 (file)
@@ -542,11 +542,11 @@ static bool applyFileOverlay(Bundle *bundle,
                         DefaultKeyedVector<AaptGroupEntry, sp<AaptFile> > baseFiles =
                                 baseGroup->getFiles();
                         for (size_t i=0; i < baseFiles.size(); i++) {
-                            printf("baseFile %ld has flavor %s\n", i,
+                            printf("baseFile %d has flavor %s\n", i,
                                     baseFiles.keyAt(i).toString().string());
                         }
                         for (size_t i=0; i < overlayFiles.size(); i++) {
-                            printf("overlayFile %ld has flavor %s\n", i,
+                            printf("overlayFile %d has flavor %s\n", i,
                                     overlayFiles.keyAt(i).toString().string());
                         }
                     }
@@ -560,7 +560,7 @@ static bool applyFileOverlay(Bundle *bundle,
                                 keyAt(overlayGroupIndex));
                         if(baseFileIndex < UNKNOWN_ERROR) {
                             if (bundle->getVerbose()) {
-                                printf("found a match (%ld) for overlay file %s, for flavor %s\n",
+                                printf("found a match (%d) for overlay file %s, for flavor %s\n",
                                         baseFileIndex,
                                         overlayGroup->getLeaf().string(),
                                         overlayFiles.keyAt(overlayGroupIndex).toString().string());
@@ -2083,12 +2083,13 @@ writeProguardForLayouts(ProguardKeepSet* keep, const sp<AaptAssets>& assets)
     // tag:attribute pairs that should be checked in layout files.
     KeyedVector<String8, NamespaceAttributePair> kLayoutTagAttrPairs;
     addTagAttrPair(&kLayoutTagAttrPairs, "view", NULL, "class");
+    addTagAttrPair(&kLayoutTagAttrPairs, "fragment", NULL, "class");
     addTagAttrPair(&kLayoutTagAttrPairs, "fragment", RESOURCES_ANDROID_NAMESPACE, "name");
 
     // tag:attribute pairs that should be checked in xml files.
     KeyedVector<String8, NamespaceAttributePair> kXmlTagAttrPairs;
     addTagAttrPair(&kXmlTagAttrPairs, "PreferenceScreen", RESOURCES_ANDROID_NAMESPACE, "fragment");
-    addTagAttrPair(&kXmlTagAttrPairs, "Header", RESOURCES_ANDROID_NAMESPACE, "fragment");
+    addTagAttrPair(&kXmlTagAttrPairs, "header", RESOURCES_ANDROID_NAMESPACE, "fragment");
 
     const Vector<sp<AaptDir> >& dirs = assets->resDirs();
     const size_t K = dirs.size();
index 29644a69b4c7bee075b5616658312ff696a7dea0..1d6b18dcdd9531b1947ccb5cefc44c280c446abc 100644 (file)
@@ -2442,7 +2442,7 @@ ResourceTable::validateLocalizations(void)
         if (configSet.count(defaultLocale) == 0) {
             fprintf(stdout, "aapt: warning: string '%s' has no default translation in %s; found:",
                     String8(nameIter->first).string(), mBundle->getResourceSourceDirs()[0]);
-            for (set<String8>::iterator locales = configSet.begin();
+            for (set<String8>::const_iterator locales = configSet.begin();
                  locales != configSet.end();
                  locales++) {
                 fprintf(stdout, " %s", (*locales).string());
index a09cec05110b4102f284225d2f0ff0526dc962c5..e28bdff410b0a9a28e9978129c1e6e28a956d795 100644 (file)
@@ -30,7 +30,7 @@ void printStringPool(const ResStringPool* pool)
             str = String8(pool->stringAt(s, &len)).string();
         }
 
-        printf("String #%ld: %s\n", s, str);
+        printf("String #%d: %s\n", s, str);
     }
 }
 
index 8551b0f9c9030c57d00d8dbba6085a0fc9952ac5..cee85469c8481ceabd2d3b98cb49b6852f4fe1aa 100644 (file)
@@ -203,9 +203,13 @@ status_t parseStyledString(Bundle* bundle,
                 }
             }
             if (xliffDepth == 0 && pseudolocalize) {
+#ifdef ENABLE_PSEUDOLOCALIZE
                 std::string orig(String8(text).string());
                 std::string pseudo = pseudolocalize_string(orig);
                 curString.append(String16(String8(pseudo.c_str())));
+#else
+                assert(false);
+#endif
             } else {
                 if (isFormatted && hasSubstitutionErrors(fileName, inXml, text) != NO_ERROR) {
                     return UNKNOWN_ERROR;
index dbbd072d1692decfe2b79e855d5026f95ca2c8a2..78775502884bba157c7be86b88f6c3d9fd7e561f 100644 (file)
--- a/ZipFile.h
+++ b/ZipFile.h
@@ -57,7 +57,7 @@ public:
     /*
      * Open a new or existing archive.
      */
-    typedef enum {
+    enum {
         kOpenReadOnly   = 0x01,
         kOpenReadWrite  = 0x02,
         kOpenCreate     = 0x04,     // create if it doesn't exist