summaryrefslogtreecommitdiff
path: root/tools/aapt/Resource.cpp
AgeCommit message (Collapse)Author
2012-09-17am d7252571: Merge "Add --error-on-failed-insert option to aapt."Xavier Ducrohet
* commit 'd72525718ea7ef3e1f97cf557365b143c8919a5b': Add --error-on-failed-insert option to aapt.
2012-09-11Add --output-text-symbols option to aapt.Xavier Ducrohet
Library projects in the SDK are built using --non-constant-id to generate a temporary R.java class. When the library is packaged with the application to generate an apk, the R class is recreated with the proper IDs due to all the resources coming from the app and all the libraries. However for large apps with many libraries (each with their own R class in their package), this means a lot of unnecessary IDs: all R classes contains all the IDs including for resources from by projects they don't have access through the dependency graph. For really large apps (X,000 resources), with lots of libraries (10+), this can generate tens of thousands of resources, which can trigger dalvik's limit of 65K fields and methods per dex files. This changes lets aapt generate not only the R class but a simple text file containing the list of all those IDs so that it is easier to parse back. The SDK build system will not ask aapt to generate the R class of the libraries (through the --extra-packages option), instead it will then read this file to know what IDs are needed for each library and generate a much smaller R class for each library (using the same text file output from compiling all the resources to get the final integer value). Change-Id: I4db959fec372cf3ead9950e4b2b82fa1ae7eed2d
2012-09-11Add --error-on-failed-insert option to aapt.Xavier Ducrohet
The new SDK build system give the ability to insert versionCode/Name and min/targetSdkVersion in the manifest but aapt won't replace those if they already exist. The main problem is that aapt doesn't actually fail when it doesn't replace them, making the output not what the developer wanted. This patch set adds an option to aapt to make it return an error if the insert failed because the attribute already existed. Change-Id: I8938ec1238da407a8562c974e9598db39001ffd9
2012-07-19Fix aapt -G to properly support class attr in fragment.Xavier Ducrohet
The code added attributes android:name and class to a KeyedVector under the same key (fragment) so the 2nd add (android:name) removed class with was never checked. This replace the value type in the KeyedVector to be Vector<NamespaceAttributePair> instead of just NamespaceAttributePair. Change-Id: I009b8a8cca878191661c2a63bb14c967d230498d
2012-05-18Add aapt support for generating proguard rules for onClick methods.Dianne Hackborn
Also fix Activity menu inflater when using the dark on light theme wrapper to still be able to find onClick listeners. Change-Id: Ie206db26d1df96041bc477804e476b02ad99dc9d
2012-03-17aapt: Preprocess images in parallel.Jeff Brown
Currently hardcoded to use up to 4 threads. This change substantially reduces the amount of time spent preprocessing framework resources to just a few seconds. Change-Id: I02fdd283fb529a152aeb22ac87f278779fd77983
2012-02-07Only generate private symbols that are needed.Dianne Hackborn
Change-Id: Icc4c86638db8429a387bf87c934cc712f807e213
2012-01-31aapt now sorts the strings in the resource string pool.Dianne Hackborn
In our current environment with very many translations, this can save a lot of RAM -- for example over 200K in Gmail just by sorting the strings in the Gmail .apk (not the framework). Also add a new aapt command to print the contents of the resource table string pool. Change-Id: I1da037b3e2c377b890833ff57ab158965314ac48
2011-10-27AAPT fix printf %zd crash on Windows.Raphael
There's no printf %zd on Mingw/Cygwin so the verbose printf crashes aapt. SDK bugs: 20395, 20986 Change-Id: I5b8ac36749263205a19f1448b1aaca90d5a2e06d
2011-10-16New aapt feature to do smarter filtering of configurations.Dianne Hackborn
This adds a --preferred-configurations flag that specifies the specific configurations you would like to have. It is smarter than "-c" because it will avoid stripping a configuration if that would result in there being no value for the resource. It is dumber than "-c" because it can't process as many kinds of resources. It is really only intended for bitmaps and use with density configs. This required re-arranging AaptAssets to group files together by config again, like they used to be. I think this hasn't broken anything. Hopefully. Change-Id: I4e9d12ff6e6dbd1abb8fd4cb1814c6674b19d0e5
2011-08-18am d98e1be2: am f4750724: am 9d829f98: am 21e6e2de: Merge "Change generated ↵Xavier Ducrohet
dependency file names" * commit 'd98e1be20e1cca5c36c7e0344500d4a5574568aa': Change generated dependency file names
2011-08-18am f4750724: am 9d829f98: am 21e6e2de: Merge "Change generated dependency ↵Xavier Ducrohet
file names" * commit 'f4750724cf8db972a052cb388dc9a39fc7aa6dd6': Change generated dependency file names
2011-08-16Change generated dependency file namesJosiah Gaskin
This changes the name of the generated dependency files to R.java.d and <ApkName>.ap_.d respectively. Change-Id: I17e18770fc0d0a5d31c7b37b40ac1949f45ef13a
2011-07-20am 84be06e4: resolved conflicts for merge of ea9e6d24 to honeycomb-plus-aospXavier Ducrohet
* commit '84be06e4ce0778fbf0c1ac72f94795ef8433439b': Added Caching for PreProcessed PNGs
2011-07-20resolved conflicts for merge of ea9e6d24 to honeycomb-plus-aospXavier Ducrohet
Change-Id: I8e047147a4d2c899b6654c03a5f32b04d929e602
2011-07-20am a125c937: resolved conflicts for merge of 2c311be7 to honeycomb-plus-aospXavier Ducrohet
* commit 'a125c937de06b1cc43368743592f47513eb88b76': Add generation of dependency file for .ap_ package
2011-07-20resolved conflicts for merge of 2c311be7 to honeycomb-plus-aospXavier Ducrohet
Change-Id: I806c7b4ae95f66df621587e52497dd8739a115fe
2011-07-20Added Caching for PreProcessed PNGsJosiah Gaskin
Added a cache management system for pre-processed PNG files along with unit tests. The cache system will be used if the --no-crunch flag is passed to AAPT during the package phase. The cache can be updated by a call to 'aapt crunch' (see usage statement). Also put in benchmarking code. Change-Id: I58271fb2ee2f5f9075fd74d4ff6f15e7afabd05c
2011-07-19am 9139868b: am ba6c98db: am 82943ecf: am d40c93f6: Merge "Add dependency ↵Xavier Ducrohet
generation to Aapt for R.java" * commit '9139868b6c5cb29b3665984225dceb0193fec31d': Add dependency generation to Aapt for R.java
2011-07-19am ba6c98db: am 82943ecf: am d40c93f6: Merge "Add dependency generation to ↵Xavier Ducrohet
Aapt for R.java" * commit 'ba6c98db8f21016f81ecac35bb0ea3c433044bb7': Add dependency generation to Aapt for R.java
2011-07-18Add generation of dependency file for .ap_ packageJosiah Gaskin
Make Aapt generate a dependency file in the same directory as the output ap_ file if the --generate-dependencies flag is set. This dependency file can then be read by the ant exec loop task to see whether to repackage resources. Change-Id: I763679414daf76369700aa599c26dcf78d4de099
2011-06-27Add dependency generation to Aapt for R.javaJosiah Gaskin
Make Aapt generate a dependency file in the location specified by RClassDir for R.java if the --generate-dependencies flag is set. This dependency file is then read by the ant exec loop task to see whether to recreate R.java. Change-Id: I7152dac86b6ea0e448ef65e3a95694afe233c789
2011-06-20Output Proguard options for also overlay layouts.Ying Wang
Change-Id: I7bfac476247bd7b532510e295cb1a3e61e9af88b
2011-02-28am ce57a7f3: am 6504490c: am dff6b8e7: Merge "Add --non-constant-id to aapt."Xavier Ducrohet
* commit 'ce57a7f35344e76689d30f45964d1e37b78280cb': GpsLocationProvider: Clean up HAL initialization/cleanup sequence Fixed GSM encoded network initiated position request Ensuring thread-safe usage of DateFormat. Fixing infinite loop for zero duration. Fix for an infinite loop while scrolling lists. WAPPushManager, WAP Push over SMS message handler Add --non-constant-id to aapt.
2011-02-14Add --non-constant-id to aapt.Xavier Ducrohet
This option enbables creating resource constant in the R class that are not actual constant, but simply static fields. The goal is to build library projects with these types of IDs so that the constant does not get inlined in the library code, since the ID for the library resources only are not the final values. The final resource IDs, generated from the main project and its library(ies), will have proper constant with the final values. This allows us to generate binary library bundle (a jar file and associated resources) that can be distributed. Additionally, this will let us make the library project support in Eclipse much more robust and a better user experience overall. Change-Id: Ibe2f08d68493fde658fc3f7606abf7446f312ad2
2011-01-05Add new "animator" and "interpolator" resource directories.Dianne Hackborn
First phase, allowing apps to move over to the new names. Change-Id: Ia16f3e2383e4a6599a0011d0464f0aacb1ce9207
2010-12-08Change assets to use 64-bit APIKenny Root
The asset system and supporting libraries were using off_t instead of off64_t to access files larger than 2GB (32-bit signed). This change replaces all off_t with off64_t and lseek64. There is a new utils/Compat.h added for Mac OS compatibility. Also fixed some size-related compiler warnings. Bug: 3205336 Change-Id: I9097b3cb7a602e811fe52f245939d8975da55e9e
2010-11-22Add knowledge of mipmap to aaptKenny Root
New mipmap drawable type that does not get filtered according to configuration. Useful for things that get built as part of the system. Change-Id: I556033d065e504079271dce79c23c90d3c387ce4
2010-09-10am fa888784: am 89fef418: Merge "Avoid pre-processing images when they ↵Xavier Ducrohet
won\'t be used" Merge commit 'fa8887848e2877dd96e853dfcd52086f1b66c26b' * commit 'fa8887848e2877dd96e853dfcd52086f1b66c26b': Avoid pre-processing images when they won't be used
2010-09-10am 89fef418: Merge "Avoid pre-processing images when they won\'t be used"Xavier Ducrohet
Merge commit '89fef4183a3c58aebbbf66e894bbdc1ae9f634e9' into gingerbread-plus-aosp * commit '89fef4183a3c58aebbbf66e894bbdc1ae9f634e9': Avoid pre-processing images when they won't be used
2010-09-03Avoid pre-processing images when they won't be usedAnthony Newnam
Change-Id: Iffa31228ca95a2e29ccc0aa81bda0fc66922d577
2010-08-31Add a --debug-mode option to aapt.Xavier Ducrohet
When passed (with no needed parameters) to the aapt command line, aapt will insert debuggable=true in the application node of the manifest automatically. This is to be used by the SDK tools to make true "debug" builds that require no code/file change. Change-Id: I909759caef499a91d10cc9a0902c6448c87e75ef
2010-08-31am b4649ec7: am 23827557: Merge "Add a --debug-mode option to aapt." into ↵Xavier Ducrohet
gingerbread Merge commit 'b4649ec720fa959b700a7a03c089bfdc61321d16' * commit 'b4649ec720fa959b700a7a03c089bfdc61321d16': Add a --debug-mode option to aapt.
2010-08-31Add a --debug-mode option to aapt.Xavier Ducrohet
When passed (with no needed parameters) to the aapt command line, aapt will insert debuggable=true in the application node of the manifest automatically. This is to be used by the SDK tools to make true "debug" builds that require no code/file change. Change-Id: I6f0a7af7b7d51f26bb0ec012e6f142a6060b8618
2010-08-20Update aapt to find fragment references.Dianne Hackborn
Add knowledge about <fragment class="..."> for layout files and update to reflect the change of the header tag from Header. Change-Id: I91e2a5f204a8e222367985383c1721030c7954d8
2010-08-16am 8cfd3c01: am e05184f2: Merge "Output proguard keep flags for fragment ↵Ying Wang
classes." into gingerbread Merge commit '8cfd3c01e4582a587765588c02234527e7808ca0' * commit '8cfd3c01e4582a587765588c02234527e7808ca0': Output proguard keep flags for fragment classes.
2010-08-13Output proguard keep flags for fragment classes.Ying Wang
Change-Id: I28c10fbf18b91f8ba3dfc2575cd41215f65f11ec Bug: 2916847
2010-06-25Fixes a few minor problems with AAPTSteve Block
- Fixes casting problems with stricter compilers - Adds a couple of missing ifdef guards This is a first step toward being able to generate APKs on the fly on the device. Bug: 2766918 Change-Id: Icaaee5a4032afa313256add321b447443861dd85
2010-03-24Use correct API version for UTF-8 checkingKenny Root
Use the constant for checking the API version in aapt instead of a bare number. Bug: 2541326 Change-Id: Ice7af7b393363a00f1832dd84753b8138d057fb4
2010-03-18Make aapt warning conciseKenny Root
The previous warning made it seem like it could be using the value specified on the command line, but, in fact, it would ignore the command line value if it were already specified in the AndroidManifest.xml Change-Id: I15e8161e094f17412680d25d3b7b810474eb4a31
2010-03-18Fix minSdkVersion scanning to not throw warningsKenny Root
For the UTF8/UTF16 switch code, we needed to know what was the minSdkVersion specified as early as possible. Unfortunately, this threw warnings when the SDK was compiling since we always set this field in the Bundle. This splits out the field used by the initial AndroidManifest.xml scan to a separate one that we won't attempt to re-insert into the AndroidManifest.xml This also switches the logic to better reflect the preference of UTF-8 over UTF-16; previously UTF-16 was the default. Change-Id: Ia81f6b21047043ebb711eb24c2c3718534979ef6
2010-03-09Add ability for some manifest attributes to reference resources.Dianne Hackborn
This loosens our restriction on many manifest attributes requiring literal string values, to allow various ones to use values from resources. This is only allowed if the resource value does not change from configuration changes, and the restriction is still in place for attributes that are core to security (requesting permissions) or market operation (used libraries and features etc). Change-Id: I4da02f6a5196cb6a7dbcff9ac25403904c42c2c8
2010-03-05Fix potential aapt crash when processing overlay.Xavier Ducrohet
If an overlay has a type of resources that's not defined in the main res pool, then aapt would crash. This dynamically create new ResourceTypeSet when needed when processing the overlays Change-Id: I67bc3622281bde73cf42f37a0983798d3f658ce2
2010-03-03Fix issue #2485441: SettingsBackupAgent crashed system serverDianne Hackborn
Need to take care of fixing up backupAdjust as well as reporting it to ProGuard.
2010-03-02Fix issue #2482423: Settings is broken due to dead-code strippingDianne Hackborn
Take care of more custom classes in layouts, and also scan through preference XMLs.
2010-03-01Fix issue #2448075: aapt doesn't fix up activity-alias ↵Dianne Hackborn
android:targetActivity links And related: - The aapt tool now sets a resource configurations sdk level to match any configs that have been set (for example if you specify density your sdk level will be at least 4). - New option to modify the targetPackage attribute of instrumentation. - Clean up of aapt options help. - Fix of UI type values to leave 0 for "unspecified". - Make the UI mode config APIs public.
2010-02-24Create own reference for minSdkVersion in aaptKenny Root
Fix bug where applications defining a minSdkVersion were experiencing transient errors from memory corruption in aapt. Change-Id: I839d5eda7388baac6133e735fa59f9799ca2822d
2010-02-24Scan for android namespace in manifestKenny Root
android:minSdkVersion wasn't being correctly scanned because the namespace was incorrect. This fixes that problem so packages aren't generated as UTF-8 when minSdkVersion is less than 7. Change-Id: I8f45d47ea886915da6a4770f6e111e6085d61bee
2010-02-11Introduce special UI modes for night and car usage.Tobias Haamel
The device mode is now called ui mode. Furthermore is the order of precedence for the resources now in such a way that the ui mode needs to be specified after the orientation and before the density. The ui mode can be set, like it is done for the locale, as follows: IActivityManager am = ActivityManagerNative.getDefault(); Configuration config = am.getConfiguration(); config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY; am.updateConfiguration(config); To allow users to disable the car mode and set the night mode the IUiModeManager interface is used. The automatic night mode switching will be added in a separate change.
2010-02-01Add the --rename-manifest-package option to aapt.Jeff Hamilton
It allows you to force override the manifest package listed in the AndroidManifest.xml when creating an APK file. Change-Id: I7eac7943c4e56610b65728ae54773a273634fd9d