Add a test for the manifest merger command line that would have prevented
b/291252863.
Bug: 291252863
Test: TestManifestMerger
Change-Id: I8c025efe7ccb06ad97b405e2927a4df07f9d3f27
Also add unit tests for the rest of device_config
Bug: 283475679
Test: m nothing (soong unit tests)
Change-Id: Iee18a1f2f2cbb23e8c8d84c54e903b32be29a693
After this change, there is a clear separation between tests that are
related to dexpreopt and tests that are not. The former uses
PrepareForTestWithDexpreopt, while the latter uses
PrepareForTestWithJavaDefaultModules. The benefit is that the latter
will no longer affected by any dexpreopt changes.
Bug: 280776428
Test: m nothing
Change-Id: Ib957765b9287d51c082e0a33cee17a6bb56daeef
Context
- fuzz_test.go is not listed in the soong/java test sources and is not
running on CI.
Implementation
- Fix fuzz_test.go and add to test sources
Test: m
Change-Id: If2685c646dec4885fc42d7760992309bfa9da382
Most of the fields in the bootImageConfig/Variant structs are assigned
inside a Once func so are guaranteed to be only set once. However, some
are assigned outside. This change adds comprehensive tests for those
structs and verifies that the constant fields are preserved and the
mutated fields have the correct value.
The check for the constant fields is added in a new TestBootImageConfig
test.
The check for the mutated fields is added into
TestSnapshotWithBootclasspathFragment_ImageName as that test checks an
art bootclasspath_fragment in the following configurations:
* source on its own
* prebuilt on its own
* source and prebuilt with source preferred
* source and prebuilt with prebuilt
It reveals a couple of interesting facts:
* All the *installs fields are set to the same value irrespective of
whether the source or prebuilt is preferred. The information is
constructed solely from information already within the
bootImageConfig/Variant and so can be moved within Once.
* The licenseMetadataFile is incorrect when prebuilt is preferred.
That is due to both the source and prebuilt modules setting it and
the source module always wins as the source module depends on the
prebuilt so always runs its GenerateAndroidBuildActions after it.
Those issues will be cleaned up in following changes.
Bug: 245956352
Test: m nothing
Change-Id: If917cfbcb3b1c842a8682d51cc1ee1fed1c51add
Add a simple test and add necessary mock dependencies to allow future
resoure shrinking use with platform targets.
Test: m
Bug: 202959019
Change-Id: Id2dd44d52ce5ea62c06784caab0af6276248cb3f
This adds a new flag to the optimize section to allow invoking the resource shrinker
Bug: 246217952
Test: m
Change-Id: I2e7851af1189db2a6adf6f9f9f444a1d7f3a8d60
JNI libs present in AAR files are ignored in the build. If those
libraries are necessary, they must be manually extracted and a
prebuilt_cc_library module must be created for them. Instead, we can
extract these libraries and copy them to an output APK as part of the build.
Bug: 228848794
Test: created android_app that depends on an android_library_import with
JNI embedded, and verified that .so libs are present in APK
Test: created android_app that depends on an android_library which
depends on android_library_import with JNI embedded, and verified
that .so libs are present in APK
Test: verified that multiple .so's from a single architecture are copied
to APK
Test: verified that the absence of a jni/<arch> folder or files in the
folder will cause the Ninja action to error
Change-Id: I242a862d7bd881f7a4a8c23493924d8fe441ea25
fuzz_test.go is not included for now because there is a fix in progress
to make tests pass again.
Test: go test ./java
Change-Id: Idd44fb95c1dda728659ebfc58381252ab49c8230
r8 gets the static libs in the program jar, it shouldn't also get
them as library jars. Keep a separate classpath for dexing that
includes libs but not static_libs.
Bug: 222468116
Test: m checkbuild
Test: TestD8
Test: TestR8
Change-Id: Icca3393f496cbcadcc633f3b156761e6c145f975
This change adds a new module to soong to be able to build Java fuzz
targets be able to run using Jazzer. Jazzer is an open source fuzzing engine
supported by OSS-Fuzz.
Bug: 211671266
Test: go test -run TestJavaFuzz
Change-Id: Id7c346694f5986f6e15210c359fd533fbb7001eb
Previously, there were no tests for this (outside uses in other tests).
This change adds a test that uses the fixture preparers that create a
prebuilt_api in order to make prebuilt APIs available. That ensures
that both the prebuilt_api is working as expected and the preparer
creates a realistic test environment.
Bug: 204189791
Test: m nothing
Change-Id: I57352aa00f7b268e5286be92f177764dd63ba7e8
This change adds a Soong module that stores the paths to the compilation
artifacts of system server jars in a variable, which will then be
consumed by Make to check if the artifacts are installed. When the check
fails, it means that dexpreopting is not working for some system server
jars and needs to be fixed.
Bug: 201371822
Test: m nothing
Test: manual -
1. Add "service-permission" to DEXPREOPT_DISABLED_MODULES (https://cs.android.com/android/platform/superproject/+/master:build/make/core/product_config.mk?q=DEXPREOPT_DISABLED_MODULES)
2. m nothing
3. See the error:
Missing compilation artifacts. Dexpreopting is not working for some system server jars
Offending entries:
system/framework/oat/x86_64/apex@com.android.permission@javalib@service-permission.jar@classes.odex
system/framework/oat/x86_64/apex@com.android.permission@javalib@service-permission.jar@classes.vdex
Change-Id: I4816f19668f1dae180a34adafdbfa448c97aa0db
When this file was initially created by extracting the test from the
java_test.go file it was not added to Android.bp file so was not being
built and tested as it should. That lead to a recent change that left
it unable to compile. This change corrects both those issues.
Bug: 186723288
Bug: 179354495
Test: m nothing
Change-Id: I06f32bb572f57b6df3c772f1d9d21fe323fbf353
The configuration of the bootclasspath, e.g. PRODUCT_BOOT_JARS,
includes libraries that are standalone and libraries that are part of
an APEX. All libraries that are part of an APEX must also be part of a
bootclasspath_fragment. Currently, the libraries and fragments are
handled separately but that is limiting as it does not make it easy to
process all the libraries while treating those from fragments
differently to standalone libraries. That is needed for hidden API
processing as it needs to use classesJars from standalone libraries
but pre-generated flag files from fragments.
This change adds support for ClasspathElements which is represents the
classpath as a whole while differentiating between standalone libraries
and fragments.
Bug: 177892522
Test: m nothing
Change-Id: I7a4adc67164a46079eb8ec0a17fc755044b4949d
The hiddenAPIFlagFileInfo was being used for both the input and output
of bootclasspath_fragment and platform_bootclasspath and also to pass
information around to various hidden API rule methods. Supporting
multiple different uses in this way made it hard to reason about.
This change creates a separate structure for use by the
platform_bootclasspath. Follow up changes will split out other
functionality into separate types.
Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
- verify that this does not change the contents of the apex files
Change-Id: Ia5c5f65ae5645486c42819c669a8601588217f88
Boot jars are different to system server jars at build level, due to
added complexity of dexpreopt. As a logical separation add a new
classpath fragment type and split existing classpaths.proto generation
into relevant pieces.
Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: I88bec09fc920166ffd0092faef980754ddeb6593
Also renames files, tests, module types in a similar fashion.
There are still some references to image and boot image. They are kept
for the following reasons:
* image_name - this is the name of an ART boot image, i.e. the
collection of .art/.oat/.vdex files.
* BootImageInfo - again this is related to the ART boot image.
* .../art_boot_images/... paths - ditto.
Bug: 177892522
Test: m nothing
Change-Id: Ie1f4738061d131fee75de48bc26a7601481bad4d
The platform_bootclasspath and bootclasspath_fragment modules provide
different capabilities but are related and so have some common
functionality. This change moves some platform_bootclasspath code that
will be of use for bootclasspath_fragment in future into a separate
file.
Bug: 177892522
Test: m nothing
Change-Id: I827b85e33d16155fcc920d553100c9e99267dc4e
A skeleton of a classpath fragment's interface and base to be used by
any modules that provide entries for *CLASSPATH variables at runtime.
In follow up changes, this would be extended to generate
packages/modules/SdkExtensions/proto/classpaths.proto configs for such
modules to be bundled into system and individual apex binaries.
Bug: 180105615
Test: m
Change-Id: I2df550862e97222c5650c4d0480c90231fd78ef0
Extracts the code for creating the rule that creates the monolithic
hidden API flags file which is encoded into dex implementation jars.
This refactoring is in preparation for moving the functionality from
the hiddenapi_singleton into the platform_bootclasspath.
A follow up change will move the method into the new
hiddenapi_modular.go alongside the hiddenAPIAugmentationInfo as they
will both be used to perform hidden API processing for a
bootclasspath_fragment.
Bug: 177892522
Test: verified that the out/soong/hiddenapi/... files are unchanged
by this change
Change-Id: I2729afa80cdfd2d1d4717365001648453d65632f
Initially, this is just a placeholder but functionality will be added
in follow up changes.
Bug: 177892522
Test: m nothing
Change-Id: I890b0d5a117c51a19c9ac5df98c766761d3aa16c
Split part of droiddoc.go into droidstubs.go. Also split droiddoc_test.go
and droidstubs_test.go out of java_test.go.
Test: go test ./java
Change-Id: Iea742e75b6925b135016f7bbf3a168c696a6c433
The platform_compat_config_singleton only needs access to the metadata
so this separates that method into its own interface, distinct from the
one needed by the apex. This also adds a test to ensure that the merging
still works.
Bug: 182402754
Test: m nothing
Change-Id: I5212239786810e5fc5eb99831b1122db93d1329f
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
Adds a boot_image module type. Follow on changes will add instances of
boot_image to represent the ART and framework boot images in the art
and frameworks/base repositories respectively.
For the moment they retrieve their associated boot image configuration
from the map returned by genBootImageConfigs() and leave the actual
work of creating the ninja rules to create the boot images to the
dex_bootjars singleton.
Bug: 177892522
Test: m droid
Change-Id: Ib69701de0d24d996bb8e8be7a20b941be907390e
Adds a singleton that traverses the module variants finding the ones
that are in the list (updatable and non-updatable) of boot jars and
add a ninja rule to ensure that they only contain packages from an
allowed list.
Replaces a hack that ignored any prebuilt boot jars supplied as dex
file with an equivalent one to ensure that they are still ignored.
A follow up change that switches to checking dex jars will allow the
hack to be removed.
The boot jars check can be strict or lax. If strict then all the boot
jars listed in the configuration must be found, otherwise it will only
check the ones it finds. It is strict by default unless
TARGET_BUILD_UNBUNDLED=true or ALLOW_MISSING_DEPENDENCIES=true.
Moves the script and data file from build/make.
Test: m check-boot-jars - for failing and passing cases
SKIP_BOOT_JARS_CHECK=true - no check-boot-jars target created
ALLOW_MISSING_DEPENDENCIES=true - not strict
TARGET_BUILD_UNBUNDLED=true - not strict
verified manually that apart from path differences the same
files (same check sum) were checked in both old make checks and
the new Soong ones
EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m check-boot-jars
Bug: 171479578
Change-Id: I9d81d6650ba64fc0d48d2dab4ba5a3ba8dd03dec
When multiple os/arch variants are supported, java_test_host could not
find a matching arch due to java having arch:common, whereas native
binaries support a specific architecture. This change adds the property
`data_native_bins` in order to support binaries with the appropriate
os/arch variants.
Test: m FirmwareDtboVerification with data_native_bins
Test: forrest
Bug: 153848038
Change-Id: I45adebff0fde2811d5ef5620c697b97b768c951f
This change silently decides whether modules which depend on either
sdkPrivate or sdkCorePlatform get the legacy or the stable version of
the core/platform API, based on whether the module's name is on a
hard-coded list or not.
Test: m java
Test: make a target from the list when its entry is commented out, which correctly fails
Bug: 157640067
Change-Id: I15e5a6c2f07e73718803501d705de0d7ab9bec90
Merged-In: I15e5a6c2f07e73718803501d705de0d7ab9bec90
Merged-In: Iaa97ddaa015e8079fcb3426585c5101c7ec9e22a
(cherry picked from commit c0f4373106)
Add a rule that runs Android lint on each java and android module
and produces reports in xml, html and text formats.
Bug: 153485543
Test: m out/soong/.intermediates/packages/apps/Settings/Settings-core/android_common/lint-report.html
Change-Id: I5a530975b73ba767fef45b257d4f9ec901a19fcb
Give prebuilt_etc and sh_binary their own packages and split the
gigantic main Android.bp up to small, per-package ones.
Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0