aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/resources
Commit message (Collapse)AuthorAge
* Fail when resources use invalid java identifiers.Gravatar corysmith2018-06-15
| | | | | RELNOTES:None PiperOrigin-RevId: 200766836
* Clean up code that directly imports nested classes like Builder, Entry, etc.Gravatar jcater2018-05-02
| | | | PiperOrigin-RevId: 195100670
* Remove some deprecated resources flags.Gravatar ajmichael2018-04-04
| | | | | RELNOTES: None PiperOrigin-RevId: 191624839
* Add support for the <type>/<package>:<name> method of declaring resources.Gravatar corysmith2017-08-30
| | | | | RELNOTES: None PiperOrigin-RevId: 166899690
* Android BusyBox: deprecate --libraries flagGravatar laszlocsomor2017-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate the --libraries flag of the GENERATE_BINARY_R tool in favour of --library. The new flag is multi-value and uses "," as the pair-separator instead of ":". The value converter still supports ":"-separated pairs as well, but looks for "," first. Old format: --libraries=key1:value1,key2:value2,... New format: --library=key1,value1 --library=key2,value2 Motivation: - the ":"-separator prevents using absolute paths on Windows The old flag is still supported, but will be removed after 2018-02-28 (about 6 months from now). Also in this commit: - add a new method to CustomCommandLine.Builder to lazily construct the command line for the --library flag See https://github.com/bazelbuild/bazel/issues/3264 RELNOTES: none PiperOrigin-RevId: 164246506
* Fix extra bytes and missing resources for roboelectric tests:Gravatar Googler2017-06-29
| | | | | | | | | *) Changed the GenerateRobolectricResourceSymbolsAction to merge duplicate namespaces from the dependency list input. *) RClassGenerator throws if an existing R.class file exists for that package. *) New test for duplicate package dependencies RELNOTES: none PiperOrigin-RevId: 160436937
* Move the field name out of the FieldInitializerGravatar corysmith2017-05-23
| | | | | RELNOTES: None PiperOrigin-RevId: 156747534
* Remove the RTxtSymbolEntry in favor of the FieldInitializer class.Gravatar corysmith2017-05-19
| | | | | RELNOTES: None PiperOrigin-RevId: 156321468
* Use one writer for generating R.java source filesGravatar corysmith2017-05-17
| | | | | RELNOTES: None PiperOrigin-RevId: 156205544
* Further Refactoring/Yak ShavingGravatar corysmith2017-05-15
| | | | | | | | | * Extract the FieldInitializer with placeholder ids from the AndroidResourceClassWriter * Extract a resource sink interface from the AndroidResourceClassWriter (a little renaming, the change isn't actually that big.) RELNOTES: None PiperOrigin-RevId: 156053478
* Remove java8 code from ResourceSymbols.java.Gravatar ajmichael2017-05-04
| | | | | RELNOTES: None PiperOrigin-RevId: 155005554
* * Fork the deprecated SymbolLoader/SymbolWriter code from ↵Gravatar corysmith2017-05-04
| | | | | | | | | com.android.builder.internal * Fixed formatting. RELNOTES: None PiperOrigin-RevId: 154973113
* Automated g4 rollback of commit 3c0bb56a74478cff675b636d5bf605a652451739.Gravatar corysmith2017-04-25
| | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolling forward with a fix to avoid writing all resources to empty libraries. *** Original change description *** Automated g4 rollback of commit bdf0230534a59dab954ee76c5bf640394c88984e. *** Reason for rollback *** Causes issues with library R generation. *** Original change description *** Refactor the RClassGenerator to be reusable for different packages. RELNOTES: None PiperOrigin-RevId: 154175593
* Automated g4 rollback of commit 3217832d638f9a8fdf22e88e32d75bda32ff7235.Gravatar corysmith2017-04-20
| | | | | | | | | | | | | *** Reason for rollback *** Causes issues with library R generation. *** Original change description *** Refactor the RClassGenerator to be reusable for different packages. RELNOTES: None PiperOrigin-RevId: 153641485
* Refactor the RClassGenerator to be reusable for different packages.Gravatar corysmith2017-04-20
| | | | | RELNOTES: None PiperOrigin-RevId: 153619067
* Teach the RClassGenerator to merge all library symbols and reconcile ids.Gravatar corysmith2017-04-18
| | | | | | | Refactoring: Wrapped the SymbolLoader and SymbolWriter in a single class. RELNOTES: None PiperOrigin-RevId: 153194543
* Cleanup android rules and android tools so that my IDE stops complaining to me.Gravatar Adam Michael2017-01-25
| | | | | | -- PiperOrigin-RevId: 145569440 MOS_MIGRATED_REVID=145569440
* Fix NPE in RClassGenerator when dev has code in unnamed packageGravatar Googler2016-12-05
| | | | | | | | | | | | | | | | | | | | Just put the R class in the unnamed package. If we disable the RClassGenerator and use the old code path, we would have constructed a cmdline flag set to "null" for aapt, and aapt would write "package null;" which also wouldn't work... This may allow you to build an android_library but it may be hard to build an android_binary because ultimately AAPT will reject an empty "package" attribute in the AndroidManifest.xml when you try to build the APK, so you'd need to stamp that differently. -- PiperOrigin-RevId: 140945125 MOS_MIGRATED_REVID=140945125
* Update android_ide_common to 25.0.0 and clean up FolderConfigsGravatar Googler2016-10-07
| | | | | | | | | | | Older android_ide_common does not handle BCP 47, so we update the code to handle that and remove most of the workarounds. This also pulls in a fix for 3-letter locales, unblocks resource shrinking whitelisting, etc. -- MOS_MIGRATED_REVID=135396457
* 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
* 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
* 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
* 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
* Roll forward of commit 1f1f207573c7b9c3e2d3ca1ffb0780a8fd592214: action to ↵Gravatar Googler2016-06-23
| | | | | | | | | | | | | | | | | | | | | | | | write R classes directly NEW: add check that primary R.txt exists before trying to load its symbols. Rollback of commit 32c6c15c8b9bc4e203529f60bedbc5cd8a496a36. *** Reason for rollback *** Rollforward with check that primary R.txt exists *** Original change description *** Automated [] rollback of commit 1f1f207573c7b9c3e2d3ca1ffb0780a8fd592214. *** Reason for rollback *** Doesn't handle aapt that doesn't generate R.txt properly. -- MOS_MIGRATED_REVID=125559472
* Rollback of commit 1f1f207573c7b9c3e2d3ca1ffb0780a8fd592214.Gravatar Googler2016-06-21
| | | | | | | | | *** Reason for rollback *** Doesn't handle aapt that doesn't generate R.txt properly. -- MOS_MIGRATED_REVID=125405481
* Add action to write android_binary and lib R.classes directlyGravatar Googler2016-06-21
For android_binary rules, we regenerate all of the R.java of the libraries to get the final resource IDs. Compiling all of them together can be slow with the normal JavaBuilder, so add a specialized class writer. Example build with many R.java classes: - R.java -> R.class via JavaBuilder: over 80s - ErrorProne takes about 40% of that. So turning off ErrorProne would be projected to be 48s. Some of ErrorProne slowness is from static field checks (e.g., on Flag classes), which may look up the same Type over and over. In comparison, if we write our own bytecode with ASM: - ~16s total - 4.7s to parse R.txt - 4.8s to write class files - 5.8s to copy and compress .jar TODO: clean up SymbolLoader patching (upstream) This only creates the action. We will need to separately wire this up in blaze. NOTE: This also makes the exising R.txt loading used by live code multi-threaded, since that is partly I/O-bound. Something to watch out for (for flakiness, etc.) once this is submitted. -- MOS_MIGRATED_REVID=125384467