aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools
Commit message (Collapse)AuthorAge
* Global cleanup change.Gravatar Googler2016-10-05
| | | | | -- MOS_MIGRATED_REVID=135162284
* Global cleanup change.Gravatar Liam Miller-Cushon2016-10-05
| | | | | -- MOS_MIGRATED_REVID=135108901
* Add visibility to ↵Gravatar Yun Peng2016-09-30
| | | | | | | | | //src/tools/android/java/com/google/devtools/build/android/dexer:srcs Fix https://github.com/bazelbuild/bazel/issues/1864 -- MOS_MIGRATED_REVID=134762013
* Open source dex merging tools for incremental dexing.Gravatar Adam Michael2016-09-30
| | | | | | | | Tested with bazel build --incremental_dexing_binary_types=monodex,multidex_unsharded,multidex_sharded -- //examples/android/java/bazel:hello_world -- MOS_MIGRATED_REVID=134690103
* Update the density filter to account for all passed densities.Gravatar Googler2016-09-27
| | | | | -- MOS_MIGRATED_REVID=134321948
* Add options to ResourceShrinkerAction to generate an updated R.txt.Gravatar Andrew Pellegrini2016-09-27
| | | | | -- MOS_MIGRATED_REVID=134312343
* Add manifest merger output log.Gravatar Andrew Pellegrini2016-09-26
| | | | | | | RELNOTES: When using android_binary.manifest_merger="android" the merger produces a summary log next to the merged manifest artifact. -- MOS_MIGRATED_REVID=134082985
* Remove absolute paths from protoGravatar Googler2016-09-21
| | | | | | | RELNOTES: Remove deprecated absolute paths in blaze IDE artifacts -- MOS_MIGRATED_REVID=133758389
* Handle multiply-defined attrs in AndroidResourceClassWriterGravatar Googler2016-09-09
| | | | | | | | | | | | | | Currently, we do multiple put calls into the ImmutableMap.builder(), which asserts. See bug for examples from projects. Tweak the aapt comparison test method to actually merge before writing out the R.class (to match the aapt side, which also merges first). -- MOS_MIGRATED_REVID=132607034
* Remove dependency data from AarGeneratorActionGravatar Googler2016-09-08
| | | | | | | | | | | It's not supposed to cover direct deps and trans deps according to the documentation anyway. Also prepare to move the --strictMerge flag. The option isn't checked anymore. There's only one type of merging. -- MOS_MIGRATED_REVID=132444314
* Adds a jar filter to the IntelliJ IDE aspect.Gravatar Googler2016-09-06
| | | | | | | | | | | | | | | | Any java rule that mixes generated and non-generated sources will produce a filtered jar containing only the generated output. For a java rule with only "normal" sources or only generated source files, no filtered jar is produced. This will allow the IDE to resolve those generated sources. RELNOTES:None -- MOS_MIGRATED_REVID=132113568
* Restore anydpi support, working around the lack of FolderConfig support.Gravatar Googler2016-09-01
| | | | | -- MOS_MIGRATED_REVID=131853638
* Add parsing of Proguard mapping file for resource class fields. Fixes issue ↵Gravatar Andrew Pellegrini2016-09-01
| | | | | | | with obfuscated fields being stripped because they fail to match any known resource. -- MOS_MIGRATED_REVID=131830443
* Add a resource validator action for android_libraryGravatar Googler2016-08-30
| | | | | | | | | | | | | | | | | | Part 3 of the 3 new proposed android_library res processing actions. Pulls a zip file from the merging action, unpacks it, and then validates the results with aapt. Get an R.txt and srcjar w/ javadocs from aapt. In order to the get the R.txt, I think you need to ask for the R.java sources anyway. Split the processResources() into a runAapt() function that can be reused. Hookup in bazel coming separately. -- MOS_MIGRATED_REVID=131618410
* Add a lightweight resource merge action.Gravatar Googler2016-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | Part 2 of the 3 new proposed android_library res processing actions. The primary and deps are all assumed to be parsed+summarized in a protobuf. Represent that with a new class (similar to DependencyAndroidData but w/out R.txt). Avoid having "manifest" artifacts as deps input, and instead use "label", since that is only used in a warning. DepAD still uses the manifest for #asSymbolFileProvider, so we keep it there. Move loading the primary out of the merge function so that we can share the merge function with this style of primary data, and the existing style of of primary data (UnvalidatedAndroidData). This produces an R class.jar and a zip file to pass along to a future validation action. Images are stubbed out since they are irrelevant to the validation action. -- MOS_MIGRATED_REVID=131604421
* Adds data binding support to the Android resource processor.Gravatar Greg Estren2016-08-23
| | | | | | | | | | | | | | | | This is invoked via the new --dataBindingInfoOut flag. If specified and the rule has resources, data binding declarations in layout .xmls are stripped and fed into an aggregated .zip file under that name. The original (stripped) .xml is then fed into aapt for normal processing. If specified and the rule has no resources, an empty file is created. If not specified, everything works as before. -- MOS_MIGRATED_REVID=130973265
* Flip on @+id parsing by defaultGravatar Googler2016-08-22
| | | | | | | | | | | | | | | | | Avoid writing the non-values IdXmlResourceValues to the merged values.xml file. It's redundant since the merged resources will include the src layout / menu, etc. file. E.g., adds 25KB out of 250KB to some merged values.xml. It can also change the way R.fields are initialized (ids from values.xml are numbered before other sources), that would have changed the numbering in AndroidIntegratinoTest#testAndroidBinaryResourceShrinking and in AndroidResourceClassWriterAaptTest. -- MOS_MIGRATED_REVID=130789333
* Share source paths for more compact res proto serializationGravatar Googler2016-08-17
| | | | | | | | | | | | | | | | | | | | | | | Source abs paths can be pretty long. If a value file like colors.xml has N resources then we serialize the path N times. Instead, make a table and just serialize the index. Can reduce resource proto sizes from X to 0.65*X. in some experiments. CPU instructions executed is slightly lower, but critical path impact is pretty minimal since parsing happens in parallel anyway. This doesn't help with drawables (path only shows up once) but doesn't really hurt (an extra index number). I tried sharing the root (a table of the res dirs). That can be another 10%, and helps with the drawable case. However, a naive enumeration of roots (src.getParent().getParent()) added *much* more overhead to the writing stage, so I didn't go on with that. -- MOS_MIGRATED_REVID=130440810
* Handle public tags in merger -> R.class writerGravatar Googler2016-08-17
| | | | | | | | | | | | | | | Developers do use public tags, and before this change it would assert in the AndroidResourceClassWriter as an unhandled ResourceType. We probably didn't want to write out a R.public.field anyway. Also, handle public tags with the same name, but different type. They get mapped to the same FQN, so use the combining mechanism to keep track of the different types and ids. -- MOS_MIGRATED_REVID=130395089
* Remove MergeeManifestsConverter used for the transition of --mergeeManifests ↵Gravatar Andrew Pellegrini2016-08-12
| | | | | | | from a list of paths to a dictionary of paths and manifest names. -- MOS_MIGRATED_REVID=129987988
* Update DensitySpecificManifestProcessor to omit a <compatible-screens> ↵Gravatar Googler2016-08-10
| | | | | | | | | | | declaration from the generated manifest if the list of requested densities contains an unsupported density. Typically, the DensitySpecificManifestProcessor will add a <compatible-screens> declaration with a <screen> element for every density specified in the "densities=" argument of the android_binary build rule. If the "densities=" argument includes a density not officially supported by the Play Store, it will throw an exception and the build will fail. After this change, an build rule that explicitly specifies a density not officially supported by the Play Store will instead result in the <compatible-screens> declaration being omitted from the generated manifest, indicating that the APK can support all densities. -- MOS_MIGRATED_REVID=129761968
* Rollback of commit 70fbf690e571037370044f7d1e316b0bf9172e1c.Gravatar Googler2016-08-05
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** The Play Store serving team doesn't want to add support for any new density buckets, so I'm going to roll this back for now (this CL allows us to build an APK declaring 340, but the APK can't be pushed to the Play Store, so not very useful). I can roll forward again in the unlikely event that the Play Store folks change their mind. I will investigate some other build solution for getting an APK into the play store that can be offered to devices declaring 340 dpi. *** Original change description *** Adds support for round and 340dpi to resource qualifiers, and allows stamping 340dpi into the density filtered manifest. Also adds 340dpi to the list of supported Android Wear densities. 340dpi is the density declared by Nemo and Swordfish, and the Play Store will not offer APKs to those devices unless they include <compatible-screens> entries with this density. -- MOS_MIGRATED_REVID=129354693
* Adds support for round and 340dpi to resource qualifiers, and allows ↵Gravatar Googler2016-08-03
| | | | | | | | | | | stamping 340dpi into the density filtered manifest. Also adds 340dpi to the list of supported Android Wear densities. 340dpi is the density declared by Nemo and Swordfish, and the Play Store will not offer APKs to those devices unless they include <compatible-screens> entries with this density. -- MOS_MIGRATED_REVID=129117839
* Add source path context to @+id parse errors.Gravatar Googler2016-08-02
| | | | | | | | Similar to the value xml errors. Otherwise it's not clear what file to look at =) -- MOS_MIGRATED_REVID=129094207
* Use the native java_proto_library instead of the macro defined in genproto.bzl.Gravatar Carmi Grushko2016-08-02
| | | | | -- MOS_MIGRATED_REVID=128992760
* Tolerate missing field value in binary's R.txtGravatar Googler2016-08-02
| | | | | | | | | | | | | | | | | | The binary's R.txt might not be superset of symbols in the various library R.txt files. The R.java writer had tolerated this, as did an older version of the RClassGen (lost in refactoring). Bring back the null check. This can happen if the binary has res overrides that *remove* symbols. E.g., if noop/res/layout/stats.xml overrides dev/.../stats.xml, and the noop version removes elements not needed for production. Test mocks can do something similar. -- MOS_MIGRATED_REVID=128989080
* MergeConflict: fix typo in error message string.Gravatar Googler2016-07-29
| | | | | -- MOS_MIGRATED_REVID=128729088
* Add a resource parsing action.Gravatar Googler2016-07-28
| | | | | | | | | | | | | | | | | | | | | | Part of 3 proposed new actions: - parsing action - merging action - validating action Dependencies (directData and transitiveData) expect the symbol files. If the merge action produces the symbol files, then each merge action depends on each other. Instead, produce it in an action with just source resources as prereqs to allow more parallelism. Technically, we don't need a manifest as part of the parameters. I debated about whether to introduce a basic version of UnvalidatedAndroidData or not. -- MOS_MIGRATED_REVID=128599714
* Change android resource shrinking to use the standard Proguard jar artifact.Gravatar Andrew Pellegrini2016-07-27
| | | | | | | | * Re-add proguard mapping file handling to ResourceShrinker to handle the fully Proguarded code, potentially including an obfuscation step. * Update android_binary to provide the resource shrinker with the standard Proguard jar and obfuscation mapping instead of a custom built shrunk jar. -- MOS_MIGRATED_REVID=128476602
* Improve resource DataKey serialization perf a bitGravatar Googler2016-07-27
| | | | | | | | | | | | | | | | Address the TODO about using toString in the TreeMap comparator by using DataKey#compareTo. Also, use the entrySet to iterate K-V pairs instead of calling get(key). Synthetic benchmark w/ 10000 random keys: Before: 260ms to serialize After: 33ms to serialize Less of a difference when there are few keys. -- MOS_MIGRATED_REVID=128469407
* Add SVG as an analyzed file type to ResourceShrinker.javaGravatar Andrew Pellegrini2016-07-26
| | | | | -- MOS_MIGRATED_REVID=128401550
* Remove a few unused methods from {Dep,Unvalidated}AndroidDataGravatar Googler2016-07-26
| | | | | | | | | | | The new merger doesn't use addToResourceSet(), modify(), etc. Also, since modify() is unused, remove the DirectoryModifier objects and reduce BUILD deps. -- MOS_MIGRATED_REVID=128387448
* Fixed ConvertersTest on WindowsGravatar Yun Peng2016-07-25
| | | | | | | | | | Recently, a new java test is added into Bazel, but failing on Windows because using the wrong path separator. This change fixs it. -- Change-Id: Ib73abac9c22b1d21180f76c13358a1173fde863c Reviewed-on: https://bazel-review.googlesource.com/#/c/4131 MOS_MIGRATED_REVID=128331068
* Turn down deprecation warning.Gravatar Googler2016-07-22
| | | | | -- MOS_MIGRATED_REVID=128202272
* Add a resource merger state -> R class writer.Gravatar Googler2016-07-22
| | | | | | | | | | | | | | | | Collects the R class fields from the new merger's internal state, and then writes out either an R.java or R.class. TBD which to use. One concern is that users may want the javadoc. If so, perhaps this could generate the R.class, and then aapt could generate the srcjar off of the build critical path. Refactor the RClassGenerator to make it easier to use from merger state (vs from R.txt). -- MOS_MIGRATED_REVID=128181306
* 5 of 5: Integrate with the AndroidResourceProcessorGravatar Googler2016-07-21
| | | | | -- MOS_MIGRATED_REVID=128074515
* Minor backwards compatibility fixes:Gravatar Googler2016-07-21
| | | | | | | | * Account for the dataKey in MergeConflicts (whoops.) * When finding a conflict, always take the last value -- this matches the current merger strategy. -- MOS_MIGRATED_REVID=127980673
* Add target names for mergee manifests to generate more helpful error ↵Gravatar Andrew Pellegrini2016-07-20
| | | | | | | messages from manifest merging when using manifest_merger="android" on android_binary rules. -- MOS_MIGRATED_REVID=127962630
* Plumb customPackage to RClassGenerator and skip empty R classesGravatar Googler2016-07-20
| | | | | | | | | | | | | Forgot to do this, so we get compiler errors since it can't find the R class imported under the requested custom java package. Also, avoid writing out the top-level R.class file if there are no symbols. There is a test that happens to check for this. -- MOS_MIGRATED_REVID=127888913
* Removes "-preview" hack for Android build tools version attribute.Gravatar Googler2016-07-19
| | | | | | | This has been a no-op since commit 9a21e20ab55dad018caee765d67be528fa84caf0. -- MOS_MIGRATED_REVID=127771957
* Record and propagate namespaces from the <resources> element correctly.Gravatar Googler2016-07-15
| | | | | | | | | | | * Reduces the size of merged values.xml * Improves correctness of merged xml Sadly, this is also backwards compatible by allowing multiple definitions of a prefix with different namespaces. Will be cleaned up after transition. -- MOS_MIGRATED_REVID=127481147
* Remove anydpi support to improve backwards compatibility.Gravatar Googler2016-07-15
| | | | | -- MOS_MIGRATED_REVID=127466889
* Rollback of commit 80d1e16b7ae1d04fa2fa4c561588fe9fdbaefc41.Gravatar Carmi Grushko2016-07-14
| | | | | | | | | | | | | *** Reason for rollback *** Breaks Bazel's CI because the current release (0.3.0) is used to query some targets, which doesn't have java_proto_library yet. *** Original change description *** Use the native java_proto_library instead of the macro defined in genproto.bzl. -- MOS_MIGRATED_REVID=127431334
* Use the native java_proto_library instead of the macro defined in genproto.bzl.Gravatar Carmi Grushko2016-07-14
| | | | | -- MOS_MIGRATED_REVID=127324151
* * Standardize attribute storage in the protoGravatar Googler2016-07-12
| | | | | | | * Add attributes to PluralXmlResourceValue -- MOS_MIGRATED_REVID=127147486
* Centralize the creation of the XmlInputFactoryGravatar Googler2016-07-12
| | | | | | | | Properly handle unary tags in AttrXmlResourceValue Handle CData for string content. -- MOS_MIGRATED_REVID=127118005
* Fix android manifest merger from using only one mergee manifest.Gravatar Andrew Pellegrini2016-07-11
| | | | | | | Mergee manifests are pre-processed and written to a temp directory, based on their original path, before the final merge. Previously only the filename was used, resulting in each mergee overwriting the previous, all of which were <temp_dir>/AndroidManifest.xml. Using the full path of each manifest ensures this overwriting cannot occur. -- MOS_MIGRATED_REVID=126942789
* Enhance AndroidResourceProcessingAction's split detection.Gravatar Michael Staib2016-07-08
| | | | | | | | | | | | | | The --splits flag is now --split, since I remembered about how allowMultiple exists. More importantly, split APKs are now correctly moved to filenames which are fairly trivially constructed from the input split flags, allowing Bazel to just do a simple one-character replace on the split flags and know what files the resource processing action is going to output. One more step in the quest for world domination, or rather, split APKs for resources. Next: Actually supporting this in android_binary. -- MOS_MIGRATED_REVID=126838431
* More pieces of RClassGeneratorActionGravatar Googler2016-07-08
| | | | | | | | | | | | Add the rclass_generator.sh, and fill in the boiler-plate for mock tools, etc. Mostly cargo- culting references to resources_processor.sh. Rename earlier pieces to use RClassGenerator prefix instead of AndroidResourceCompilation. -- MOS_MIGRATED_REVID=126831848
* Remove .9 from nine-patch FullyQualifiedNamesGravatar Googler2016-07-07
| | | | | | | | | | | | | | | | In the end, foo.9.png should result in an R.java field R.drawable.foo (not R.drawable.foo_9). Also, given foo.9.png and foo.png, aapt will give an error: res/drawable/foo.png:0: error: Resource entry foo is already defined. res/drawable/foo.9.png:0: Originally defined here. So it seems like we should generate a merge conflict warning as well. Adjust FQN accordingly. -- MOS_MIGRATED_REVID=126693820