platform_build_soong/dexpreopt
Ulya Trafimovich 88bb6f6342 Unify addition of class loader subcontext from dependencies.
Previously CLC construction was scattered across different module types
and dependency tags. This CL moves all logic to one function, which
handles all special cases. This will allow to simplify CLC API and
reduce the number of different ways in which CLC is constructed.

Previously some of the cases failed early (at the time when a library is
added to CLC) if the build/install paths were unknown. Other cases did
not fail early, but were validated later before CLC was used. Late
failures are necessary because some of the libraries with unknown paths
still have to be processed by manifest_fixer (which doesn't need library
paths), but they do not use dexpreopt (which needs library paths). This
CL removes the early failures (all paths are still validated later).

The CLC tests do not fail because they use a private method that toggles
the "strict" flag (that enforces early/late failure mode) manually in
the method call.

The CL also makes a functional change in the way CLC is constructed for
component libraries that have an OptionalImplicitSdkLibrary(), or
libraries that are disguised as SDK libraries via `provides_uses_lib`.
Previously such a component/disguised library X was added to its own CLC
as a sibling element of X's own <uses-library> dependencies, which
created incorrect CLC structure. Now this is handled by addCLCFromDep,
when X is processed as dependency and added as a top-level CLC element
with its sub-CLC properly nested under it.

Bug: 132357300
Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: I6a512209b87b81d785875f10f76b21c81b2ed579
2020-12-21 22:16:21 +00:00
..
dexpreopt_gen Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
Android.bp Add unit tests for class loader context. 2020-10-29 17:47:34 +00:00
OWNERS Add an owners file for dexpreopt files. 2018-12-18 20:28:06 +00:00
class_loader_context.go Unify addition of class loader subcontext from dependencies. 2020-12-21 22:16:21 +00:00
class_loader_context_test.go Make error message more precise. 2020-12-02 13:06:47 +00:00
config.go Merge "Replace android.WriteFile rule with android.WriteFileRule" 2020-11-16 23:11:41 +00:00
dexpreopt.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
dexpreopt_test.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
testing.go Reland: Get the dex2oat host tool path from module dependency on the 2020-02-13 17:46:48 +00:00