This reverts commit ff9b6faba2.
Reason for revert: No longer needed
Bug: 194063708
Test: m nothing
Change-Id: Ic2f6761c9a0a00a612724cb429f002a16522e53f
On coverage builds, R8 will fail to properly optimize and fail the build
if ignore_warnings: false, because jacoco injects dependencies on
jacocoagent classes, but the jacocoagent library is not part of the
classpath libraries passed in to R8 in its arguments.
Instead we can add jacocoagent as a libs dependency for these modules so
that it will get pulled into the r8 flags.
Bug: 243903417
Test: m
Change-Id: Icc24cc260b896fc800125a0318308d823ccf7a83
Teach soong to pass metalava the two new command line arguments
--sdk-extensions-root <dir> and --sdk-extensions-info <file> when
generating the API levels file (--generate-api-levels api-versions.xml).
The directory hierarcy in a droiddoc_exported_dir module has special
meaning, e.g. extensions/1/public/*-stubs.jar are the mainline module
stubs containing the public API for SdkExt version 1. Update the logic
where the directories are scanned for android.jar files to locate the
SDK extension jars (extensions/<int>/public/*-stubs.jar).
Also introduce a new field on droidstubs properties
(Extensions_info_file) to set the value of --sdk-extensions-info.
Note: if Extensions_info_file is not set, neither
--sdk-extensions-root or --sdk-extensions-info will be passed to
metalava.
Bug: 228828986
Test: go test -run TestDroidstubsWithSdkExtensions ./java
Test: m sdk dist && grep -e from= -e module= out/dist/data/api-versions.xml # needs APIs to be listed in the info file
Change-Id: I682e34d328fc93d3eded8565ffee40961307901a
This will enable AIDL tags in perfetto traces for the following SDKs:
1. SdkSystemServer
2. SdkCore
3. SdkCorePlatform
SdkModule requires exposing some Trace methods as
@SystemApi(MODULE_LIBRARIES). This will come as a follow up
Test: Manual
Bug: 161393989
Change-Id: I01d520afa8e26eabb97318192151b707b002c28b
On coverage builds, R8 will fail to properly optimize and fail the build
if ignore_warnings: false, because jacoco injects dependencies on
jacocoagent classes, but the jacocoagent library is not part of the
classpath libraries passed in to R8 in its arguments.
Instead we can add jacocoagent as a libs dependency for these modules so
that it will get pulled into the r8 flags.
Bug: 243903417
Test: add optimize.ignore_warnings: false to NetworkStackAppDefaults &&
make SKIP_ABI_CHECKS=true PRODUCT=cf_x86_phone-userdebug \
EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true \
CLANG_COVERAGE=true COVERAGE_PATHS="" \
TARGET_USERDATAIMAGE_PARTITION_SIZE=17179869184 \
SKIP_BOOT_JARS_CHECK=true \
NetworkStack
Change-Id: I71313b1fd35437ec52890f5c30b3fd1381c7c3d2
* changes:
add bp2build unit tests for aidl_interface
AIDL source generation accounts for Bazel paths
convert .aidl srcs for java_library
add Partition method to LabelListAttribute
The AIDL source generation rule sets include flags based on the relative
path of .aidl sources. For .aidl sources provided by Bazel targets, e.g.
in a filegroup, the same directory could be added to the include path
twice. Instead we need to ensure that if a Bazel source provides the
include path, that we don't add it again from a Soong source.
Bug: 229251008
Test: USE_BAZEL_ANALYSIS=1 m api-stubs-docs-non-updatable
Change-Id: I4997039003242b43e0e52ccf41729acb4ad11324
Test: go test ./bp2build
Test: b build //frameworks/base/services/tests/servicestests/aidl:servicestests-aidl
Test: enable //packages/modules/NetworkStack/common/networkstackclient
&& disable restriction on Android SDK in javaLibraryBp2Build
&& b build //packages/modules/NetworkStack/common/networkstackclient:ipmemorystore-aidl-interfaces-V10-java
Change-Id: Ifb817daf09a3983ea1c84948ed9f02a79f95784b
Some protobuf modules like perfetto_trace-full take a long time
to analyze with errorprone, in that case it took over 10 minutes.
Skip errorprone on protobuf or aidl-only modules because having
warnings on generated source code isn't useful anyways.
Bug: 242630963
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I5e73accd0b56a0a71e75927778c5c04a0d358e67
Previously, hidden API properties were only allowed on
bootclasspath_fragment and platform_bootclasspath module types. This
change allows them to be specified on java_sdk_library modules too. It
involves the following changes:
1. Add the properties to the java.Module.
2. Populate and provide a HiddenAPIPropertyInfo struct from
java_sdk_library modules.
3. Modify bootclasspath_fragment to merge information gathered from its
content libraries as if it was specified on the fragment itself.
Bug: 240406019
Test: m nothing
packages/modules/common/build/mainline_modules_sdks.sh
# Ran the previous command with and without this change to make
# sure that this change does not change the sdk snapshot
# contents.
Change-Id: I64eb71c2039ddc14cf380689d0cec7ec221f5b88
All usages of HiddenAPIFlagFileProperties use it as the type of a
Hidden_api field. This change pushes the field inside the struct and
just embeds the struct inside the structs that need it making it
simpler and more consistent with how the HiddenApiPackageProperties
struct is used.
This is extracted as a separate change as while the change is simple
it does affect a lot of lines. Keeping it separate makes it easier to
review the changes.
Bug: 240406019
Test: packages/modules/common/build/mainline_modules_sdks.sh
# Ran the previous command with and without this change to make
# sure that this change does not change the sdk snapshot
# contents.
Change-Id: I664453029574ef68dc5712f7bf137a1a6e78e864
In preparation for adding hidden API properties to individual
java_sdk_library modules this change refactors the handling of that
information.
1. Renames HiddenApiPackageProperties to HiddenAPIPackageProperties
to be consistent with other similar structs.
2. Creates a new HiddenAPIPropertyInfo struct to be used to provide
property derived information from one module to another. It includes
both flag files as well as the information about which packages are
used.
3. The HiddenAPIPropertyInfo is embedded within the existing
HiddenAPIFlagInput in place of the existing flag files field.
4. The fields in the HiddenAPIPropertyInfo struct are populated from
the HiddenAPI*Properties structs.
5. Access to package information is retrieved from the info struct
instead of directly from the properties. That means that no changes
will be needed to this code when info from other modules is merged
into the struct in a follow up change.
Bug: 240406019
Test: packages/modules/common/build/mainline_modules_sdks.sh
# Ran the previous command with and without this change to make
# sure that this change does not change the sdk snapshot
# contents.
Change-Id: I773279a4b621bcc3c40e3bfe193f2c7b0caeccd6
In mixed builds currently, filegroup doesn't use path prop when creating the paths to the srcs. It defaults to ModuleDir.
Hence, when java.genAidlIncludeFlags [1] calls srcFile.Rel() to eventually create the AIDL include dir for AIDL flags, srcFile.Rel() returns the filepath relative to the module directory instead. This CL appends path prop to module dir when creating relativeRoot.
This fixes the bridge between converted filegroup that set path prop (e.g. libbinder_aidl) to unconverted module (for example, droidstubs). The fix is needed for the child CL aosp/2186599 to convert libbinder_aidl to Bazel. Without this fix, module-lib-api-stubs-docs-non-updatable (unconverted module that depends on libbinder_aidl) can't be built in mixed builds.
[1]: https://cs.android.com/android/platform/superproject/+/master:build/soong/java/gen.go;l=123?q=java%2Fgen.go
Test: go test
Bug: 243010121
Change-Id: Ic2dd2ab9199c62010303a5b8c611d722f4a4118d
Previously, there were two separate fields for each of the API and
removed API files because in some cases it needed a WritablePath and in
other cases it could only be a Path.
This change refactors the code so that the WritablePath is no longer
needed, the duplicate fields deleted and the remaining field is changed
to Path. It also removes a few unused fields.
Bug: 234113632
Test: m nothing
Change-Id: If81f5fe2aa05d9d7b2bc23869fdb2397649d67b3
The majority of libcore NewApi warnings come from references to new
methods, constants, fields added in a file and then referenced in the
same source file. Maintaining suppressions is not scalable: they need
to work across multiple API versions in different branches.
Bug: 208656169
Test: TH
Change-Id: If5e746f25f1bd34931ee8c89b363aa92c81e23b3
Multiple modules (e.g. java, cc, python, rust) define the `test_options`
field. Extract the common properties in test_options to share across
different test rules.
Bug: 240928948
Test: `refreshmod` and diff with original module-info.json
Change-Id: I404a7a157b4ccaa53d800ee2217559ff695bd825
This reverts commit c166b68589.
Bug: 234113632
Bug: 236187167
Reason for revert: causes problems with update-api, see b/236187167
Change-Id: I4c88151cb5e2c86bb6c1a955c5065966a4fbb3e0
Pass --apply-suggestions to lint, which will cause it to apply
suggested fixes to the source files in the sandbox. Zip up the
modified sources and export them outside the sandbox.
Test: examine suggested-fixes.zip
Bug: 216456886
Change-Id: Iaeb406462c38cf4b10e51d641432ba1fda9327fa
Some libraries are only used for tests, but
are not test module types. These modules get warnings
about @VisibleForTesting usages when they really
shouldn't. Expose a test flag that module authors
can use to make lint treat a module as test code.
Bug: 235339747
Test: Manually tested applying it to SystemUI-tests
Change-Id: I1356749a669dc80a7725605d7159da27c9a211b4
This reverts commit 0b29c62498.
Reason for revert: Issue that caused breakage has been fixed on stage-aosp-master. I'll test this cl on go/abtd for the stage-aosp-master branch before submitting.
Change-Id: I90f1941f67ebf9c40402713fa7762a99e368c17f
This reverts commit 7868b9e942.
Reason for revert: DroidMonitor: Potential culprit for Bug b/242013483 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Bug: 242013483
Change-Id: Ib73f862f34ca2c8ede7e4b4b9403d1eed00d0426