]> git.saurik.com Git - android/aapt.git/blobdiff - Command.cpp
Only generate private symbols that are needed.
[android/aapt.git] / Command.cpp
index 607056a6c1f27395eb131b5e129a938e9368d60c..c79e243828c429205f2e18f72bb833f34688559b 100644 (file)
@@ -1617,6 +1617,12 @@ int doPackage(Bundle* bundle)
         goto bail;
     }
 
+    // Update symbols with information about which ones are needed as Java symbols.
+    assets->applyJavaSymbols();
+    if (SourcePos::hasErrors()) {
+        goto bail;
+    }
+
     // If we've been asked to generate a dependency file, do that here
     if (bundle->getGenDependencies()) {
         // If this is the packaging step, generate the dependency file next to
@@ -1638,7 +1644,7 @@ int doPackage(Bundle* bundle)
     }
 
     // Write out R.java constants
-    if (assets->getPackage() == assets->getSymbolsPrivatePackage()) {
+    if (!assets->havePrivateSymbols()) {
         if (bundle->getCustomPackage() == NULL) {
             // Write the R.java file into the appropriate class directory
             // e.g. gen/com/foo/app/R.java