]> git.saurik.com Git - android/aapt.git/commitdiff
am 820caf7b: am 8821ba86: Ummm... f*, stop breaking the build.
authorDianne Hackborn <hackbod@google.com>
Thu, 9 Jun 2011 23:18:07 +0000 (16:18 -0700)
committerAndroid Git Automerger <android-git-automerger@android.com>
Thu, 9 Jun 2011 23:18:07 +0000 (16:18 -0700)
* commit '820caf7b04f1e5c83599437e9e783e91322eb4f9':
  Ummm...  f*, stop breaking the build.

Bundle.h
Main.cpp
ResourceTable.cpp

index 15570e47e6a121d8d40bbd20527f5d8ce3cbe848..fa84e938cab4732749f3ca36634947ae8891de95 100644 (file)
--- a/Bundle.h
+++ b/Bundle.h
@@ -40,6 +40,7 @@ public:
           mWantUTF16(false), mValues(false),
           mCompressionMethod(0), mOutputAPKFile(NULL),
           mManifestPackageNameOverride(NULL), mInstrumentationPackageNameOverride(NULL),
+          mIsOverlayPackage(false),
           mAutoAddOverlay(false), mAssetSourceDir(NULL), mProguardFile(NULL),
           mAndroidManifestFile(NULL), mPublicOutputFile(NULL),
           mRClassDir(NULL), mResourceIntermediatesDir(NULL), mManifestMinSdkVersion(NULL),
@@ -92,6 +93,8 @@ public:
     void setManifestPackageNameOverride(const char * val) { mManifestPackageNameOverride = val; }
     const char* getInstrumentationPackageNameOverride() const { return mInstrumentationPackageNameOverride; }
     void setInstrumentationPackageNameOverride(const char * val) { mInstrumentationPackageNameOverride = val; }
+    bool getIsOverlayPackage() const { return mIsOverlayPackage; }
+    void setIsOverlayPackage(bool val) { mIsOverlayPackage = val; }
     bool getAutoAddOverlay() { return mAutoAddOverlay; }
     void setAutoAddOverlay(bool val) { mAutoAddOverlay = val; }
 
@@ -219,6 +222,7 @@ private:
     const char* mOutputAPKFile;
     const char* mManifestPackageNameOverride;
     const char* mInstrumentationPackageNameOverride;
+    bool        mIsOverlayPackage;
     bool        mAutoAddOverlay;
     const char* mAssetSourceDir;
     const char* mProguardFile;
index 266a02f25a17c511969832f7315e77472979deea..1e63131eb5bfbe5ee7348a7991eff289a168a32c 100644 (file)
--- a/Main.cpp
+++ b/Main.cpp
@@ -68,6 +68,7 @@ void usage(void)
         "        [-S resource-sources [-S resource-sources ...]] "
         "        [-F apk-file] [-J R-file-dir] \\\n"
         "        [--product product1,product2,...] \\\n"
+        "        [-o] \\\n"
         "        [raw-files-dir [raw-files-dir] ...]\n"
         "\n"
         "   Package the android resources.  It will read assets and resources that are\n"
@@ -105,6 +106,7 @@ void usage(void)
         "   -j  specify a jar or zip file containing classes to include\n"
         "   -k  junk path of file(s) added\n"
         "   -m  make package directories under location specified by -J\n"
+        "   -o  create overlay package (ie only resources; expects <overlay-package> in manifest)\n"
 #if 0
         "   -p  pseudolocalize the default configuration\n"
 #endif
@@ -275,6 +277,9 @@ int main(int argc, char* const argv[])
             case 'm':
                 bundle.setMakePackageDirs(true);
                 break;
+            case 'o':
+                bundle.setIsOverlayPackage(true);
+                break;
 #if 0
             case 'p':
                 bundle.setPseudolocalize(true);
index e618877bd5de6d173adf9ec52ce5fdf961921d2c..f3ca23d9efaac8187b114648cb1d8683d1b27ca1 100644 (file)
@@ -3706,7 +3706,9 @@ sp<ResourceTable::Package> ResourceTable::getPackage(const String16& package)
 {
     sp<Package> p = mPackages.valueFor(package);
     if (p == NULL) {
-        if (mIsAppPackage) {
+        if (mBundle->getIsOverlayPackage()) {
+            p = new Package(package, 0x00);
+        } else if (mIsAppPackage) {
             if (mHaveAppPackage) {
                 fprintf(stderr, "Adding multiple application package resources; only one is allowed.\n"
                                 "Use -x to create extended resources.\n");