Commit graph

29 commits

Author SHA1 Message Date
Sam Gilbert
049af11112 Disable BannedThrow check
Bug: 222738070
Test: N/A
Change-Id: Id9d393c9b5c5c21d69c8b3a8d5456c66358426d9
2022-03-04 16:19:19 -05:00
Aurimas Liutikas
8b99da5f37 Merge "Disable new ApiLint check temporarily" 2022-02-23 21:43:55 +00:00
Anton Hansson
ff5f3b9dc7 Revert "Disable a few metalava checks that platform fails after improvements."
This reverts commit 1a0fa38342.

Reason for revert: No longer needed
Bug: 217545629
Bug: 217552813

Change-Id: I6db416c6f30a662752687b33c9824bbd8fa9fd2b
2022-02-22 14:09:05 +00:00
Sam Gilbert
09cb5dbe29 Disable new ApiLint check temporarily
This should be reverted/re-enabled once car-lib no longer throws
errors for the method fixed in aosp/1840533

Test: n/a
Bug: 144855352
Change-Id: Ifc1a135360d9d357237f5dbe5904f6e77b18a94a
2022-02-15 16:48:40 +00:00
Sam Gilbert
1a0fa38342 Disable a few metalava checks that platform fails after improvements.
Change-Id: Iead8d6a26ba3c75d3612dccc5bebd82c39b5aad8
Tests: none
Bug: 217545629
Bug: 217552813
Bug: 217553717
2022-02-02 17:56:57 +00:00
kgui
67007248a5 Add new file name to output inputs/outputs of actions of modules into a new file when m json-module-graph is executed.
And also delete the logic in droidstubs to output JSONDataActions.

Test: local.

Change-Id: Ib5d6f1f69c16c41f128e481131775c7699f96464
2022-01-28 13:52:50 +08:00
Keyi
fe310a9305 Update droidstubs to support putting action inputs/outputs into the module-graph.json.
Test: local test

Change-Id: I6ce657f2ad53c261bcbdd317c266cf179a0cc6e9
2022-01-10 21:28:37 +08:00
Anton Hansson
86758ac94c Make PrebuiltStubsSources support srcjar properly
Initially prebuilt stub sources only supported directories as input, but
support has been added for packaging them up in srcjar as well. However
the build action was not updated accordingly.

Add support to determine if our input is a srcjar, and if so just use
it directly.

Bug: 204978699
Test: m sdk (with prebuilts)
Change-Id: I302cd34ebd55414d35c4f936cd563a4af89b22c6
2021-11-03 15:59:30 +00:00
Pedro Loureiro
cc203505b9 Add module-lib to droidstubs' supported sdk types
If the android.jar is not found in the module-lib folder, it falls back
to searching it in the system folder and then falls back on the public
folder.

This only brings the functionality, we are not yet using it.

Test: m nothing
Bug: 202023154
Change-Id: I99c9004740c8e51faf53ebc3ba2444e8164215f3
2021-10-05 15:40:46 +00:00
Anton Hansson
d78eb76f64 Add annotations.zip support to java_sdk_library
The annotations zip file is produced by the "main" sdk build and is
primarily consumed by android studio.

In order to support building the main SDK without requiring the sources
of all modules, we are adding module SDK artifacts that allows
reconstructing these outputs. The annotations zip contains XML files
which should be fairly easy to merge from all the individual parts.

Bug: 187397779
Test: unit tests in this CL
Test: m sdkextensions-sdk and inspect output
Change-Id: I955cae720e6f1382936836ee1d8fb11003f51b7d
2021-09-22 17:23:10 +01:00
satayev
783195cc5b Use system stubs for framework-doc-system-stubs.
The target is used to generate api_versions.xml file used by Android
Lint, point it to the system stubs in prebuilts/sdk/.

Bug: 190665366
Test: m framework-doc-system-stubs
Change-Id: I27fbad9eb1d84792901974674cbd85f0994bc9f1
2021-06-29 22:25:57 +01:00
Anton Hansson
556e8149cb Remove sourcepath argument from metalava invocations
This is no longer required to find package.html files, so remove it.

Bug: 153703940
Test: m checkapi
Change-Id: I80ec219cb9ef8922094336a5d45652c8e59aa113
2021-06-07 16:04:46 +01:00
Anton Hansson
70336cd2fa Make soong create sourcepath dirs
Sourcepath is set to dir of the Android.bp, but that dir does not
necessarily have any inputs for the metalava invocation defined in that
Android.bp. This leads to problems when metalava tries to read a
non-existent dir, so create it first.

Bug: 153703940
Test: m sdk dist
Change-Id: I8c2ca45c8f066cabf3247b9652a7094cefc047a9
Merged-In: I8c2ca45c8f066cabf3247b9652a7094cefc047a9
(cherry picked from commit 7eff3a8fc3)
2021-06-07 14:34:39 +01:00
Anton Hansson
5ab4286e84 Remove support for removed_dex_api_filename
Nothing uses this argument anymore, so simplify the droidstubs code by
removing the argument.

Bug: 189426360
Test: m
Merged-In: I0e4b84d73a954b3819db1149be3da287cf604eec
Change-Id: I0e4b84d73a954b3819db1149be3da287cf604eec
2021-05-27 12:50:44 +01:00
Aurimas Liutikas
b23b745e19 Clarify how metalava @SuppressLint works
Bug: 186157121
Change-Id: Ia3316b80dcf16e7fb2a41983732e0be8d0657497
Test: None
2021-05-24 18:01:17 +00:00
Anton Hansson
93e8f79577 Merge "Move stub providers to droidstubs.go" 2021-05-05 13:17:37 +00:00
Anton Hansson
5260932812 Move stub providers to droidstubs.go
They fit better there than in droiddoc.go.

Test: m nothing
Change-Id: I44588f1df2094f14881f920246bd19ffc6e1615c
2021-05-05 10:36:05 +01:00
Andrei Onea
4985e518f8 Exclude RequiresApi from generated stubs
This annotation is required for linting, but is not useful in stubs.

Bug: 185579441
Test: cherry-pick http://ag/14098354 and regenerate stubs
Change-Id: I7e4da99a8843b9c709f3b59f125f43cbd66bda4e
2021-04-29 17:00:46 +00:00
Colin Cross
63eeda027c Fix metalava api baseline update command
metalava is run inside sbox with a modified $PWD, so putting $PWD in
the output message results in an incorrect path.  It was also always
incorrect when the output directory was an absolute path.  Add a
cd $ANDROID_BUILD_TOP to the command line and use relative paths
instead.

Bug: 185516277
Test: m out/soong/.intermediates/frameworks/base/system-api-stubs-docs-non-updatable/android_common/metalava/api_lint.timestamp with lint error
Change-Id: Iefe133cea4c3a604ecd2b0ea20f4ba14ae13b425
2021-04-16 14:55:50 -07:00
Colin Cross
7fef94f57b Merge "Remove support for unsandboxed metalava" 2021-04-05 23:23:00 +00:00
Jiyong Park
f1691d2a2c Move java.sdkSpec to the android package
... in preparation for making the handling of sdk versions consistent
across java and cc modules.

Bug: 175678607
Test: m
Change-Id: I598f0454bce9b7320621022115412fbe97403945
2021-04-03 08:25:12 +09:00
Colin Cross
8095c29597 Remove support for unsandboxed metalava
Everything is running in the sandbox, remove the unsandboxed support.

Bug: 153703940
Test: m checkbuild
Change-Id: I811b8a0ad37143518c120367dd20b2b6aa011570
2021-03-31 13:17:42 -07:00
Colin Cross
3fbf2bea6a Default metalava sandboxing to true
Turn on sandboxing everywhere.

Bug: 153703940
Test: m checkbuild
Change-Id: Ie64913d302efb780d5be9c1b32e6c368d72feba3
2021-03-29 21:57:49 -07:00
Colin Cross
5f6ffc72f7 Add dependencies for Metalava's implicit android.jar references
Metalava implicitly searches
prebuilts/tools/common/api-versions/android-%/android.jar and
prebuilts/sdk/%/public/android.jar when looking for --android-jar-patterns
matches, and fails if it can't find a match for an API level between 1 and
28 in at least one pattern.  Add android.jar files from the
api_levels_annotations_dirs directories to try to satisfy these patterns.

Bug: 153703940
Test: m docs
Change-Id: I866850b33d9a5cd82cc5135bd8f9e9400ed65439
2021-03-29 21:57:49 -07:00
Colin Cross
bc13992711 Support sandboxing droiddoc and droidstubs with args properties
args properties can access arbitrary files with $(location) expansions,
so they need to pass them through RuleBuilderCommand.PathsForInputs
to produce a path inside the sandbox.  Extract the arg expansion out
of collectDeps into a new expandArgs method that takes the
RuleBuilderCommand.

Test: TestDroidstubsSandbox
Change-Id: I9022d17bf3cb64c97b2008c4c1b733bf48edca95
2021-03-25 22:21:23 -07:00
Colin Cross
6aa5c40393 Strengthen metalava sandbox support using sbox
Run sandbox metalava rules inside sbox, which copies only the expected
inputs into a separate directory tree.  This ensures it can't read any
extra inputs.

Test: m hwbinder.stubs
Test: TestDroidstubs
Test: TestDroidstubsSandboxed
Change-Id: I71a83e3af6a385cc23f895397c2c883a2ac5fa22
2021-03-25 11:11:36 -07:00
Colin Cross
cb77f75aae Move metalava's output files into a subdirectory
Move all of the output files of the metalava rule into a single
subdirectory to make it compatible with sandboxing in sbox.

Test: TestDroidstubs
Change-Id: I66101c0c224dee702c8175e61c12cc9cd1aa8b93
2021-03-25 11:11:36 -07:00
Colin Cross
0d5324165a Fix lint warnings in droidstubs.go
Test: none
Change-Id: Ie387c8c4feddad7bd134604e442fd326e606cd2f
2021-03-25 11:11:36 -07:00
Colin Cross
2207f87756 Split droidstubs out of droiddoc.go
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
2021-03-25 11:11:34 -07:00