Revert submission 1597083-java_test_host_default
Reason for revert: Getting ready for b/181888225 just in case
Reverted Changes:
I220551549:Attempt to run all java_test_host that look unit t...
I29dbbbf46:Exclude some tests for java_test_host onboarding
Change-Id: Iaa89f9b7e9ad72ed962cef285c70a6263e63ffd5
This lets one avoid any decisions as to when to chdir there during its
execution and leads to better sandboxing because the pwd doesn't leak to
init() functions anymore.
Test: Manual.
Change-Id: I1560da8ed3a621249426f9e8908aa890c21e13ba
Some of the `uses_libs`/`optional_uses_libs` libraries may have a
library name that is different from the module name. In that case it is
necessary to patch these properties after `provides_uses_lib` for the
library is applied.
Bug: 132357300
Test: m nothing
Change-Id: I2e2248053787557f955a6b363c22e3bad0301ec7
Previously `provides_uses_lib` property affected only those
<uses-library> dependencies that are automatically deduced by Soong as
implicit Java SDK libraries reachable from the `libs` property. Other
<uses-library> dependencies that are explicitly added in `uses_libs` and
`optional_uses_libs` properties ignored `provides_uses_lib`.
As TestUsesLibraries shows (see the TODOs), Soong behaviour is still
incorrect in two ways (to be addressed in follow-up CLs):
- `uses_libs`/`optional_uses_libs` are passed to manifest_fixer
- verify_uses_libraries check is based on `uses_libs`/
`optional_uses_libs`, and not on the CLC as it should be
Bug: 132357300
Test: m nothing
Change-Id: I0ec7aab9dcd44554d1a79ddd382491c562266fa3
Previously, when a prebuilt was preferred but did not provide a
suitable boot dex jar both the source and the prebuilt were silently
ignored which meant that the "hiddenapi list" command was not given a
complete set of boot dex jars. That could either lead to incorrect
hiddenapi flags being set or the "hiddenapi list" command failing if it
could not find a class. Debugging the cause of either of those cases
can be very time consuming so this change fails early and makes the
cause very explicit.
Bug: 181267622
Test: m nothing
Change-Id: I6763ddb9ba90ed2e501d0cf7984f6655237e905d
Invokes hiddenAPIExtractInformation() on the java_sdk_library_import's
dex implementation jar provided by the deapexer (on behalf of
prebuilt_apex) so that hiddenAPI can extract the information it needs,
if anything, from the dex file.
The dex file provided by deapexer has already had the hiddenapi
information encoded into it so it does not need to do that again.
Usually, it would require a classes implementation jar as well in
order to extract information from UnsupportedAppUsage annotations but
that is not available for a java_sdk_library_import. Fortunately, the
modules that are currently affected by this do not contain any such
annotations. This just uses a public api stubs jar instead.
Bug: 181267622
Test: m nothing
Change-Id: I96275e46f8b7fecba88075319e9f2da5ae315c03
Sysprop libraries use a global list to rewrite dependencies from
implementation libraries to public stub libraries when appropriate.
Remove the global list, and instead add a dependency from the
implementation to the public stub that forwards the JavaInfo.
Bug: 181367697
Test: sysprop_test.go
Change-Id: Ia7995feb3c079ca9bb6a403daaae3e3329fd7f6a
Use the java resources jar as the dex jar when building apps that
have no code.
Also remove maybeStrippedDexJar, the dex jar is never stripped now.
Fixes: 176305357
Test: TestAppJavaResources
Change-Id: Ic8b1165bd35d71237d307e7f5f895764e203a10d
Current test behaviour is incorrect, because libraries added via
`uses_libs`/`optional_uses_libs` ignore `provides_uses_lib` property.
The added TODO entries point at the incorrect behaviour, to be fixed in
the follow-up CLs.
Bug: 132357300
Test: m nothing
Change-Id: I35bfe227797aa37aa539e872052335677c798ee5
- Verify argument order for manifest_fixer args verify_uses_libraries.
- Rewrite manifest_fixer test so that it reveals arguments that should
not be there, add a TODO to remove them.
Bug: 132357300
Test: m nothing
Change-Id: I910e13b84f0464fc06b5b98395ddb45bf4120223
Currently includes some heuristic for the first round of
onboarding.
Test: presubmit
Bug: 180736967
Change-Id: I220551549ed3c1468390655cb911f3b8c0f8880d
m <modulename> is handled by Make and installs the Make copy of a host
java binary in out/host/linux-x86/bin, and doesn't depend on the Soong
copy in out/soong/host/linux-x86/bin. That can leave a stale binary
in the Soong directory, and since the Soong directory is first in the
path set up by envsetup.sh, can result in confusing behavior to end
users.
cc_binary already has the Make binary depend on the Soong binary
so that they are both updated. Do the same for java_binary.
Fixes: 180405155
Test: m metalava
Change-Id: Ic84a131a2851cc4a18ce3725da3c4067137d6120
Bug: N/A
Test: remove some cases from String() so that some linktypes go to the
default path. Then run m nothing. No infinite recursion. Error is
correctly shown.
PANIC=String method: unrecognized linktype: 5
Change-Id: I424755bc89871fc2144ff22d6391f57157cd434d
Change-Id: Ice791025dc50f44ffabd1050bafc5ea35023d32c
The new mode is enabled with environment variable
RELAX_USES_LIBRARY_CHECK. If the variable is set to true, then a
verify_uses_libraries check failure does not fail the build, instead it
sets a special compiler filter "extract" for dexpreopt, which means that
the DEX file will be extracted, but it won't be compiled to native code.
Class loader context will be set to empty in this case (not &, as it is
going to be deprecated soon).
If the variable RELAX_USES_LIBRARY_CHECK is unset or set to something
other than "true", then the old behaviour of the verify_uses_libraries
check is preserved.
The intended use case for this flag is to have a smoother migration path
for the Java modules that need to add <uses-library> information in
the build files. The flag allows to quickly silence build errors. This
flag should be used with caution and only as a temporary measure, as it
masks real errors and affects performance.
verify_uses_libraries check is reworked so that it writes the error
message to a status file (which is used instead of the former timestamp
file). Currently the stored error message is not used, but it may be
used later to produce a warning. Dexpreopt command checks if the status
file exists and is nonempty; if that is the case, then compiler filter
is set to "extract".
Bug: 132357300
Test: Manually add some mismatch between the libraries in the Android.bp
and Android.mk files for dexpreopted apps, build with
RELAX_USES_LIBRARY_CHECK=true and obsserve that the build doesn't
fail and they are compiled with compiler-filter "extract".
Unset RELAX_USES_LIBRARY_CHECK and observe that the build fails.
Change-Id: Ibb5d993a25b1df1d2e70b7d5aafc6997f9d64e67
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.
Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
The type linkType has String() method and the error message is created
using it.
Bug: 180477804
Test: m nothing
Change-Id: I74fe9c93b74904177dbe9d29cd3aa3304b67ba4f
filegroups have the unfortunate limitation that they don't create phony
targets for building them in a convenient way. Also, having a single
output file fits better with the genrule concept.
Test: m framework-sdkextensions.api.public.latest
Change-Id: I229410658b04403ff1ff6abd4116a65aaa02b83b
KYTHE_JAVA_SOURCE_BATCH_SIZE environment variable controls this setting.
The limit is 1000 if this variable is not set.
Fixes: 179932118
Test: run prebuilts/build-tools/build-prebuilts.sh, use it to build kzips, check
Change-Id: I9ad57dfd1d2c2dce5cff755b1bd61cf933420bd3