From: Dianne Hackborn Date: Fri, 3 Sep 2010 00:59:51 +0000 (-0700) Subject: am 31103928: am 192b56d4: Merge "Implement #2964234: Add support for element to aapt" into gingerbread Merge commit '31103928ed5b9091bcd7de74c8a49675d10c87e7' * commit '31103928ed5b9091bcd7de74c8a49675d10c87e7': Implement #2964234: Add support for element to aapt --- diff --git a/Command.cpp b/Command.cpp index f71ebb9..eaff0f4 100644 --- a/Command.cpp +++ b/Command.cpp @@ -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"); diff --git a/Package.cpp b/Package.cpp index 999a5cf..3cb614f 100644 --- a/Package.cpp +++ b/Package.cpp @@ -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& jars = bundle->getJarFiles(); diff --git a/Resource.cpp b/Resource.cpp index 9c5fcda..01728a1 100644 --- a/Resource.cpp +++ b/Resource.cpp @@ -542,11 +542,11 @@ static bool applyFileOverlay(Bundle *bundle, DefaultKeyedVector > 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()); @@ -2081,12 +2081,13 @@ writeProguardForLayouts(ProguardKeepSet* keep, const sp& assets) // tag:attribute pairs that should be checked in layout files. KeyedVector 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 kXmlTagAttrPairs; addTagAttrPair(&kXmlTagAttrPairs, "PreferenceScreen", RESOURCES_ANDROID_NAMESPACE, "fragment"); - addTagAttrPair(&kXmlTagAttrPairs, "Header", RESOURCES_ANDROID_NAMESPACE, "fragment"); + addTagAttrPair(&kXmlTagAttrPairs, "header", RESOURCES_ANDROID_NAMESPACE, "fragment"); const Vector >& dirs = assets->resDirs(); const size_t K = dirs.size(); diff --git a/ResourceTable.cpp b/ResourceTable.cpp index 755b93b..f40a877 100644 --- a/ResourceTable.cpp +++ b/ResourceTable.cpp @@ -2366,7 +2366,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::iterator locales = configSet.begin(); + for (set::const_iterator locales = configSet.begin(); locales != configSet.end(); locales++) { fprintf(stdout, " %s", (*locales).string()); diff --git a/StringPool.cpp b/StringPool.cpp index a09cec0..e28bdff 100644 --- a/StringPool.cpp +++ b/StringPool.cpp @@ -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); } } diff --git a/XMLNode.cpp b/XMLNode.cpp index 8551b0f..cee8546 100644 --- a/XMLNode.cpp +++ b/XMLNode.cpp @@ -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; diff --git a/ZipFile.h b/ZipFile.h index dbbd072..7877550 100644 --- 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