summaryrefslogtreecommitdiffstats
path: root/tools/aapt/Main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add support for building split APKsAdam Lesinski2014-05-111-7/+19
| | | | | | | | | | | | | | Build multiple APKs, each containing a disjoint subset of configurations. These can then be loaded into the device AssetManager and should operate as if they were never split. Use the idea of building multiple sets of files, where each set represents an APK. An ApkBuilder can place files in a set based on its configuration, but you can actually add directly to a set, in the case of the resources.arsc and generated AndroidManifest.xml for splits. Change-Id: Ic65d3f0ac1bbd290185695b9971d425c85ab1de3
* Shared library resource supportAdam Lesinski2014-03-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Shared libraries can now export resources for applications to use. Exporting resources works the same way the framework exports resources, by defining the public symbols in res/values/public.xml. Building a shared library requires aapt to be invoked with the --shared-lib option. Shared libraries will be assigned a package ID of 0x00 at build-time. At runtime, all loaded shared libraries will be assigned a new package ID. Currently, shared libraries should not import other shared libraries, as those dependencies will not be loaded at runtime. At runtime, reflection is used to update the package ID of resource symbols in the shared library's R class file. The package name of the R class file is assumed to be the same as the shared library's package name declared in its manifest. This will be customizable in a future commit. See /tests/SharedLibrary/ for examples of a shared library and its client. Bug:12724178 Change-Id: I60c0cb8ab87849f8f8a1a13431562fe8603020a7
* Add --replace-version flag to aapt.Jeff Davidson2014-02-251-0/+7
| | | | | | | | | | | | | | | | | Motivation: we'd like to programmatically specify the version name/code (i.e. to include the build number from the build server). However, this means that we cannot specify version info in the AndroidManifest.xml file, as this takes precedence. Not doing so makes IDE use more difficult, as the IDE gets version code 0 and won't install over an existing non-IDE version unless you first force a downgrade to an IDE build from the command line. This flag allows us to specify a very high version code in the AndroidManifest.xml file, making IDE builds take precedence, while still allowing us to override this info when performing command-line (official) builds. Change-Id: I5d01048698af5c26bdf19066c6cd4eca1115112a
* resolved conflicts for merge of 1b5b60d6 to masterAdam Lesinski2014-02-041-1/+1
|\ | | | | | | Change-Id: I2b713a55fcdf02c01afa99f175bf14248f210460
| * Add support for multiple asset dirs (-A)Adam Lesinski2014-01-231-1/+1
| | | | | | | | | | Bug: 12608034 Change-Id: I02c5a1a73b83498d799570428cca3dd914f8ac11
* | Add new aapt flag --error-on-missing-config-entryYing Wang2014-01-271-0/+4
| | | | | | | | | | | | | | | | It forces aapt to return an error if aapt fails to find an resource entry for a configuration. Bug: 11259444 Change-Id: Ie5674a29dff5d4455e7d7c94f6b25560fb1305b7
* | Revert "Move frameworks/base/tools/ to frameworks/tools/"Adam Lesinski2014-01-271-0/+655
| | | | | | | | This reverts commit 9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.
* | Move frameworks/base/tools/ to frameworks/tools/Mike Lockwood2013-08-281-655/+0
| | | | | | | | Change-Id: I3ffafdab27cc4aca256c3a5806b630795b75d5c8
* | Modify 'aapt dump badging' to output <meta-data> tagsMaurice Chu2013-08-211-1/+5
|/ | | | | | | | | | | This enables output of <meta-data> tags within the <application> element of the AndroidManifest.xml if the --include-meta-data command line option is invoked. For example, by aapt dump --include-meta-data badging Foo.apk Bug: 10257318 Change-Id: I88da1a14ab21146b64ac947e0eeb1107816acd4d
* Merge commit 'b3f66877' into afdmergeJeff Sharkey2013-04-291-0/+1
|\ | | | | | | Change-Id: I319863cf23b2e6eacfa4508f7b111fba7b1cbc24
| * Document the 'aapt dump strings' commandMårten Kongstad2013-04-291-0/+1
| | | | | | | | | | | | | | Update the usage page for aapt to mention 'strings' as a valid subcommand to 'dump'. Change-Id: Iadb2b8ce36951ff36ffbf6b5ea349ba1e2b12582
* | Add single crunch command to aapt.Xavier Ducrohet2013-01-021-8/+37
|/ | | | | | | | | | | | Previously the crunch command would work on a full res folder and output a full res folder (with only the drawables). This was only used in the SDK. The incremental logic is moved to the SDK build system so we change the crunch command (or rather add a new one) to only crunch a single file. Change-Id: I635ee3e871d035b9db2fb593802d914e48241abf
* Add --output-text-symbols option to aapt.Xavier Ducrohet2012-09-111-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add --error-on-failed-insert option to aapt.Xavier Ducrohet2012-09-111-0/+7
| | | | | | | | | | | | | | | | 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
* Support a new ANDROID_AAPT_IGNORE env var.Raphael Moll2012-05-091-2/+15
| | | | | | | | | | | | | | | | AAPT has a fixed built-in list of files and directories to ignore when parsing resource files. Over the years we always had developers requiring specific patterns. If the env var ANDROID_AAPT_IGNORE is set, it is parsed to find which file/directory patterns to ignore. Otherwise a default is used that matches the current behavior. Added a command-line option for it: aapt di --ignore-assets "foo*:*.blah" SDK Bug: 5343 24067 Change-Id: Ia4caa2a8188c8c1df143f884e459b8182645995f
* Build overlay packages just like regular packages.Mårten Kongstad2012-02-071-5/+0
| | | | | | | | | | | Previously, building overlay packages required passing aapt its -o flag. This commit decouples the idmap generation code from the effects of the -o flag. Since this commit renders the -o flag obsolete, support for the flag was removed from aapt as well. Change-Id: Ied2e0ab8cb800e49623f0a2044b06cd4935473d5
* New aapt feature to do smarter filtering of configurations.Dianne Hackborn2011-10-161-1/+15
| | | | | | | | | | | | | | | | | | | 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
* Added Caching for PreProcessed PNGsJosiah Gaskin2011-07-201-1/+20
| | | | | | | | | | 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
* Add generation of dependency file for .ap_ packageJosiah Gaskin2011-07-181-1/+1
| | | | | | | | | 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
* Add dependency generation to Aapt for R.javaJosiah Gaskin2011-06-271-1/+5
| | | | | | | | | 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
* Copy once-created R.java into library projectsJosiah Gaskin2011-06-271-0/+11
| | | | | | | | This change adds functionality in Aapt to allow specification of library projects to copy the generated R.java file into rather than regenerating the file for each library project. Change-Id: I05939d1dc875bd875be9298ca47cb639235070c6
* Runtime resource overlay, iteration 1.Mårten Kongstad2011-04-011-0/+5
| | | | | | | | | | | | | | | | Runtime resource overlay allows unmodified applications to appear as if they had been compiled with additional resources defined. See libs/utils/README for more information. This commit is the first iteration of runtime resource overlay. It provides the actual overlay modifications and loading of trusted overlay packages (ie residing in /vendor) targeting framework-res.apk. This commit loads exactly one overlay package. The overlay, if present, must target framework-res.apk and be located at /vendor/overlay/framework/framework-res.apk. Change-Id: If26ee7754813004a96c043dba37fbe99fa3919db
* Add --non-constant-id to aapt.Xavier Ducrohet2011-02-141-1/+7
| | | | | | | | | | | | | | | | | | | | | 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
* Add an aapt option to allow string variations for different devices.Eric Fischer2010-09-231-0/+13
| | | | | | | | | | | | | | | | | | | | The --product option to aapt is a comma-separated list of characteristics of the device being built for. For example, --product nosdcard,grayscale for a device with no SD card and a grayscale screen. Strings can specify a product="characteristic" option to cause that version of the string to be used only for that type of device. All such strings should also specify, at the end of the block, product="default", which will be used if none of the variations match. For example: <string name="choose" product="bw">Choose black or white</string> <string name="choose" product="grayscale">Choose a shade of gray</string> <string name="choose" product="default">Choose a color</string> The default characteristic will also be used when no --product option is specified. Change-Id: Ie6c1505599e02e15b7818e8be6ec47bc6ce71aaa
* Add a --debug-mode option to aapt.Xavier Ducrohet2010-08-311-2/+7
| | | | | | | | | | | 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
* Add --max-res-version flag to aapt.Ficus Kirkpatrick2010-08-131-0/+12
| | | | | | | | | | aapt will ignore any versioned resource directories over the specified version (if used). e.g. --max-res-version=6 will cause layout-land-v7 to be ignored. Merged from froyo. Change-Id: Ia4eabae535b95b75d18b0c83135d44ed9a95b9eb
* Fix minSdkVersion scanning to not throw warningsKenny Root2010-03-181-2/+1
| | | | | | | | | | | | | | 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
* Fix issue #2448075: aapt doesn't fix up activity-alias ↵Dianne Hackborn2010-03-011-5/+23
| | | | | | | | | | | | | | 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.
* Add --auto-add-overlay option to aapt.Xavier Ducrohet2010-02-041-0/+5
| | | | | | | This option allows resources only present in overlays to be added automatically instead of being declared through <add-resource> Change-Id: Iff782311056f6a045193e57d204f7d3413e11b26
* Add the --rename-manifest-package option to aapt.Jeff Hamilton2010-02-011-0/+9
| | | | | | | It allows you to force override the manifest package listed in the AndroidManifest.xml when creating an APK file. Change-Id: I7eac7943c4e56610b65728ae54773a273634fd9d
* Revise aapt options for UTF8/16 encodingKenny Root2009-12-111-7/+10
| | | | | | | | Remove option to force UTF-8 encoding which could corrupt packages meant for systems before API level 7. Added switch to allow encoding for UTF-16 which will allow API 7 and later to encode resources in UTF-16. Change-Id: I70d0bddb0dfd12dcbd08c95f613dcfe896ae680b
* resolved conflicts for merge of ce307f88 to eclair-mr2Jean-Baptiste Queru2009-12-101-4/+15
|\
| * Add --custom-package to aaptXavier Ducrohet2009-11-301-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | This is needed to add library support to the SDK. The goal is to have libraries and main project use the same package for the R/Manifest classes to that they can share code and resources. BUG 2293994 Change-Id: Ie4cdb5a3bdabe1760a91316fd8969e4f53344bf9
| * add "junk path" -k option to aapt (DO NOT MERGE)Doug Zongker2009-10-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a "junk path" option to aapt so that you can do: aapt add -k archive.zip path/to/some.file and have the file stored in the zip under the name "some.file" (without the path). Needed so that we can use 'aapt add' in place of 'zip -j' when building jar files, which will lead to smaller incremental OTAs. (This is a cherry-pick of a change already submitted to eclair-mr2; the change was approved for mr1.)
* | Optional use of UTF-8 strings in resource bundlesKenny Root2009-12-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows the use of UTF-8 for packing resources instead of the default of UTF-16 for Java. When strings are extracted from the ResStringPool, they are converted to UTF-16 and the result is cached for subsequent calls. When using aapt to package, add in the "-8" switch to pack the resources using UTF-8. This will result in the value, key, and type strings as well as the compiled XML string values taking significantly less space in the final application package in most scenarios. Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
* | add "junk path" -k option to aaptDoug Zongker2009-10-131-0/+4
|/ | | | | | | | | | | Adds a "junk path" option to aapt so that you can do: aapt add -k archive.zip path/to/some.file and have the file stored in the zip under the name "some.file" (without the path). Needed so that we can use 'aapt add' in place of 'zip -j' when building jar files, which will lead to smaller incremental OTAs.
* Add a flag (-G) to aapt to have it output the classes that shouldn't be ↵Joe Onorato2009-08-301-2/+14
| | | | obfuscated by ProGuard.
* am 1585bd24: Merge change 4828 into donutAndroid (Google) Code Review2009-06-191-1/+5
|\ | | | | | | | | | | | | Merge commit '1585bd24c10d16351f89e32dddbfa799f18db6bd' * commit '1585bd24c10d16351f89e32dddbfa799f18db6bd': Report densities in badging, debugging for nine patch bug.
| * Report densities in badging, debugging for nine patch bug.Dianne Hackborn2009-06-191-1/+5
| | | | | | | | | | | | | | The aapt tool now reports all available densities like it already did for locales. Also this includes more resource data output, which I was using to examine bug #1867049 (which at this point I am unable to reproduce).
| * Implement compatibility support for WRITE_SDCARD permission.Dianne Hackborn2009-05-151-4/+68
| | | | | | | | | | | | | | | | | | | | | | Now old applications will automatically be granted it. Also renamed it from SDCARD_WRITE to WRITE_SDCARD to be consistent with our other permissions, and re-arranged how we do targetSdkVersion to actually be usuable for this kind of stuff. Note that right now this results in basically all apps being given the WRITE_SDCARD permission, because their targetSdkVersion is not set. I will be dealing with that in a future change.
* | break dependency on utils/ZipEntry.h and utils/ZipFile.h, get rid of ↵Mathias Agopian2009-06-051-1/+0
| | | | | | | | inet_address.h and Socket.h which were not used
* | get rid of utils.hMathias Agopian2009-05-311-1/+4
| |
* | Implement compatibility support for WRITE_SDCARD permission.Dianne Hackborn2009-05-151-4/+68
|/ | | | | | | | | | | Now old applications will automatically be granted it. Also renamed it from SDCARD_WRITE to WRITE_SDCARD to be consistent with our other permissions, and re-arranged how we do targetSdkVersion to actually be usuable for this kind of stuff. Note that right now this results in basically all apps being given the WRITE_SDCARD permission, because their targetSdkVersion is not set. I will be dealing with that in a future change.
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+369
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-369/+0
|
* auto import from //branches/cupcake/...@130745The Android Open Source Project2009-02-101-1/+5
|
* auto import from //branches/cupcake/...@126645The Android Open Source Project2009-01-151-4/+19
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-2/+17
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+335