Commit graph

1966 commits

Author SHA1 Message Date
Anton Hansson
0f15a9f866 Remove unused arguments in droiddoc
Nothing passes these arguments, so it's dead code.

There is a lot of other cruft in this file that is effectively
dead code, but required further cleanup.

Bug: 152479829
Test: m
Change-Id: Ib2630d4d49f21003b17e2331b0900e8df0a27e66
Merged-In: Ib2630d4d49f21003b17e2331b0900e8df0a27e66
(cherry picked from commit 0ee713aa0e)
2020-04-22 21:15:09 +01:00
Anton Hansson
27d9ec1860 Remove _API_FILE variables
There are no known usages of these variables, and many have been
incorrectly set for a long time.

Also convert the <module> phony for api txt to androidmk.

Bug: 152479829
Test: m
Change-Id: Iff355041d88eb59ac47dd19a03e993cf1ce3927e
2020-04-17 20:27:11 +01:00
Artur Satayev
2db1c3f1c4 Check updatable APKs compile against managed SDKs.
As a follow up, this property will be set to APKs participating in mainline program.

Bug: 153333044
Test: m
Change-Id: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43
2020-04-15 12:06:13 +01:00
Jaewoong Jung
f472871e00 Merge "Add libs properties to runtime_resource_overlay." 2020-04-13 13:27:25 +00:00
Jaewoong Jung
fe3c7f6261 Add libs properties to runtime_resource_overlay.
(This is a cherry-pick change.)

Test: app_test.go
Test: Converted an existing RRO module.
Bug: 148788111
Change-Id: I723c7175760da019d38893e54f236c45f4c973ea
Merged-In: I723c7175760da019d38893e54f236c45f4c973ea
2020-04-10 16:29:40 -07:00
Paul Duffin
d4c0356dad Create prebuilt api modules in load hook not mutator
An attempt to reference one of the prebuilt modules directly from an
Android.bp file highlighted a bug. The prebuilt_apis module used a
mutator to create filegroup and java_import modules for a set of api
versions. That mutator ran after the "prebuilts" mutator which handled
the renaming of prebuilt modules when the matching source module was
not present. That meant that the only way to reference the module was
by explicitly adding the prefix "prebuilt_".

This change fixed that bug by creating the modules in a load hook rather
that a mutator. This ensures that the prebuilt modules are present well
before the "prebuilts" mutator is run. Removing the mutator also removes
an unnecessary traversal of the whole dependency tree.

It also updated the documentation to explain that it creates
java_import modules as well as the filegroup modules.

(cherry picked from 47f6315f01)

Bug: 153649372
Test: m droid
Change-Id: Id44dce8ca9968ae903345df6ef1c4f1be9cb76c5
Merged-In: Id44dce8ca9968ae903345df6ef1c4f1be9cb76c5
2020-04-10 07:44:52 +01:00
Treehugger Robot
318f68226b Merge "Export API files as part of the java_sdk_library" 2020-04-10 03:57:11 +00:00
Treehugger Robot
b661961825 Merge "Export stub sources as part of the java_sdk_library" 2020-04-10 03:57:04 +00:00
Treehugger Robot
522bca3b26 Merge changes If74eea67,I9d8089b2
* changes:
  Extract createJavaImportForStubs()
  Support java_sdk_library as member of sdk
2020-04-09 17:01:51 +00:00
Paul Duffin
f9cb1204e1 Merge "Generate struct with field for each api scope" 2020-04-09 17:01:40 +00:00
Jaewoong Jung
9b38447d48 Merge "Collect JNI coverage data only for first target." 2020-04-09 16:42:34 +00:00
Paul Duffin
e03749b9ad Merge "Allow droidstubs to not generate any stubs" 2020-04-09 15:42:07 +00:00
Jaewoong Jung
46984eeb58 Collect JNI coverage data only for first target.
Modules with compile_multilib property set to "both" cause builds to
fail due to duplicate Make recipes. Fix it by outputting reports only
for the first target for now.

(This is a cherry-pick change.)

Bug: 153461674
Test: Built cts with the coverage flags set.
Change-Id: Ibb8da6e9c112a857695cd7095a62c910cddfbb94
Merged-In: Ibb8da6e9c112a857695cd7095a62c910cddfbb94
2020-04-09 08:32:40 -07:00
Paul Duffin
1fd005d5b3 Export API files as part of the java_sdk_library
Bug: 153443117
Test: m nothing

Change-Id: I9d6f5b91a7cc25019e2eb9e3c138f0874d2831de
2020-04-09 01:33:46 +01:00
Paul Duffin
3d1248ceb6 Export stub sources as part of the java_sdk_library
Minor refactoring of checkMergeZip(string) -> checkMergeZips(...string)
to allow testing of multiple merge zips.

Bug: 153443117
Test: m nothing
Change-Id: I8db00f611ced15f8476ba16f2834a72e8c913596
2020-04-09 01:32:38 +01:00
Paul Duffin
bbb546b2da Extract createJavaImportForStubs()
Bug: 153443117
Test: m nothing
Change-Id: If74eea675b7ab4aeaa821294f2a137c95f794d4f
2020-04-09 01:32:38 +01:00
Paul Duffin
46a26a8871 Generate struct with field for each api scope
Makes it easier to add new api scopes by generating a struct with a
field for each scope.

Bug: 153443117
Test: m nothing
Change-Id: Iec77a858d2c851d99e56568b89cb30aa3ff2a244
2020-04-09 01:32:38 +01:00
Paul Duffin
dd46f71493 Support java_sdk_library as member of sdk
Bug: 153443117
Test: m nothing
Change-Id: I9d8089b2555038e3f10ad5939a6a7b01839c67ea
2020-04-09 01:32:38 +01:00
Colin Cross
ff550f3e13 Merge "Revert^2 "Add sdk mutator for native modules"" 2020-04-08 18:29:30 +00:00
Paul Duffin
3ae2951296 Allow droidstubs to not generate any stubs
Needed to optimize the handling of the module_lib API surface which
currently has to be generated with two separate droidstubs instances,
one to generate the stubs and another to generate the .txt file. This
allows the module generating the .txt file to avoid also wasting time
generating stubs that are not used.

This change:
* Adds a generate_stubs property that defaults to true to allow the
  behavior to be customized on a per module basis.
* Uses either the stubs srcjar or the api .txt file as the OutputFile
  for the AndroidMkEntries to ensure that they get written out properly.
* Rearranges the code for generating stubs to make it easier to
  turn it off.

Bug: 146727827
Test: m droid
      Check output dir of framework-sdkextensions-api-module_libs_api
	  to make sure it does not contain any sources or srcjars.
Change-Id: Ib8025019f8a7a8cf5fa8765d76b5ad470af20006
2020-04-08 18:50:37 +01:00
Ulyana Trafimovich
82aca76739 Merge "Relax boot image check to allow platform Jacoco variant in a coverage build." 2020-04-08 16:56:10 +00:00
Paul Duffin
f76c64018e Merge "Stop requiring apex_available on java_library members of sdks" 2020-04-08 14:26:39 +00:00
Ulya Trafimovich
e0ce4ba491 Relax boot image check to allow platform Jacoco variant in a coverage build.
Test: m nothing
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true nothing

Bug: 153533941

Change-Id: I5847ec282f6b481cee61ed9ec6b6928c9a41fae7
2020-04-08 15:11:20 +01:00
Ulyana Trafimovich
0d8f61640e Merge "Forbid generating boot image files for jars in updatable modules." 2020-04-08 12:15:47 +00:00
Paul Duffin
6534770793 Stop requiring apex_available on java_library members of sdks
Previously, adding java_library to an sdk required that the names of
any APEXes that transitively compiled against it were added to its
apex_available property. This change removes that requirement.

Also corrects the dependency path in the TestApexAvailable_IndirectDep
error which previously passed through "shared from static" static
dependency tags even though those are explicitly NOT followed when
checking apex_available settings.

Bug: 152878661
Test: m droid
Change-Id: I995ed38956c1bc210b09494812de012fed9f9232
2020-04-08 08:40:44 +01:00
Treehugger Robot
5bf1480218 Merge changes I96f0eb03,Ie883eb45
* changes:
  Parameterize scopes with additional droidstubs args
  Replace references to droiddoc with droidstubs
2020-04-08 00:42:22 +00:00
Paul Duffin
1fb487df17 Parameterize scopes with additional droidstubs args
Added droidstubsArgs field to the apiscope structure to avoid
switching on api scope type.

Bug: 153443117
Test: m nothing
Change-Id: I96f0eb033d44c6a74787ba7f1523799b05a58092
2020-04-07 18:59:12 +01:00
Paul Duffin
6d0886e279 Replace references to droiddoc with droidstubs
The java_sdk_library code used to create droiddoc and now it creates
droidstubs but it still referenced droiddoc internally. This change
removed all the remaining references except the ones that are visible
externally.

Bug: 153443117
Test: m nothing
Change-Id: Ie883eb4590f9c091d4149d7b17d7d3d91b1b5c6a
2020-04-07 18:56:14 +01:00
Colin Cross
c511bc50dc Revert^2 "Add sdk mutator for native modules"
f8e80229fe

Change-Id: Ic30ab6b844684bfc3e8ece5a1913980d5fbf8de2
2020-04-07 16:50:32 +00:00
Ulya Trafimovich
b28cc3758c Forbid generating boot image files for jars in updatable modules.
This is to guard against the potential situation when someone adds
updatable modules to the list of boot jars by mistake.

Test: aosp_walleye-userdebug builds.

Test: Manually break the checks and observe the errors:
  - move updatable module 'conscrypt' from
    PRODUCT_UPDATABLE_BOOT_JARS to ART_APEX_JARS:
      internal error: module 'conscrypt' from updatable apex 'com.android.conscrypt' is not allowed in the ART boot image

  - add updatable module 'conscrypt' to ART_APEX_JARS
    (but do not remove it from PRODUCT_UPDATABLE_BOOT_JARS):
      error: A jar in PRODUCT_UPDATABLE_BOOT_JARS must not be in PRODUCT_BOOT_JARS, but conscrypt is.

  - move updatable module 'framework-tethering' from
    PRODUCT_UPDATABLE_BOOT_JARS to PRODUCT_BOOT_JARS:
      internal error: module 'framework-tethering' from updatable apex 'com.android.tethering' is not allowed in the framework boot image

  - add non-updatable (in AOSP) module 'android.net.ipsec.ike'
    to PRODUCT_BOOT_JARS:
      internal error: failed to find a dex jar path for module 'com.android.ipsec.ike', note that some jars may be filtered out by module constraints

Bug: 147579140

Change-Id: I25ca2f52530fcfa1f9823b2cfa3485db9c0d0db1
2020-04-07 17:09:59 +01:00
Colin Cross
d66b121000 Merge "Revert "Add sdk mutator for native modules"" 2020-04-07 04:25:34 +00:00
Colin Cross
f8e80229fe Revert "Add sdk mutator for native modules"
Revert submission 1242911-sdk_version_variant

Reason for revert: b/153394225
Reverted Changes:
Ife99745fb:Use libnativewindow for platform variant of libagq...
I1bae84c43:Use libnativewindow for platform variant of androi...
I6e6021ed3:Use stl to depend on libc++
Ife99745fb:Use libnativewindow for platform variant of libRSS...
I2c9f439b9:Fix static dependency on libprotobuf-cpp-lite-ndk
Iff2aff9cf:Set sdk_version for cc_genrules used by modules wi...
I7d72934aa:Add sdk mutator for native modules
Ief378a007:Use sdk variant of Soong modules when LOCAL_SDK_VE...

Bug: 149591340
Change-Id: I798fa902c779469c6382b6699351e5d12bf14785
Fixes: 153394225
2020-04-07 04:21:21 +00:00
Colin Cross
f5d6756a35 Merge "Add sdk mutator for native modules" 2020-04-07 01:52:11 +00:00
David Srbecky
0f6fdf5544 Fix dex-location for host.
Fix the location for non-default build output path.

Test: Run host test on golem.
Change-Id: Idbaccfc69196fc0b17a849b4a0c7a54d75fd363d
2020-04-06 18:48:22 +01:00
Treehugger Robot
ab768cf54b Merge "[soong] new field in Android.bp to request APK signing V4" 2020-04-05 02:14:41 +00:00
Songchun Fan
17d69e3484 [soong] new field in Android.bp to request APK signing V4
If "v4_signature: true" is set, the v4 signature file,
named [outputApkFile].idsig
will be generated along side the outputApkFile.

Test: m nothing
Test: atest PackageManagerShellCommandIncrementalTest
BUG: 149354175
Change-Id: Ie84725a15406f96f65042ea9909460e4eb34d57f
Merged-In: Ie84725a15406f96f65042ea9909460e4eb34d57f
2020-04-04 12:37:45 -07:00
Vladimir Marko
1c5d4fe4f7 Merge "Add file with updatable BCP packages to /system/etc/" 2020-04-02 11:42:08 +00:00
Vladimir Marko
205e6c2a15 Add file with updatable BCP packages to /system/etc/
Make `permitted_packages` mandatory for updatable boot class
path jars. Collect the permitted_packages from those jars to
a file installed as /system/etc/updatable_bcp_packages.txt .

Test: aosp_taimen-userdebug boots.
Test: adb shell cat /system/etc/updatable-bcp-packages
Test: Manual, remove permitted_packages from framework-tethering,
      build fails.
Bug: 151314205
Change-Id: I21def97ace9081e707910d449943c683189f16cf
2020-04-02 08:51:39 +01:00
Colin Cross
82e192c3ae Add sdk mutator for native modules
Compiling native modules against the NDK disables platform features
like ASAN.  For anything shipped on the system image there is no
reason to compile against the NDK.  Add a new mutator to Soong that
creates a platform and an SDK variant for modules that set
sdk_version, and ignore sdk_version for the platform variant.  The
SDK variant will be used for embedding in APKs that may be installed
on older platforms.  Apexes use their own variants that enforce
backwards compatibility.

Test: sdk_test.go
Test: TestJNIPackaging
Bug: 149591340
Change-Id: I7d72934aaee2e1326cc0ba5f29f51f14feec4521
2020-04-01 16:09:05 -07:00
Anton Hansson
3f7534c0cb Merge "Convert sdk_library to use androidmk Dist" 2020-04-01 19:52:51 +00:00
Anton Hansson
e61c9b09e1 Merge "Add a Tag field to dist to dist a tagged output" 2020-04-01 19:52:38 +00:00
David Srbecky
20d854948b Merge "Adjust embedded dex locations in host boot image." 2020-04-01 15:42:29 +00:00
David Srbecky
ab99498ea1 Adjust embedded dex locations in host boot image.
ART tests require that "out/host/linux-x86" is included.

This requires making the dexLocations per-variant specific.

Test: m test-art-host-gtest
Bug: 147817558
Bug: 147819342
Change-Id: I7839ee15cb6dfc62508bdd3fa0f306336af17055
2020-04-01 12:06:56 +01:00
Anton Hansson
5fd5d24a91 Convert sdk_library to use androidmk Dist
Reuse the generic Dist support instead of writing
custom mk rules for it. Use the new Tag support to
grab the classes.jar instead of the dexed jar.

Bug: 152618077
Test: m sdk dist
Change-Id: Id893d52cc24b66e6bd900b5062a59f3820000bcd
Merged-In: Id893d52cc24b66e6bd900b5062a59f3820000bcd
(cherry picked from commit 6bb8810c8e)
2020-03-31 09:56:00 +01:00
Anton Hansson
78156ef5dd Add a Tag field to dist to dist a tagged output
Make java_library support this mode of output, to allow
callers to dist the classes.jar file rather than the dexed
jar file.

Bug: 152618077
Test: followup CL
Change-Id: I5ba6949833a0fbb95376142aec5096ff5f084c00
Merged-In: I5ba6949833a0fbb95376142aec5096ff5f084c00
(cherry picked from commit 1e65f94a4b)
2020-03-31 09:55:49 +01: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
David Srbecky
2d557ced02 Merge "Fix dump-oat-boot build target." 2020-03-27 16:12:22 +00:00
Jaewoong Jung
87a33e72bc Add code coverage support to android_app JNI libs.
Test: Built mainline module coverage data
Bug: 152117890
Change-Id: I47bf3e5d6e78c4518729bdb52616e248156d3cec
2020-03-27 01:39:54 +00:00
David Srbecky
1aacc6c3df Fix dump-oat-boot build target.
Implement support of dumping host boot.art.

That was not possible before because imageLocation is different on host.

This CL makes imageLocation per-variant so can access for the host variant.

Test: m dump-oat-boot
Change-Id: Id82161e4901a6b77f220238aec460b8609fd765f
2020-03-26 15:28:27 +00:00
Anton Hansson
282dc32fb6 Merge "Default droiddoc to disting the api txt if there is one" 2020-03-26 08:40:46 +00:00