OSDN Git Service

Prototype XML view compiler
authorEric Holk <eholk@google.com>
Wed, 5 Sep 2018 17:43:31 +0000 (10:43 -0700)
committerEric Holk <eholk@google.com>
Mon, 1 Oct 2018 21:05:10 +0000 (14:05 -0700)
commitc4239ac4a8c145c99daf806b6e1a3ce5109049ba
treeac44371eabcd7236ff2694cdd8bf1cbf863d0f87
parent53f6d1b060c10121062c4054514c3e3a0c2444bd
Prototype XML view compiler

This is an initial step towards a tool for pre-compiling layout XML files.  It
accepts an XML file and produces a Java language class called CompiledView with
a static method, inflate. Calling CompiledView.inflate should then return a view
object that is equivalent to calling LayoutInflater.inflate on the same
resource.

There are still several important limitations, but this works well enough to do
some experimentation. The limitations include:
* Currently only one layout can be compiled at a time.
* `merge` and `include` nodes are not supported.
* View compilation is a manual process that requires code changes in the
  application.
* The tests in this CL do not yet exercise any interesting behavior.

Bug: 111895153
Change-Id: I3e6880b08c52087d24ae7486495bd7fa282f4ff7
startop/tools/view_compiler/Android.bp [new file with mode: 0644]
startop/tools/view_compiler/README.md [new file with mode: 0644]
startop/tools/view_compiler/TEST_MAPPING [new file with mode: 0644]
startop/tools/view_compiler/java_lang_builder.cc [new file with mode: 0644]
startop/tools/view_compiler/java_lang_builder.h [new file with mode: 0644]
startop/tools/view_compiler/main.cc [new file with mode: 0644]
startop/tools/view_compiler/util.cc [new file with mode: 0644]
startop/tools/view_compiler/util.h [new file with mode: 0644]
startop/tools/view_compiler/util_test.cc [new file with mode: 0644]