Commit graph

93 commits

Author SHA1 Message Date
Andrei Onea
47841973b2 Rename hiddenapi csv artifact
Use a more inclusive terminology (go/hiddenapi-list-renaming).

Bug: 162844296
Test: m
Change-Id: I9feea8f9d8e88977d949dfe4dcbd7e72bf77a451
2020-08-10 17:23:52 +01:00
Jeongik Cha
6df337255c Merge "Introduce AlwaysUsePrebuiltSdks" 2020-08-10 00:51:56 +00:00
Jeongik Cha
816a23a50d Introduce AlwaysUsePrebuiltSdks
Instead of UnbundledBuild, use AlwaysUsePrebuiltSdks
to determine if java modules needs to be built against prebuilt sdks.
And rename UnbundledBuildUsePrebuiltSdks to AlwaysUsePrebuiltSdks to
express its behavior more correctly.(It can be orthgonal to "Unbundled")

Bug: 160390776
Test: TARGET_BUILD_UNBUNDLED_IMAGE=true m vendorimage

Change-Id: I0be7265c1959d8774c295372cd7a9250169f6df9
2020-08-07 12:15:52 +09:00
Andrei Onea
ca79081bde Rename hiddenapi manual lists
Use new names for lists from go/hiddenapi-list-renaming
Bug: 162827370
Test: m

Change-Id: I9522f32faa46d1d49aefad0921ba6d9c427d8779
2020-08-04 15:34:35 +01:00
Aleksei Kalinov
f0f5cdc1cc Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference.

Bug: 161896447
Test: ran `m`.
Change-Id: If5ec29482911c281bc1c4bf2cfc84b2f05c2240d
2020-07-29 15:49:05 +00:00
Pete Gillin
811814282d Merge "Split the core/platform API into stable and legacy versions." am: d7db79cc8b am: 5dbf9e09f2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1322704

Change-Id: I731da4ed59432a67bdc3df124a8939bcf316aa0c
2020-06-09 16:37:21 +00:00
TreeHugger Robot
a4cf51ff72 Merge "Include car project in grey list removed apis" into rvc-dev am: 50cea1a76e
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11746426

Change-Id: Ie39738a277df3af9bdae6c59ad39b4bf07b16287
2020-06-08 18:13:03 +00:00
Pete Gillin
1f41dbff64 Split the core/platform API into stable and legacy versions.
For now, everything outside libcore still uses the legacy version.

Test: treehugger
Bug: 157640067
Change-Id: If5234e9ee533ff537926801a0af045d36b1caf01
2020-06-08 10:53:51 +01:00
Eric Jeong
9791efa3e8 Include car project in grey list removed apis
- Car framework has removed system APIs.
- These APIs should be tracked at run-time.

Bug: 154832144
Test: 1) android.signature.cts.api.AnnotationTest#testAnnotation
      2) diff $OUT/soong/hiddenapi/hiddenapi-flags.csv before and after this CL

Change-Id: I9813df4b514da41e82d45e6c0bc92643916fe0d8
2020-06-05 09:07:27 -07:00
Ulyana Trafimovich
5539e7b568 Revert^2 "Rename DexJar interface method to DexJarBuildPath."
This reverts commit b0dc851ff4.

Reason for revert: relanding original change. Build failures were
  caused by a race with another CL: https://r.android.com/1320920

Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: Ic9016582dae7773b4d4f84a63425f1ef7a5d061f
2020-06-04 17:20:38 +01:00
Ulyana Trafimovich
b0dc851ff4 Revert "Rename DexJar interface method to DexJarBuildPath."
This reverts commit 562c240185.

Reason for revert: breaks `lunch full-eng && m checkbuild`.

Change-Id: Id7c7d6240d98afaf8edd49b6c96cd05534b784cc
2020-06-04 10:37:36 +00:00
Ulya Trafimovich
562c240185 Rename DexJar interface method to DexJarBuildPath.
This is a prerequisite change before adding DexJarInstallPath.

Test: lunch aosp_cf_phone-userdebug && m
Change-Id: I033e08b8bb06c0a844a6bbbfcdc48ce33e9c95cf
2020-06-03 11:40:45 +01:00
Artur Satayev
a8ec55990f Use modular removed-dex.txt files for greylisting.
Use droidstubs for public and system stubs to provide a list of @removed APIs. As these APIs are not present in the stubs, they are not whitelisted / greylised automatically. Keep them on greylist manually.

Bug: 143864733
Test: diff out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: I4c8e6899fadfdfd1da82f6f453cc92e71aa9b78c
Merged-In: I4c8e6899fadfdfd1da82f6f453cc92e71aa9b78c
Exempt-From-Owner-Approval: clean cherry-pick
(cherry picked from commit c7fb5c9964)
2020-03-31 14:46:39 +00:00
Artur Satayev
c7fb5c9964 Use modular removed-dex.txt files for greylisting.
Use droidstubs for public and system stubs to provide a list of @removed APIs. As these APIs are not present in the stubs, they are not whitelisted / greylised automatically. Keep them on greylist manually.

Bug: 143864733
Test: diff out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: I4c8e6899fadfdfd1da82f6f453cc92e71aa9b78c
2020-03-30 17:25:13 +01:00
Artur Satayev
8a950790ee Merge CSV files generated by UnsupportedAppUsageProcessor.
Flow:
1. Annotation processor generates a CSV file per class as a CLASS_OUTPUT resource.
2. hiddenapi.go extracts individual .csv files and merges them into an index.csv file per module.
3. hiddenapi_singleton.go merges individual index.csv files into a combined .csv file.

In a follow up hiddenapi-index.csv would replace unsupportedappusage_index.csv

Bug: 145132366
Change-Id: I87d92f9c8d4b1cc1df526fc576ee3c2101116b58
Merged-In: I87d92f9c8d4b1cc1df526fc576ee3c2101116b58
Test: diff unsupportedappusage_index.csv hiddenapi-index.csv
Exempt-From-Owner-Approval: cp from r.android.com/1239709
2020-03-21 13:01:17 +00:00
Artur Satayev
b5df8a04ad Merge CSV files generated by UnsupportedAppUsageProcessor.
Flow:
1. Annotation processor generates a CSV file per class as a CLASS_OUTPUT resource.
2. hiddenapi.go extracts individual .csv files and merges them into an index.csv file per module.
3. hiddenapi_singleton.go merges individual index.csv files into a combined .csv file.

In a follow up hiddenapi-index.csv would replace unsupportedappusage_index.csv

Bug: 145132366
Change-Id: I87d92f9c8d4b1cc1df526fc576ee3c2101116b58
Test: diff unsupportedappusage_index.csv hiddenapi-index.csv
2020-02-20 20:21:49 +00:00
Artur Satayev
79fac05b45 Use flag names with merge_csv.py.
Bug: 145132366
Test: diff -w out/soong/hiddenapi/hiddenapi-greylist.csv
Change-Id: If63c8ae5eda48e49bf58a338bf08f0f2d4fea3cf
2020-02-19 13:24:04 +00:00
Artur Satayev
b01dd44266 Use merge_csv python_binary.
Instead of using .py file directly.

Bug: 145132366
Test: diff -w out/soong/hiddenapi/hiddenapi-greylist.csv
Change-Id: Ib79019234b4ae05486e831b30d27bd1be3bbba67
2020-01-20 17:59:02 +00:00
Jiyong Park
4ed468c1af Revert submission 1194828-revert-1191937-art_apex_available-DWXQGTKMAR
Reason for revert: relanding with fix
Reverted Changes:
Ic4119368c:Revert submission 1191937-art_apex_available
Ia084976bb:Revert submission 1191937-art_apex_available
Iada86226d:Revert submission 1191937-art_apex_available
Ic76735eac:Revert submission 1191937-art_apex_available
I1eb30e355:Revert submission 1191937-art_apex_available
Icaf95d260:Revert submission 1191937-art_apex_available
Ie8bace4be:Revert submission 1191937-art_apex_available
I8961702cf:Revert submission 1191937-art_apex_available
I39316f9ef:Revert submission 1191937-art_apex_available
I522a7e83b:Revert submission 1191937-art_apex_available
I8b9424976:Revert submission 1191937-art_apex_available
I48b998629:Revert submission 1191937-art_apex_available

Change-Id: I95cef82fa5dfaba5b7044cf274ce59ab954b8f2b
2019-12-19 02:11:10 +00:00
Joseph Murphy
4752219db3 Revert submission 1191937-art_apex_available
Original Commit Message:
"""
Rename modules that are APEX-only

The renamed modules are only available for APEXes, but not for the
platform. Use the <module_name>.<apex_name> syntax to correctly install
the APEX variant of the modules.
"""

Reason for revert: Build Cop - Breaks about 15 AOSP targets, with high confidence due to these changes being the only non-robot changes in those builds.

Reverted Changes:
I190ce2d10:Use apex_available property
I990e0a67e:Use apex_available property
I0d1295683:Revert "Avoid duplicated classes for boot dex jars...
I5fb725403:Find the jar libraries in APEX from the correct pa...
I322b1efcc:Rename modules that are APEX-only
Ifa2bd0f8f:Use apex_available property
Iac6533177:Use apex_available property
Ie999602c6:Use apex_available property
I2a3d73397:Use apex_available property
Ic91bcbb9a:Use apex_available property
Ia6c324eed:Use apex_available property
I964d0125c:Use apex_available property

Change-Id: I48b998629b0676cd7353e6844fd87585e0e42989
2019-12-19 01:06:24 +00:00
Jiyong Park
a92fbb3b72 Revert "Avoid duplicated classes for boot dex jars"
This reverts commit 2812df4edb.

This is no longer required as we have
I6463ebc59cf7fd861b812999d7a79c387bbb3335.

hostdex files are available even when the module doesn't have
"//apex_available:platform"

Bug: 128708192
Test: m
Change-Id: I0d1295683222bc9cdbb82630e61ab3421c717daf
2019-12-17 20:35:42 +09:00
Jiyong Park
2812df4edb Avoid duplicated classes for boot dex jars
When a boot classpath java library is directly or indirectly included in
APEXes, multiple variant of the library exist. When running the
hiddenapi tool, we need to eliminate the duplication, otherwise the tool
will complain.

Previously, we simply choose the platform variant of the java library
among the multiple variants. However, if the java library is marked not
available for the platform (i.e. "//apex_available:platform" is not in
the apex_available property), the platform variant does not exist and
thus it is not fed into the hiddenapi tool, which causes missing
references in the tool.

To solve the problem, the platform variant is selected only for the java
libs that are available for the platform. For those libs that are not
available for the platform, we choose one variant of it using a
heuristic; skip testing APEXes and choose com.android.art.release among
the com.android.art.* variants.

Bug: 128708192
Test: m

Change-Id: I33bf297eb3029696ae3504a011486210708fb2c2
2019-12-16 15:19:13 +09:00
Martin Stjernholm
7260d066ea Move/dedupe some host path functions in package_ctx.go.
These functions don't need a PackageContext object.

Test: m
Bug: 145934348
Change-Id: Ia1da2c76cbad292f9ca79617199b2b5b6b265568
2019-12-09 22:04:21 +00:00
Artur Satayev
c5b4f99104 Pass hiddenapi-greylist-max-q.txt to greylist generator.
Bug: 137350495
Test: m, manual inspection of out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: I67227307ec08ab56a385980eceacaab1b985eb49
Merged-In: I67227307ec08ab56a385980eceacaab1b985eb49
2019-11-20 10:46:16 +00:00
Jiyong Park
7f7766d5ee Revert "Revert "Split Java libraries per apex""
This reverts commit f0f7ca8335.

Bug: 138182343
Test: apex_test added
Change-Id: I5c8a0935ac0f456137c8656815e220b0e7848a5d
2019-07-26 14:19:38 +09:00
Jiyong Park
f0f7ca8335 Revert "Split Java libraries per apex"
This reverts commit aa53324ac8.

Reason for revert: b/138337109 (broke ndk build)

Change-Id: I9497cb4337add3f8c491a684bcaadea3bdbfaa85
2019-07-25 04:38:02 +00:00
Jiyong Park
aa53324ac8 Split Java libraries per apex
Just like native libs, a java library that is included in an APEX is
mutated for the APEX. This allows us to infer the context (e.g.
sdk_version, etc.) for building a java library in an APEX.

Bug: 138182343
Test: apex_test added
Change-Id: I9292ea097b98e74a8a794f164bd2bed3921d6337
2019-07-23 20:32:14 +09:00
Jiyong Park
e3ef3c8f0c Fix the unbundled mainline module build
This change fixes two problems:

1) the prebuilt apexes are force disabled for the unbundled builds
because we need to build the modules from the source then

2) the dependencies from an sdk_library module to
*.stubs.{public|system|tests} are not added for the unbundled build
because the stubs modules are disabled.

Bug: 137282010
Test: unbundled mainline builds are successful
Test: build com.android.media and inspect the jar file to see if
hiddenapi flags are there
$ cd out/dist/mainline_modules_arm
$ unzip com.android.media.apex apex_payload.img
$ mkdir -p mnt
$ sudo mount -o ro,loop apex_payload.img mnt
$ dexdump2 mnt/javalib/updatable-media.jar | grep hiddenapi
shows results

Change-Id: I2c00af07aac4a15770d3acab011a36e2e4803bfc
2019-07-15 17:20:05 +09:00
Jiyong Park
09cb629c15 Revert "Don't build hiddenapi flags or encode dex for unbundled builds"
This reverts commit 7b8a567f44.

Bug: 137282010
Test: With the CL above this one, the unbundled mainline module build
does not fail.

Change-Id: I2f49fa7dbe1da92cb282a9bc14acd5830888ed17
2019-07-15 17:17:31 +09:00
Paul Duffin
1b033f5c4c Add hiddenapi_flags module type
The build generates a file out/soong/hiddenapi/hiddenapi-flags.csv
which is used by the hiddenapi-blacklist tests in cts/tests/signature.
The generation is done at the ninja level and so is not accessible from
the soong layer that runs on top. This change adds the hiddenapi-flags
module type which makes the file accessible from other soong modules.

Bug: 122332514
Test: atest -p cts/tests/signature
Change-Id: If38c8a8ffca110f2ae01f97f19a2740ca3fde1b7
Exempt-From-Owner-Approval: Colin has already reviewed and only had minor
    nits and this is blocking other changes.
2019-06-13 10:25:47 +01:00
Colin Cross
9c74a1ee85 Don't build hiddenapi flags or encode dex for unbundled builds
Builds with TARGET_BUILD_APPS shouldn't build the hiddenapi flags
or encode dex files even if frameworks/base exists.

Bug: 133343287
Test: mainline modules build
Change-Id: I0647451420fd09bb680808b35e1ad3b8f514ba46
2019-05-28 21:48:54 +00:00
Colin Cross
caa0e1e341 Fix panic when missing hiddenapi jar
Fix a panic after reporting an error when a module is listed
in ProductHiddenAPIStubs but doesn't exist or doesn't produce
a dex jar.

Test: manual
Change-Id: I43643cbc5303536bfe0b02feedb03563ea0b540a
2019-04-02 13:03:46 -07:00
Andrei Onea
896237b7b9 Automatically greylist code in 3P packages
Bug: 129387816
Test: m appcompat
Test: frameworks/base/tools/hiddenapi/generate_hiddenapi_lists_test.py
Change-Id: Id55abed766a6de6a2c032ee12d5153ab73a8d65c
2019-03-29 16:51:43 +00:00
Andrei Onea
e04da07dfe Differentiate system and test apis in whitelist
@SystemApi and @TestApi entries in the whitelist can now be
differentiated from the rest of the public apis.

Test: m
Change-Id: Ie6a0108540cffe11992739d6391531401378f14b
2019-03-01 17:44:13 +00:00
Paul Duffin
719fed4e95 Fix hiddenapi issue when REMOVE_ATB_FROM_BCP=true
If the android.test.base is not on the bootclasspath then its stubs
should not be used as input to the hiddenapi processor.

Bug: 73711752
Test: make REMOVE_ATB_FROM_BCP=true droid && atest -p cts/tests/signature
Change-Id: Ib03899001e4350c9ad9e757e9e6d7d41bb0a3896
2019-02-28 16:15:44 +00:00
Allen Hair
de816cf577 Whitelist Offline.getProbes(..).
Test: atest -v -it CtsSystemUiTestCases -- --abi x86 --test-arg com.android.tradefed.testtype.AndroidJUnitTest:coverage:true
Bug: 122330976
Change-Id: Ieb4a8808de6a3e062297c6a0b9e83a3872247eee
2019-02-25 16:49:05 -08:00
Colin Cross
69f59a3327 Make RuleBuilder methods take Paths
There are no more Make paths being used in Soong now that
dexpreopting and hiddenapi are in Soong. Use the Path types
in the inputs to RuleBuilder, and fix all users of RuleBuilder.

This reapplies I886f803d9a3419a43b2cae412537645f94c5dfbf with
fixes to disable preopt for Soong-only builds when the global
dexpreopt.config doesn't exist.

Test: all soong tests
Test: m checkbuild
Change-Id: I4dae9ecd5de22f062f9478ec8f0747f099cf8190
2019-02-20 22:06:09 -08:00
Colin Cross
ab898dc4a4 Revert "Make RuleBuilder methods take Paths"
This reverts commit acdd694071.

Reason for revert: broke ndk build

Change-Id: I5655e48c15eb8f5f0267afdd853fbc25765b8623
2019-02-21 05:03:00 +00:00
Colin Cross
acdd694071 Make RuleBuilder methods take Paths
There are no more Make paths being used in Soong now that
dexpreopting and hiddenapi are in Soong. Use the Path types
in the inputs to RuleBuilder, and fix all users of RuleBuilder.

Test: all soong tests
Test: m checkbuild
Change-Id: I886f803d9a3419a43b2cae412537645f94c5dfbf
2019-02-20 14:23:37 -08:00
Colin Cross
ed023eca73 Allow Singletons to export Make variables
Register any Singletons that implement a MakeVars method as
MakeVarsProviders, and convert the hiddenapi singleton to
use it.

Test: m checkbuild
Change-Id: I6a2044ad34ef46a8b267762ddfeb51aa01d7734d
2019-02-19 12:45:14 -08:00
Colin Cross
697412f058 Remove the hiddenapi presingleton
The presingleton is no longer necessary now that MakeVarsContext
is a PathContext, just call hiddenAPISingletonPaths directly.

Test: m checkbuild
Test: forrest build of unbundled branch
2019-02-07 22:31:44 +00:00
Colin Cross
76e3e1f554 Use a presingleton to create hiddenapi singleton paths early
If no module uses hiddenapi (because it is an unbundled build that
does not build any boot image modules), then the makevars singleton
panics because it will always run before the hiddenapi singleton
(due to package init() function ordering), and the hiddenapi singleton
paths have not been initialized yet.  Add a presingleton to initialize
the paths early.

Bug: 123645297
Test: tapas Launcher3 && m on unbundled branch
Change-Id: I9386ac87848a2181f51140129288df80fff9acfd
2019-02-07 08:57:26 -08:00
Colin Cross
f24a22a98a Move hiddenapi singleton rules to Soong
Move the rules that build hiddenapi-stubs-flags.txt,
hiddenapi-flags.csv and hiddenapi-greylist.csv into Soong.

Bug: 123645297
Test: m checkbuild
Test: m UNSAFE_DISABLE_HIDDEN_API_FLAGS=true
Change-Id: I90bf58710f6153ee8565994f799d3ec5699bc7fa
2019-02-06 11:23:40 -08:00