Commit graph

2083 commits

Author SHA1 Message Date
Colin Cross
503c1d06e8 Set LOCAL_CERTIFICATE for flattened apex APKs
Leaving out LOCAL_CERTIFICATE for flattened apex APKs causes
the apkcerts.txt to have empty keys for those APKs, which
confuses the signing tools.  Set LOCAL_CERTIFICATE for them.

Also refactor the Certificate support to avoid introducing
duplicated handling for presigned certificates.

Bug: 147765187
Test: m apkcerts-list
Change-Id: Ife07661761cd5a89c9f009b8ce041db4dff9ec54
2020-01-28 14:03:08 -08:00
Automerger Merge Worker
1bf59ab8ab Merge "Add support for experimentally enabling RBE support on specific rules." am: 5e0dbe4e3e am: 205edb5da3 am: a171ec4e95
Change-Id: I2922a3dd955162fa9f713ebfe9fe1852d76fd2c3
2020-01-28 20:31:14 +00:00
Ramy Medhat
5e0dbe4e3e Merge "Add support for experimentally enabling RBE support on specific rules." 2020-01-28 19:49:05 +00:00
Automerger Merge Worker
726644dc90 Merge "Fix --boot-image argument in dex2oat command for boot image extension." am: 911083e3e1 am: 00cc7b0b4d am: ab4c753ac7
Change-Id: Ib2b55daf80e463c744e85f6a197e7479541a68cd
2020-01-28 18:00:22 +00:00
Ramy Medhat
8ea054a81e Add support for experimentally enabling RBE support on specific rules.
This CL adds RBE support to javac, r8, and d8 rules which is only
enabled if respective environment variables are set.

Test: an aosp_crosshatch build with and without the new variables.
Change-Id: Ic82f3627944f6a5ee7b9f3228170c2709b1bfcb8
2020-01-28 12:42:47 -05:00
Ulyana Trafimovich
911083e3e1 Merge "Fix --boot-image argument in dex2oat command for boot image extension." 2020-01-28 17:04:38 +00:00
Ulya Trafimovich
b0a2d37dcb Fix --boot-image argument in dex2oat command for boot image extension.
The primary image name should be "boot.art" in case of
"boot-framework.art", and "apex.art" in case of "apex-framework.art".
Although "boot.art" and "apex.art" are identical binaries, dex2oat
has hard-coded logic based on the image name.

This has been broken since boot image extension has been enabled for
JIT-zygote config in CL I5493e575ebf90bad1d5ad2850004d54590bbc079.

Test: compare boot-framework.art and apex-framework.art,
  they were identical before this CL, and differ after this CL.

Test: JIT-zygote config boots, steps 1-2:

  1. Temporarily enable Jit zygote in the product device config (in
    this case device/google/muskie/aosp_walleye.mk):

    +# System server should not contain compiled code.
    +PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := verify
    +
    +# Use the apex image for preopting.
    +DEXPREOPT_USE_APEX_IMAGE := true
    +
    +# Have the runtime pick up the apex image.
    +PRODUCT_PROPERTY_OVERRIDES += \
    +    dalvik.vm.boot-image=/apex/com.android.art/javalib/apex.art:/system/framework/apex-framework.art

  2. Build and flash:
    $ lunch aosp_walleye-userdebug && m \
    && adb reboot bootloader && fastboot flashall -w

Change-Id: I98de271852ecc33feb9fd4c9b0addf0feba01856
2020-01-28 14:42:41 +00:00
Automerger Merge Worker
f72855d247 Merge "Abstract sdk_version string using sdkSpec type" am: 057dd35669 am: 6ca47f29ce am: be91dedf1c
Change-Id: I1d5c190c71f53858ad81df4ca20029c870df30ba
2020-01-28 01:00:35 +00:00
Treehugger Robot
057dd35669 Merge "Abstract sdk_version string using sdkSpec type" 2020-01-28 00:07:37 +00:00
Automerger Merge Worker
cdcbcdd10f Merge changes from topic "revert-1211982-dex2oat-soong-dep-LLLKNULXYJ" am: 699cf17f53 am: 90e753d47e am: 546538926f
Change-Id: I63175eb2054119123fa6aa17231f617186f2d633
2020-01-27 15:32:02 +00:00
Martin Stjernholm
699cf17f53 Merge changes from topic "revert-1211982-dex2oat-soong-dep-LLLKNULXYJ"
* changes:
  Revert "Separate dexpreopt.GlobalSoongConfig to allow independen..."
  Revert "Move the Once cache for dexpreopt.GlobalConfig into the ..."
  Revert "Get the dex2oat host tool path from module dependency on..."
2020-01-27 13:47:31 +00:00
Hans Boehm
e4b5342d43 Revert "Separate dexpreopt.GlobalSoongConfig to allow independen..."
Revert submission 1211982-dex2oat-soong-dep

Reason for revert: Build failures. See b/148312086.

Reverted Changes:
Ibc427a9a8: Make dex2oat(d) visible for use as implicit dexpre...
I71df11c1e: Move the Once cache for dexpreopt.GlobalConfig int...
I38317f2d5: Get the dex2oat host tool path from module depende...
I440a09dba: Separate dexpreopt.GlobalSoongConfig to allow inde...

Bug: 148312086
Bug: 145934348
Exempt-From-Owner-Approval: Plain revert
Change-Id: Ice3990225635a737e49e9aed7373f06516fccea3
2020-01-27 13:44:24 +00:00
Hans Boehm
453bf09853 Revert "Move the Once cache for dexpreopt.GlobalConfig into the ..."
Revert submission 1211982-dex2oat-soong-dep

Reason for revert: Build failures. See b/148312086.

Reverted Changes:
Ibc427a9a8: Make dex2oat(d) visible for use as implicit dexpre...
I71df11c1e: Move the Once cache for dexpreopt.GlobalConfig int...
I38317f2d5: Get the dex2oat host tool path from module depende...
I440a09dba: Separate dexpreopt.GlobalSoongConfig to allow inde...

Bug: 148312086
Bug: 145934348
Exempt-From-Owner-Approval: Plain revert
Change-Id: I6b656afb5feaad70d958b9d38b6c6eab7b03fba1
2020-01-27 13:44:03 +00:00
Hans Boehm
7b2e6f3ed7 Revert "Get the dex2oat host tool path from module dependency on..."
Revert submission 1211982-dex2oat-soong-dep

Reason for revert: Build failures. See b/148312086.

Reverted Changes:
Ibc427a9a8: Make dex2oat(d) visible for use as implicit dexpre...
I71df11c1e: Move the Once cache for dexpreopt.GlobalConfig int...
I38317f2d5: Get the dex2oat host tool path from module depende...
I440a09dba: Separate dexpreopt.GlobalSoongConfig to allow inde...

Bug: 148312086
Bug: 145934348
Exempt-From-Owner-Approval: Plain revert
Change-Id: I0cf6fef04434fd3c0b7957ee9abdcaabeb20b9d8
2020-01-27 13:01:16 +00:00
Ulya Trafimovich
f491dde8ea Store uncompressed and aligned DEX files for java libs in APEXes.
Test: aosp_walleye-userdebug boots.

Test: In internal, cherry-picked this CL, walleye-userdebug boots.

Test: In internal, ensure that DEX file wifi-service.jar in the
  com.android.wifi APEX is now stored uncompressed:

    $ zipinfo out/target/product/walleye/apex/com.android.wifi/javalib/wifi-service.jar
    Archive:  out/target/product/walleye/apex/com.android.wifi/javalib/wifi-service.jar
    Zip file size: 3086879 bytes, number of entries: 3
    -rw----     2.0 fat  3086304 b- stor 08-Jan-01 00:00 classes.dex
    -rw----     2.0 fat      339 b- defN 80-Feb-01 00:00 META-INF/proguard/androidx-annotations.pro
    -rw----     2.0 fat       45 b- defN 08-Jan-01 00:00 META-INF/MANIFEST.MF
    3 files, 3086688 bytes uncompressed, 3086480 bytes compressed:  0.0%

  Before the change it was:

    $ zipinfo out/target/product/walleye/apex/com.android.wifi/javalib/wifi-service.jar
    Archive:  out/target/product/walleye/apex/com.android.wifi/javalib/wifi-service.jar
    Zip file size: 1241938 bytes, number of entries: 3
    -rw----     2.0 fat  3086304 bl defN 08-Jan-01 00:00 classes.dex
    -rw----     2.0 fat      339 b- defN 80-Feb-01 00:00 META-INF/proguard/androidx-annotations.pro
    -rw----     2.0 fat       45 b- defN 08-Jan-01 00:00 META-INF/MANIFEST.MF
    3 files, 3086688 bytes uncompressed, 1241526 bytes compressed:  59.8%

Bug: 148099857
Bug: 146984232

Change-Id: Ia302967b280be85665032cc870c5d5d2419586fc
2020-01-27 10:19:10 +00:00
Jiyong Park
6a927c4e6a Abstract sdk_version string using sdkSpec type
The value format that sdk_version (and min_sdk_version, etc.) can have
has consistently evolved and is quite complicated. Furthermore, with the
Mainline module effort, we are expected to have more sdk_versions like
'module-app-current', 'module-lib-current', etc.

The goal of this change is to abstract the various sdk versions, which
are currently represented in string and is parsed in various places,
into a type called sdkSpec, so that adding new sdk veresions becomes
easier than before.

The sdk_version string is now parsed in only one place 'SdkSpecFrom', in
which it is converted into the sdkSpec struct. The struct type provides
several methods that again converts sdkSpec into context-specific
information such as the effective version number, etc.

Bug: 146757305
Bug: 147879031
Test: m
Change-Id: I252f3706544f00ea71c61c23460f07561dd28ab0
2020-01-25 21:56:43 +09:00
Automerger Merge Worker
e936d4072e Merge "Revert "Revert "Allow codename.fingerprint format for minSdkVersion""" am: cf0bba7a30 am: 0e7b913387 am: d786be38fc
Change-Id: Ic8fbbbefb3e2f8356d3d1220cdcdda0bce3b7872
2020-01-25 06:44:09 +00:00
Baligh Uddin
cf0bba7a30 Merge "Revert "Revert "Allow codename.fingerprint format for minSdkVersion""" 2020-01-25 04:12:30 +00:00
Automerger Merge Worker
ac19633b41 Merge "Create a highmem pool and put metalava into it" am: 6cc0515e82 am: 22a73155aa am: 23671f60c2
Change-Id: I4fac5e5cccbd73da406e384816cbc47a6b69ac10
2020-01-25 03:37:39 +00:00
Automerger Merge Worker
27efc54be4 Merge changes from topic "dex2oat-soong-dep" am: cf52e102ce am: fe568ba2a1 am: 1d1c492d20
Change-Id: I4797dc2b8837c1d982dd324aef619354fb61934e
2020-01-25 03:37:03 +00:00
Automerger Merge Worker
ad00cd0fcc Move the Once cache for dexpreopt.GlobalConfig into the dexpreopt package. am: dae8a80426 am: 0064a8888e am: 443178189c
Change-Id: I88bb622216b39dbe45c79deedf602042267ad632
2020-01-25 03:37:01 +00:00
Automerger Merge Worker
2ca3894edc Separate dexpreopt.GlobalSoongConfig to allow independent caching of it. am: be9d0d21d1 am: 852db0c1da am: 8e761f91c8
Change-Id: Ibf451ceb57c5770727ee1674634ef4d37e486213
2020-01-25 03:36:58 +00:00
Treehugger Robot
6cc0515e82 Merge "Create a highmem pool and put metalava into it" 2020-01-25 01:09:43 +00:00
Baligh Uddin
f62013736a Revert "Revert "Allow codename.fingerprint format for minSdkVersion""
This reverts commit 230e241f58.

Reason for revert: This is a revert of a revert.  Downstream problem has been fixed and have been validated locally and via Forrest build.

Change-Id: I89c51d25b3adb818ea44a983d0ac681a88790d8c
2020-01-24 23:15:44 +00:00
Martin Stjernholm
335d596384 Get the dex2oat host tool path from module dependency on the binary
module.

This uses the Once cache for GlobalSoongConfig to propagate the dex2oat
path from a module dependency to the singletons (both the one that
writes out dexpreopt_soong.config and the one that creates the
dexpreopted boot images). Unless dexpreopting is disabled altogether
through DisablePreopt in dexpreopt.config, that means:

- We must ensure at least one module registers a dex2oat tool
  dependency and resolves a GlobalSoongConfig using it, or else the
  singletons fail. That means we litter dex2oat dependencies in java
  modules even when they won't get dexpreopted and hence don't really
  need them.

- We still assume there's at least one java_library or android_app in
  the build.

Bug: 145934348
Test: m
  (check that out/soong/dexpreopt_soong.config points to dex2oatd64)
Test: env USE_DEX2OAT_DEBUG=false m
  (check that out/soong/dexpreopt_soong.config points to dex2oat)
Test: env OUT_DIR=out-tools prebuilts/build-tools/build-prebuilts.sh
  on the aosp-build-tools branch
Change-Id: I38317f2d5e5cf6822f87daae25745767c8a3656c
2020-01-24 22:18:42 +00:00
Martin Stjernholm
dae8a80426 Move the Once cache for dexpreopt.GlobalConfig into the dexpreopt
package.

Preparation for a future CL that will need to get the make-written
GlobalConfig from within dexpreopt.

Also rename the Load*Config functions to Parse*Config, since they don't
actually load the config files anymore.

Bug: 145934348
Test: m
Change-Id: I71df11c1e042ca8135d273a7263e9539ea3cd68f
2020-01-24 22:18:42 +00:00
Martin Stjernholm
be9d0d21d1 Separate dexpreopt.GlobalSoongConfig to allow independent caching of
it.

Introduce a Once cache for GlobalSoongConfig to allow it to get binary
tool paths from ordinary module dependencies (coming in a future CL)
that are then reused in singletons.

Bug: 145934348
Test: m
Change-Id: I440a09dba7d337965a196527566b0966a18e3653
2020-01-24 22:09:54 +00:00
Automerger Merge Worker
4efd8ba93c Do not remove RRO resources am: f0f747c949 am: 033eeada51 am: 3643cd99e7
Change-Id: I64254d6a94d49311da61022bc5a744ac26632bbf
2020-01-24 21:36:19 +00:00
Colin Cross
8b8bec3b3a Create a highmem pool and put metalava into it
Create a highmem pool based on the total RAM and the number of CPUs,
with an override via the NINJA_HIGHMEM_NUM_JOBS variable.  Put
metalava into the highmem pool.

Ninja does not support nested pools, and when goma or RBE is enabled
the maximum ninja parallelism is set very high with local jobs in a
local pool.  When both the local pool and highmem pool are enabled,
the total number of local jobs will be as high as the sum of the sizes
of the two pools.  Keep the highmem pool limited to 1/16th of the
local pool when remote builds are enabled to try to minimize the
effect while still limiting highmem jobs.

Fixes: 142644983
Test: m nothing, examine pools
Test: m USE_GOMA=true nothing, examine pools
Change-Id: Id79f11f44948992960ac34ecf831dacbe21bd332
2020-01-24 11:44:23 -08:00
Jaewoong Jung
f0f747c949 Do not remove RRO resources
Resource configs should not be deduped when building RROs since it
would be impossible to override some resource configs with the same
value as the default config. Also, aapt2 removes resources that do not
have default configurations. If an overlay attempts to overlay a
non-default configuration without overlaying the default, the resource
will be removed and the value will not be overlaid at all.

Bug: 146227008
Fixes: 119811120
Test: app_test.go
Change-Id: I834a58b18d1e74a0f6b3de3d0523009788787e42
2020-01-24 10:35:52 -08:00
Automerger Merge Worker
1ae81e980a Merge "Add runtime_resource_overlay." am: 84f71af41c am: 51e926c45d am: 8f84cbc441
Change-Id: Ia827ca892800111c8530d617c2275f0b8ba62776
2020-01-24 01:01:36 +00:00
Treehugger Robot
84f71af41c Merge "Add runtime_resource_overlay." 2020-01-24 00:23:42 +00:00
Jaewoong Jung
9befb0c326 Add runtime_resource_overlay.
Fixes: 119811120
Test: app_test.go
Test: Converted and built IconPackFilledSystemUIOverlay
Change-Id: I71841148c25f820ba829f751a201d2c771c8bd20
2020-01-23 14:24:41 -08:00
Automerger Merge Worker
4acb8f82c8 Merge "For JIT-zygote config, add "apex" boot image files to the ART apex." am: c18235cb86 am: 4504c82639 am: e663326c09
Change-Id: Ifeef80c0aef719076ec869423906228b4ced26f3
2020-01-23 12:32:27 +00:00
Ulya Trafimovich
7eebb4f4e8 For JIT-zygote config, add "apex" boot image files to the ART apex.
JIT-zygote boot image was split into primary and framework extension
in CL I5493e575ebf90bad1d5ad2850004d54590bbc079, but that CL forgot to
add JIT-zygote boot image files to the ART apex. Add them now.

Test: Steps 1-3:

  1. Temporarily enable Jit zygote in the product device config (in
    this case device/google/muskie/aosp_walleye.mk):

    +# System server should not contain compiled code.
    +PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := verify
    +
    +# Use the apex image for preopting.
    +DEXPREOPT_USE_APEX_IMAGE := true
    +
    +# Have the runtime pick up the apex image.
    +PRODUCT_PROPERTY_OVERRIDES += \
    +    dalvik.vm.boot-image=/apex/com.android.art/javalib/apex.art:/system/framework/apex-framework.art

  2. Build and flash:
    $ lunch aosp_walleye-userdebug && m \
    && adb reboot bootloader && fastboot flashall -w

  3. Ensure that apex.art and apex-framework.art are mapped in the
    JIT-zygote address space:

    $ adb shell cat /proc/`adb shell ps | grep zygote64 | awk {'print $2'}`/maps | grep apex.art
    6ffde000-70102000 rw-p 00000000 00:00 0                                  [anon:dalvik-/apex/com.android.art/javalib/apex.art]
    701e5000-70262000 rw-p 00000000 00:00 0                                  [anon:dalvik-/apex/com.android.art/javalib/apex.art]
    72715cf000-72715d4000 r--p 000ba000 07:98 93                             /apex/com.android.art/javalib/arm64/apex.art

    $ adb shell cat /proc/`adb shell ps | grep zygote64 | awk {'print $2'}`/maps | grep apex-framework.art
    7084b000-70cc2000 rw-p 00000000 00:00 0                                  [anon:dalvik-/system/framework/apex-framework.art]
    70fd8000-71109000 rw-p 00000000 00:00 0                                  [anon:dalvik-/system/framework/apex-framework.art]
    7271517000-7271526000 r--p 00295000 fc:00 1268                           /system/framework/arm64/apex-framework.art

Change-Id: I985e15de9f38f345ba3e99451c6d9b8e2cb5d698
2020-01-22 15:27:08 +00:00
Automerger Merge Worker
ed9176a259 Merge "Remove unused java_sdk_library_import properties" am: 0c9c0f045f am: 07e5b368c7 am: 1bb242bb7a
Change-Id: Ie82fa67604ef2cd46d28411a4b9c1db47a6bad74
2020-01-22 06:42:15 +00:00
Treehugger Robot
0c9c0f045f Merge "Remove unused java_sdk_library_import properties" 2020-01-22 06:03:25 +00:00
Paul Duffin
29f5576357 Remove unused java_sdk_library_import properties
The properties are just passed through to the java_import module that
it creates to import the stubs so could be used if set. However, none
of the current usages of java_sdk_library_import actually set them and
it is not clear why the following would ever be set on
java_sdk_library_import:
* installable
* exclude_files
* exclude_dirs

The above properties look as though they were simply copied from the
ImportProperties struct.

The libs property is also unused but it seems as though it should be
used to improve compatibility with the source module. e.g.
the source module for android.test.runner has android.test.base and
android.test.mock in its libs. However, the prebuilt version of it
does not.

Bug: 148080325
Test: m nothing
Change-Id: I710e3962b2e34b2b0cc81685d07d4948cef4e6ad
2020-01-21 18:37:58 +00:00
Automerger Merge Worker
1660ac1fb6 Merge "Revert "Allow codename.fingerprint format for minSdkVersion"" am: 070d69c74c am: 42a16b7d69 am: 7245755399
Change-Id: Ifcea8861733463b92a46de6ca08b2d6a8ec0a090
2020-01-21 14:51:42 +00:00
Pete Gillin
230e241f58 Revert "Allow codename.fingerprint format for minSdkVersion"
This reverts commit 014a85712d.

Reason for revert: Caused vendor/google/build/build_mainline_modules.sh to fail with `Error: minSdkVersion (10000) is greater than maxSdkVersion (30)`.

Bug: 130541924
Change-Id: Ifa233bf40a674481d21b61ee816c5fdde8201080
2020-01-21 13:44:50 +00:00
Automerger Merge Worker
52337edeb4 Merge "Allow codename.fingerprint format for minSdkVersion" am: 1cc755ac9f am: da726a802c am: c7caac1032
Change-Id: I9b6ee2bf0c0328bf496affd960fe67ef0b0fe30d
2020-01-21 02:33:59 +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
Baligh Uddin
014a85712d Allow codename.fingerprint format for minSdkVersion
Use codename.fingerprint format for minSdkVersion if it is unset
in the manifest and
UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true.

Using a utility function in sdk.go to check whether to apply
api.fingerprint.

BUG: 130541924
Change-Id: I748a25c419033bf54b63171d334644fcd0ecc78f
2020-01-20 07:46:12 -08:00
Automerger Merge Worker
e6d1cb1f29 Merge "Overwrite test-file-name in test config." am: a929cd52ce am: b3dd640c9f am: 4dddde24ae
Change-Id: I3ed6f25ded54a962ea0650285e0522206cb4864b
2020-01-17 22:29:32 +00:00
Jaewoong Jung
a929cd52ce Merge "Overwrite test-file-name in test config." 2020-01-17 19:07:12 +00:00
Jaewoong Jung
3998234d8c Overwrite test-file-name in test config.
If the install apk name is different than the module name, use
test_config_fixer to update the test-file-name value in the config.

Test: app_test.go
Fixes: 147375216
Change-Id: I2141eeebbb3552995400b45634712306673fd812
2020-01-17 06:08:12 -08:00
Anton Hansson
a8b44b6ecb Merge "Add framework-sdkextensions to jars to instrument" 2020-01-17 13:14:51 +00:00
Anton Hansson
91133e6e44 Add framework-sdkextensions to jars to instrument
Required to get code coverage.

Bug: 143937446
Test: verify LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR is set
      for framework-sdkextensions
Change-Id: I2cdb8ce60939a91f8473c2ddd2a8ff198cd7c92e
Merged-In: I2cdb8ce60939a91f8473c2ddd2a8ff198cd7c92e
(cherry picked from commit 9492b09dae)
2020-01-17 09:57:52 +00:00
Anton Hansson
9492b09dae Add framework-sdkextensions to jars to instrument
Required to get code coverage.

Bug: 143937446
Test: verify LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR is set
      for framework-sdkextensions
Change-Id: I2cdb8ce60939a91f8473c2ddd2a8ff198cd7c92e
2020-01-17 09:56:37 +00:00
Jaewoong Jung
6431ca7a3a Add rules to handle asset resources.
AAPT2 ignores assets in overlay resource inputs, so separate rules are
required to extract and merge assets from dependencies.

Test: app_test.go
Test: Added assets to Settings-core for testing
Test: Confirmed Settings.apk contains them with this change.
Fixes: 146655310
Change-Id: Iab8bc61b719541dae64f0e3502bc9cb45a353687
2020-01-16 12:19:49 -08:00
Automerger Merge Worker
4c167ae85d Merge "Save compilation units in protobuf format." am: 1be2d48005 am: e0703cdd88 am: 0a5b3ff2b7
Change-Id: I1d9d4c999b72443c36f992050987962a55cb4056
2020-01-16 19:27:17 +00:00
Treehugger Robot
1be2d48005 Merge "Save compilation units in protobuf format." 2020-01-16 18:55:26 +00:00
Automerger Merge Worker
d84989724b Merge changes I0668ff5a,Iff2d7063,I6f8b1e2d,I126db49d,Ic6582260 am: a35294889f am: 273045701d am: 2e84d4d4ea
Change-Id: I169c252ec78ad9846b86673bcfbc3eda08059552
2020-01-16 02:33:21 +00:00
Automerger Merge Worker
b0f501acad Merge "Add basic test for java_system_modules" am: 0b3a5781a9 am: d3a2e1e36e am: da72ba68cc
Change-Id: I4b42a9a83adfef1e392b5b9cae2fc23e4b1dbf9c
2020-01-16 02:12:27 +00:00
Treehugger Robot
a35294889f Merge changes I0668ff5a,Iff2d7063,I6f8b1e2d,I126db49d,Ic6582260
* changes:
  Exclude source->prebuilt deps from visibility enforcement
  Dedup package build components registration
  Support registering hard coded pre arch mutators
  Added java_system_modules_import
  Document java_system_modules
2020-01-16 02:09:36 +00:00
Treehugger Robot
0b3a5781a9 Merge "Add basic test for java_system_modules" 2020-01-16 02:03:44 +00:00
Automerger Merge Worker
cd3f58cf76 Merge "Keep signatures of presigned prebuilt test apps." am: 275eb69d0a am: fc81db1149 am: b05bf4c82e
Change-Id: I0537ff7d08e9ee8e79287dca5d60e30aa8b2e4f7
2020-01-15 23:43:24 +00:00
Jaewoong Jung
275eb69d0a Merge "Keep signatures of presigned prebuilt test apps." 2020-01-15 23:17:02 +00:00
Sasha Smundak
6c2d4f91f8 Save compilation units in protobuf format.
Bug: 146224091
Test: manual
Change-Id: I7a856bab13f54c78efa0061421c3fcb9341bc6e7
2020-01-15 12:40:03 -08:00
Jaewoong Jung
7c5bd835d0 Keep signatures of presigned prebuilt test apps.
Skip the JNI uncompress step for presigned prebuilt test apps. They
don't need it, and they can invalidate the signature. Also, fix the
install partition of prebuilt test apps.

Fixes: 143472191
Test: app_test.go
Test: Converted CtsShimPrivUpgradePrebuilt to bp and checked the
final output apk signature.

Change-Id: Ied7d3576b5db4de40a9ca9e388336229d07212f5
2020-01-15 14:33:32 +00:00
Paul Duffin
a7b9f42587 Add basic test for java_system_modules
Bug: 142940300
Test: m nothing
Change-Id: I8855df0832f93e40d31e457191590458c274bb5c
2020-01-15 11:17:57 +00:00
Paul Duffin
90169baf0e Added java_system_modules_import
A prebuilt version of java_system_modules. It does not import the
generated system module, it generates the system module from imported
java libraries in the same way that java_system_modules does. It just
acts as a prebuilt, i.e. can have the same base name as another module
type and the one to use is selected at runtime.

Bug: 142940300
Test: m nothing
Change-Id: I126db49d18294fcd6e2b7ad0237f83e9c2fdef7a
2020-01-15 11:17:57 +00:00
Paul Duffin
cded5ecfc3 Document java_system_modules
Bug: 142940300
Test: m nothing
Change-Id: Ic658226088615dbeeef15f17dbb095a968e0742d
2020-01-15 11:17:57 +00:00
Automerger Merge Worker
901c8e6287 Merge "Reland^2 "m <apex_name>-deps-info prints the internal/external deps of the APEX"" am: 814bebb8ea am: 8d050e8e6e am: a7c65b295e
Change-Id: Ib50d00c8cf7f1c6cefd17d9dfa51a4b45835236f
2020-01-15 06:44:21 +00:00
Treehugger Robot
814bebb8ea Merge "Reland^2 "m <apex_name>-deps-info prints the internal/external deps of the APEX"" 2020-01-15 06:12:45 +00:00
Automerger Merge Worker
5c44036fc5 Merge "Allow sdk and core modules to use sysprop_library" am: a46c2b1994 am: ed000d7832 am: 4ad8d0d859
Change-Id: I001549e1fed24999f435e950c8b523dae01a6ed8
2020-01-15 01:26:17 +00:00
Inseob Kim
a46c2b1994 Merge "Allow sdk and core modules to use sysprop_library" 2020-01-15 00:32:00 +00:00
Automerger Merge Worker
d1b3d7df93 Merge "Make android_test_helper_app support apex_available" am: ee76fba905 am: 305b6a7e4e am: 2788a6061e
Change-Id: I93e281df1ceff2d3d3f8d26b00ca038bdf8fa503
2020-01-14 13:25:14 +00:00
Anton Hansson
ee76fba905 Merge "Make android_test_helper_app support apex_available" 2020-01-14 12:59:17 +00:00
Jiyong Park
83dc74b770 Reland^2 "m <apex_name>-deps-info prints the internal/external deps of the APEX"
This reverts commit 7cb4d378e7.

Test: m
Test: ALLOW_MISSING_DEPENDENCIES=true DIST_DIR=out/dist ./art/tools/dist_linux_bionic.sh -j80 com.android.art.host
(in the master-art-host branch)

Change-Id: I9beca73aafdf42f03bfa19cf1634b2641dac417b
2020-01-14 18:40:56 +09:00
Automerger Merge Worker
17f7140e2f Merge "Revert "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX"""" am: a7503367cf am: 39ed342b9b am: 9651bdef91
Change-Id: I1b22374e4a5698f15576c6daf474e6797318feb9
2020-01-14 09:30:56 +00:00
Jiyong Park
a7503367cf Merge "Revert "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX"""" 2020-01-14 08:58:17 +00:00
Jiyong Park
7cb4d378e7 Revert "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX"""
This reverts commit 956305c61c.

Reason for revert: broke master-art-host branch
Exempt-From-Owner-Approval: reverting a bad change

Change-Id: Id7faed4ee85328c7c65847a3543ea9e67a3d50b3
2020-01-14 08:58:02 +00:00
Inseob Kim
c52395135f Allow sdk and core modules to use sysprop_library
This allows javaSdk and javaCore modules to link against Public stub of
Platform owned sysprop_library.

Bug: 141246285
Test: m nothing
Change-Id: Ie11c43cc72ddd0ee13e4163955775c13eb9dbe92
2020-01-14 15:58:59 +09:00
Automerger Merge Worker
57414e4ad7 Merge "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX""" am: 17c51a4ff6 am: acf9d43674 am: 500fddf35c
Change-Id: I0a93edcbffafaa031959f520866041059e1dd760
2020-01-14 03:02:44 +00:00
Treehugger Robot
17c51a4ff6 Merge "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX""" 2020-01-14 02:40:42 +00:00
Automerger Merge Worker
acc79daa46 Merge "Use boot image extension in the JIT-zygote experiment." am: 4d9c97bd77 am: 856f6d458a am: 450072eefa
Change-Id: If09ec246abc01b803ff54b331fa301819b519297
2020-01-13 11:35:32 +00:00
Automerger Merge Worker
a6cacb665b Merge "Do not add jacocoagent to framework libraries in static coverage builds." am: 289bd28f17 am: 10b887a354 am: c15caef962
Change-Id: I236faf7d3ba446d787303d1c9b9a2ecea2697e88
2020-01-13 10:57:41 +00:00
Ulyana Trafimovich
4d9c97bd77 Merge "Use boot image extension in the JIT-zygote experiment." 2020-01-13 10:38:01 +00:00
Ulyana Trafimovich
289bd28f17 Merge "Do not add jacocoagent to framework libraries in static coverage builds." 2020-01-13 10:25:16 +00:00
Automerger Merge Worker
2aca61f31b Merge "Don't dexpreopt APEX variant modules" am: 72d009e1ec am: 47d80cdf79 am: 77c734043a
Change-Id: I1f72a27f7f5cdd32f862dc0294e08199cf8461c7
2020-01-13 03:45:31 +00:00
Yo Chiang
72d009e1ec Merge "Don't dexpreopt APEX variant modules" 2020-01-13 03:15:50 +00:00
Automerger Merge Worker
889f0a3d41 Merge "Sandbox soong_build by changing to root directory" am: ae7cddd5ad am: 70eefb570a am: 9280bf9474
Change-Id: I7d749bf12f039ca72bd59f4264082043f1f14fde
2020-01-11 07:34:02 +00:00
Treehugger Robot
ae7cddd5ad Merge "Sandbox soong_build by changing to root directory" 2020-01-11 06:00:21 +00:00
Colin Cross
988414c2cf Sandbox soong_build by changing to root directory
This relands I12a0f907753fefd1997ab8b4ea2ac331234093cf along with
a fix to blueprint for absolute paths.

Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.

Change-Id: I24ac485677aa102eec1a2521d16820da6ee1ae77
Fixes: 146437378
Test: m checkbuild
Test: m OUT_DIR=/tmp/out nothing
2020-01-11 01:11:46 +00:00
Automerger Merge Worker
8c02671d51 Merge "Revert "Sandbox soong_build by changing to root directory"" am: e734832d25 am: 408fab4d25 am: f84fe5fbd4
Change-Id: Iac451a70c28566f8413b2495e8ae8a24b80e2a2f
2020-01-10 22:31:07 +00:00
Colin Cross
e734832d25 Merge "Revert "Sandbox soong_build by changing to root directory"" 2020-01-10 22:00:59 +00:00
Colin Cross
13e8cb9b4c Merge "Sandbox soong_build by changing to root directory" am: e35e961aa9 am: 856eff7fde
am: a2040fc892

Change-Id: I31d8b52f57f685bc69aab817d9b4eebcafaf78df
2020-01-10 11:14:39 -08:00
Colin Cross
47e4f9e1e8 Revert "Sandbox soong_build by changing to root directory"
This reverts commit 05c25ccb4a.

Reason for revert: broke absolute OUT_DIR
Bug: 146437378

Change-Id: I523ed79d40e1c1ef040212ba794a7a084abea75d
2020-01-10 18:51:04 +00:00
Colin Cross
e35e961aa9 Merge "Sandbox soong_build by changing to root directory" 2020-01-10 17:35:22 +00:00
Ulya Trafimovich
57547452cf Use boot image extension in the JIT-zygote experiment.
Test: temporarily enable JIT-zygote configuration, build, boot the
  device and ensure that the JIT-zygote specific boot image
  apex-framework.art is mapped in the zygote address space:

  1. enable Jit zygote in the product device config (in my case
    device/google/muskie/aosp_walleye.mk):

    +# System server should not contain compiled code.
    +PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := verify
    +
    +# Use the apex image for preopting.
    +DEXPREOPT_USE_APEX_IMAGE := true
    +
    +# Have the runtime pick up the apex image.
    +PRODUCT_PROPERTY_OVERRIDES += \
    +    dalvik.vm.boot-image=/apex/com.android.art/javalib/apex.art:/system/framework/apex-framework.art

  2. lunch aosp_walleye-userdebug \
    && m \
    && adb reboot bootloader \
    && fastboot flashall -w

  3. adb shell cat /proc/`adb shell ps | grep zygote64 | awk {'print $2'}`/maps | grep apex-framework.art
  6fe44000-7025c000 rw-p 00000000 fc:02 1179718                            /data/dalvik-cache/arm64/apex@com.android.art@javalib@apex-framework.art
  70571000-70696000 rw-p 0072d000 fc:02 1179718                            /data/dalvik-cache/arm64/apex@com.android.art@javalib@apex-framework.art
  75a339f000-75a33ac000 r--p 00852000 fc:02 1179718                        /data/dalvik-cache/arm64/apex@com.android.art@javalib@apex-framework.art

Change-Id: I5493e575ebf90bad1d5ad2850004d54590bbc079
2020-01-10 15:29:25 +00:00
Anton Hansson
3d2b6b452a Make android_test_helper_app support apex_available
Needed in order to enforce apex_available is set for
everything that gets added to apexes.

Bug: 147364041
Test: apex_test.go
Change-Id: I083ec35283c4c7b5101d00139416d0734b97bab4
2020-01-10 15:06:01 +00:00
Colin Cross
05c25ccb4a Sandbox soong_build by changing to root directory
Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.

Fixes: 146437378
Test: m checkbuild
Change-Id: I12a0f907753fefd1997ab8b4ea2ac331234093cf
2020-01-09 14:19:46 -08:00
Automerger Merge Worker
169b98074c Merge "Revert^2 "Use boot image extension for framework libraries."" am: a773c39bfc am: 4e1c74edce am: 18114bcee6
Change-Id: I1950b09d526994dff5334d96c9dec645ed7abe2f
2020-01-09 13:49:19 +00:00
Ulyana Trafimovich
a773c39bfc Merge "Revert^2 "Use boot image extension for framework libraries."" 2020-01-09 13:20:36 +00:00
Yo Chiang
dbdf8f9c2e Don't dexpreopt APEX variant modules
Java modules that are APEX variant won't be dexpreopted.

After applying this CL,
- $(ANDROID_PRODUCT_OUT)/apex/com.android.appsearch/javalib/service-appsearch.jar
- $(ANDROID_PRODUCT_OUT)/apex/com.android.cronet/javalib/org.chromium.net.cronet.jar
- $(ANDROID_PRODUCT_OUT)/apex/com.android.os.statsd/javalib/service-statsd.jar
- $(ANDROID_PRODUCT_OUT)/apex/com.android.telephony/app/StkLib/StkLib.apk

above four files are not preopted, thus the dex files aren't uncompressed.

FIle size of JAR/APK is (before / after):
- service-appsearch.jar:        697594 / 273354
- org.chromium.net.cronet.jar:  607206 / 239990
- service-statsd.jar:           90806 / 41857
- StkLib.apk:                   6424332 / 2942719
File size of APEX is (before / after):
- com.android.appsearch.apex:   854851 / 432963
- com.android.cronet.apex:      4982739 / 4618195
- com.android.os.statsd.apex:   322319 / 322319
- com.android.telephony.apex:   6596717 / 3111021

Bug: 146984232
Test: lunch aosp_cf_x86_phone-userdebug; m
Test: Build aosp_cf_x86_phone with and w/o this CL and compare artifacts.
      After applying this CL, javalibs and apps embedded inside APEX
      were not preopted, thus dex file are not uncompressed.

Change-Id: I296173bc29d0df0c4d5cc59e4b070e5c4d3b50d5
2020-01-09 20:08:15 +08:00
Ulya Trafimovich
38dfa0fa18 Do not add jacocoagent to framework libraries in static coverage builds.
Framework libraries need special handling in static coverage builds:
they should not have static dependency on jacoco, otherwise there
would be multiple conflicting definitions of the same jacoco classes
coming from different bootclasspath jars.

This CL does two things:

- Move the code that enables instrumentation of framework libraries
  from AndroidGenerateBuildActions phase to the earlier DepsMutator
  phase. This is necessary because DepsMutator phase already does some
  things that depend on the instrumentation flag.

- Explicitely exclude framework libraries from those libraries
  which have static dependency on jacoco.

This CL does not fix any apparent build problems: prior to it the
framework libraries were not excluded properly, but this was masked by
wrong order of checking / setting instrumentation flag.

Note that static coverage builds without framework coverage fail to
boot, namely this build command:

  $ build/soong/soong_ui.bash --make-mode \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye TARGET_BUILD_VARIANT=userdebug droid \
    EMMA_INSTRUMENT=true \
    EMMA_INSTRUMENT_STATIC=true \
    NATIVE_COVERAGE=true

..causes the following boot-time errors in logcat:

    01-08 12:31:48.670  1252  1252 E System  : java.lang.StackOverflowError: stack size 8192KB
    01-08 12:31:48.670  1252  1252 E System  :      at org.jacoco.agent.rt.internal.Offline.$jacocoInit(Unknown Source:13)
    01-08 12:31:48.670  1252  1252 E System  :      at org.jacoco.agent.rt.internal.Offline.getProbes(Unknown Source:0)

Also note that static coverage with framework coverage failed to build
prior to CL Iaa198b8505aaff36e6685559642ff721637ce55f (dex2oat failed
to create boot image due to missing classes).

Test: non-static coverage without framework coverage boots:
  $ build/soong/soong_ui.bash --make-mode \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye TARGET_BUILD_VARIANT=userdebug droid \
    EMMA_INSTRUMENT=true \
    NATIVE_COVERAGE=true

Test: non-static coverage with framework coverage boots:
  $ build/soong/soong_ui.bash --make-mode \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye TARGET_BUILD_VARIANT=userdebug droid \
    EMMA_INSTRUMENT=true \
    EMMA_INSTRUMENT_FRAMEWORK=true \
    NATIVE_COVERAGE=true

Test: static coverage with framework coverage boots:
  $ build/soong/soong_ui.bash --make-mode \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye TARGET_BUILD_VARIANT=userdebug droid \
    EMMA_INSTRUMENT=true \
    EMMA_INSTRUMENT_FRAMEWORK=true \
    EMMA_INSTRUMENT_STATIC=true \
    NATIVE_COVERAGE=true

Change-Id: I700f979a5d638ce632f5e8b920b9d0adb3c80248
2020-01-09 10:39:13 +00:00
Jiyong Park
956305c61c Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX""
This reverts commit 4513f703f9.

Bug: 1190898
Test: m
Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true NATIVE_COVERAGE=true  m dist

Change-Id: I50fdccabb43e4751694db83ee451d388657257e0
2020-01-09 18:42:27 +09:00
Automerger Merge Worker
322a4362cf Merge "Revert "m <apex_name>-deps-info prints the internal/external deps of the APEX"" am: 8ea6bc4a05 am: 8298e7fd87 am: e66dbf8734
Change-Id: I1c3842f9c40141cad8a23bc436ac6222857773d5
2020-01-09 02:48:12 +00:00
Jiyong Park
8ea6bc4a05 Merge "Revert "m <apex_name>-deps-info prints the internal/external deps of the APEX"" 2020-01-09 02:20:42 +00:00
Jiyong Park
4513f703f9 Revert "m <apex_name>-deps-info prints the internal/external deps of the APEX"
This reverts commit 114ff53f5e.

Reason for revert: broke cf_x86_phone-userdebug_coverage 

Change-Id: I7221fd0b0baee5407a7322240c170aef8e549e4d
2020-01-09 02:05:18 +00:00
Automerger Merge Worker
b31b9ff383 Merge "jacoco correctly gathers info from APK-in-APEX" am: 36746d21a3 am: 5f1e8d6f19 am: ff17b7015a
Change-Id: Ifb118d5bed7bd58fd5b1a21481232feb5a1d1547
2020-01-09 01:17:26 +00:00
Automerger Merge Worker
52d8fd07c4 Merge "m <apex_name>-deps-info prints the internal/external deps of the APEX" am: 573326a8ce am: ef9f93cfac am: 00cdc4a80f
Change-Id: Ie40197044f09140d14262cdf6a17aae1d3c6582e
2020-01-09 01:17:11 +00:00
Treehugger Robot
36746d21a3 Merge "jacoco correctly gathers info from APK-in-APEX" 2020-01-09 00:45:11 +00:00
Treehugger Robot
573326a8ce Merge "m <apex_name>-deps-info prints the internal/external deps of the APEX" 2020-01-09 00:44:13 +00:00
Automerger Merge Worker
1df33fc88a Merge "Define a make variable for merged compat config." am: 62c085d7fe am: 950a589fe4 am: 6e024b5da9
Change-Id: I7d8a14256b5e24fe1073e22cc931834968d2a1ba
2020-01-08 22:56:26 +00:00
Treehugger Robot
62c085d7fe Merge "Define a make variable for merged compat config." 2020-01-08 21:26:23 +00:00
Ulyana Trafimovich
5a4ccd1816 Revert^2 "Use boot image extension for framework libraries."
This reverts commit 3fae7662ee
Reason: re-applying the change after resolving the problem with
coverage builds (in a related CL).

Use boot image extension for framework libraries.
This patch splits the system boot image in two parts:

  - The ART boot image. This is the primary boot image that is
    included in the ART apex and contains dexpreopted Core Libraries.

  - The framwework boot image extension. It depends on the ART boot
    image and contains framework libraries.

The third "apex" boot image (used in the JIT-zygote experiment)
remains unchanged; it is a monolithic primary boot image that
contains both libcore and framework libraries.

Dexpreopting of APKs now uses the framework boot image extension
(which in turn pulls in the ART boot image as a dependency).

Bug: 146462581
Bug: 119800099

Test: aosp_walleye-userdebug boots.

Change-Id: I06c5ac5fca011fa639ed208735462ab32451df3a
2020-01-08 15:56:52 +00:00
Automerger Merge Worker
16875f92b2 Merge "Include jacoco in the ART boot image if EMMA_INSTRUMENT_FRAMEWORK=true." am: 11e1ae025f am: 9425c8c78c am: 34187e47ca
Change-Id: I12d53d0f34d92f1d9e35da80804649788057f478
2020-01-08 11:46:49 +00:00
Automerger Merge Worker
3db11d4c7c Merge "Move generation of the dexpreopt tool paths into Soong." am: 46f60291f3 am: 0233e754e8 am: 3e484c30fb
Change-Id: I6d766184b1d308d9adbc0095228d960a4e37d3d6
2020-01-08 11:46:20 +00:00
Mathew Inwood
653c78a909 Define a make variable for merged compat config.
This allows it to be added to the dist target.

Test: m dist
Change-Id: I1d913577f43a2ba3cb134ed35a7c98be76da2bd1
2020-01-08 11:24:58 +00:00
Ulyana Trafimovich
11e1ae025f Merge "Include jacoco in the ART boot image if EMMA_INSTRUMENT_FRAMEWORK=true." 2020-01-08 10:58:24 +00:00
Martin Stjernholm
46f60291f3 Merge "Move generation of the dexpreopt tool paths into Soong." 2020-01-08 10:40:28 +00:00
Jiyong Park
618922e510 jacoco correctly gathers info from APK-in-APEX
This change fixes a bug that jacoco-report-classes-all.jar does not
include info for APK-in-APEX such as the MediaProvider apk in
com.android.mediaprovider APEX.

Firstly, LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR is correctly set also for
the APKs included in APEXes. Secondly, the Make modules for the embedded
APKs are now built with soong_app_prebuilt.mk to correctly import the
jacoco file into the Make world.

Bug: 147296855
Test: execute the following command in internal master.
$ choosecombo cf_x86_phone userdebug
$ NINJA_ARGS="-t path out/target/product/vsoc_x86/jacoco-report-classes-all.jar out/target/common/obj/ETC/MediaProvider.com.android.mediaprovider_intermediates/jacoco-report-classes.jar" EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m
The result shows that there is a path as follows:
out/target/product/vsoc_x86/jacoco-report-classes-all.jar
out/target/product/vsoc_x86/apex/com.android.mediaprovider/priv-app/MediaProvider/MediaProvider.apk
out/target/product/vsoc_x86/obj/ETC/MediaProvider.com.android.mediaprovider_intermediates/package.apk
out/target/common/obj/ETC/MediaProvider.com.android.mediaprovider_intermediates/jacoco-report-classes.jar

Change-Id: I52d11534a34eb35219bfafca4453e75a1b701c0e
2020-01-08 14:49:31 +09:00
Automerger Merge Worker
2a52cf8ae6 Delay invalid sdk_version error for AllowMissingDependencies am: 07c8856904 am: 400665159a am: 9b47a016ab
Change-Id: Ia1242d255232ef339bee8425f556b927cfd1fb49
2020-01-07 20:48:52 +00:00
Colin Cross
07c8856904 Delay invalid sdk_version error for AllowMissingDependencies
Unbundled builds set AllowMissingDependencies and attempt to use
prebuilts for some jars.  Delay the errors for missing jars for
modules with invalid sdk_version values in unbundled builds so
that they only block the build if those modules are built.

Also fix some error messages to show the original sdk_version
value.

Bug: 146513037
Test: m TARGET_BUILD_APPS=Camera2
Change-Id: I1812ef6dc80895f7a2162a8bdbf2c5067755e9a0
2020-01-07 20:14:14 +00:00
Martin Stjernholm
c52aaf11d0 Move generation of the dexpreopt tool paths into Soong.
The dexpreopt global config is now split into the part that is generated
from make (in build/make/core/dex_preopt_config.mk) and the part that is
generated from Soong. Since the goal is to generate the dex2oat path from
Soong dependencies, the old GlobalConfig.Tools struct is simply repurposed
for the Soong generated config, although the intention is to allow more
settings to migrate from make to Soong, and hence from GlobalConfig to
GlobalSoongConfig.

Since the new dexpreopt_soong.config is written from a Soong-created ninja
rule, it doesn't need to be rewritten to out/soong/<device>/ like the old
make-created config file.

Test: m
Test: env USE_DEX2OAT_DEBUG=false m
  (check that out/soong/dexpreopt_soong.config points to dex2oat instead of dex2oatd)
Bug: 145934348

Change-Id: Ifd45c4a08e2ec55b86f4a93f0d85bd39cf2cf189
2020-01-07 14:15:42 +00:00
Automerger Merge Worker
59dbe24228 Merge "Respect JIT-zygote config when generating boot image location." am: 99d522b5df am: 540d35006f am: 09ecf51657
Change-Id: Ib4eb9273a6eed38c55873ff8758658677b9510eb
2020-01-07 11:30:51 +00:00
Ulyana Trafimovich
99d522b5df Merge "Respect JIT-zygote config when generating boot image location." 2020-01-07 10:48:45 +00:00
Automerger Merge Worker
1ea5d14650 Merge "Pass auto_gen_config setting in Android.bp to makefile" am: 13f30ae38c am: 75b879c30b am: 458321b216
Change-Id: Iecd57fcaac4b7b3d70c99de73037ff4c5aea5cc6
2020-01-07 08:35:45 +00:00
Dan Shi
13f30ae38c Merge "Pass auto_gen_config setting in Android.bp to makefile" 2020-01-07 06:23:04 +00:00
Automerger Merge Worker
44d61e2d28 Merge "Remove unused system_modules" am: 9a3f61cd43 am: 40a301a80e am: 7f560b1cca
Change-Id: I119d3debb1740b29025df44a28993f8a4d6a48d1
2020-01-07 04:30:46 +00:00
Treehugger Robot
9a3f61cd43 Merge "Remove unused system_modules" 2020-01-07 03:51:09 +00:00
Dan Shi
2468d015fe Pass auto_gen_config setting in Android.bp to makefile
Bug: none
Test: local test with fuzzy_fastboot
Change-Id: I2c62f6fb58737538ef9e1e9fcbe63e03dfa7ee91
2020-01-06 16:21:10 -08:00
Automerger Merge Worker
f0c7bfa196 Merge "Add EarlyModuleContext for LoadHookContext" am: 7d20c4407c am: ea83ab5ecc am: b089fba01f
Change-Id: I12a8830989cfec3adf7bc6d8bd3af558992d284c
2020-01-06 22:27:19 +00:00
Treehugger Robot
7d20c4407c Merge "Add EarlyModuleContext for LoadHookContext" 2020-01-06 21:43:03 +00:00
Automerger Merge Worker
a4e55e6990 Merge "Verify APIs are compatible with last released api by default" am: a1af29ae4d am: 6307388229 am: d2418eee24
Change-Id: Ibba32661aa55080216c9d5d3d421979e7196cbcb
2020-01-06 17:15:29 +00:00
Automerger Merge Worker
c5e0673f96 Merge "Singleton build rule for merged compat config." am: ac65c69913 am: a8da239ade am: 31263c5079
Change-Id: If9c2cb64d468aea2532b754ccbe013b724856e84
2020-01-06 17:15:14 +00:00
Ulya Trafimovich
4456188939 Include jacoco in the ART boot image if EMMA_INSTRUMENT_FRAMEWORK=true.
Test: aosp_walleye-userdebug boots.

Test: Coverage build boots:
  $ lunch aosp_walleye-userdebug
  $ cd $ANDROID_BUILD_TOP
  $ build/soong/soong_ui.bash --make-mode droid \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye \
    TARGET_BUILD_VARIANT=userdebug \
    EMMA_INSTRUMENT=true \
    NATIVE_COVERAGE=true
  $ adb reboot bootloader && fastboot flashall -w

Test: Coverage build with framework coverage boots:
  $ lunch aosp_walleye-userdebug
  $ cd $ANDROID_BUILD_TOP
  $ build/soong/soong_ui.bash --make-mode droid \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye \
    TARGET_BUILD_VARIANT=userdebug \
    EMMA_INSTRUMENT=true \
    EMMA_INSTRUMENT_FRAMEWORK=true \
    NATIVE_COVERAGE=true
  $ adb reboot bootloader && fastboot flashall -w

Test: Static coverage build with framework coverage boots:
  $ lunch aosp_walleye-userdebug
  $ cd $ANDROID_BUILD_TOP
  $ build/soong/soong_ui.bash --make-mode droid \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye \
    TARGET_BUILD_VARIANT=userdebug \
    EMMA_INSTRUMENT=true \
    EMMA_INSTRUMENT_FRAMEWORK=true \
    EMMA_INSTRUMENT_STATIC=true \
    NATIVE_COVERAGE=true
  $ adb reboot bootloader && fastboot flashall -w

Change-Id: Iaa198b8505aaff36e6685559642ff721637ce55f
2020-01-06 16:52:56 +00:00
Treehugger Robot
a1af29ae4d Merge "Verify APIs are compatible with last released api by default" 2020-01-06 16:43:29 +00:00
Mathew Inwood
ac65c69913 Merge "Singleton build rule for merged compat config." 2020-01-06 16:32:54 +00:00
Ulya Trafimovich
3391a1e85f Respect JIT-zygote config when generating boot image location.
Earlier CL Ida40dfae8c83bf7c2e737d5c7ea418e1197ad826 introduced
Soong-generated Make variable 'DEXPREOPT_IMAGE_LOCATIONS'. That CL was
erroneous in that it did not take JIT-zygote config into account and
generated identical location for "boot" and "apex" boot images.

This caused build breakages, because in case of JIT-zygote config the
two variables 'DexPreoptImages' and 'DexPreoptImageLocations' in the
module's dexpreopt.config were out of sync: 'DexPreoptImages' was
for the "apex" image, and 'DexPreoptImageLocations' was for the "boot"
image.

CL I9a91fc48e54d7d43abec2cb2b5a11e3581db380b introduced a workaround
for this problem: incorrect 'DexPreoptImageLocations' from the module
dexpreopt.config was ignored, and instead boot image location was
manually reconstructed from 'DexPreoptImages'. This workaround would
not work when we start using boot image extension and location will
become more complex.

This CL fixes the way 'DexPreoptImageLocations' is generated by
spliting the 'DEXPREOPT_IMAGE_LOCATIONS' variable in two variables
depending on the boot image flavour "boot" of "apex". This is
aligned with the way other similar variables are generated.

Test: aosp_walleye-userdebug boots.
Test: walleye_jitzygote-userdebug builds
  (on git_rvc-release branch with this CL cherry-picked).

Change-Id: I93415227564522bce4250d281d561e708a022101
2020-01-06 16:01:55 +00:00
Paul Duffin
a465e435c2 Verify APIs are compatible with last released api by default
Previously, the checking of the current API for compatibility with the
previously released API was only enabled for a white list of targets
which included api-stubs-docs and system-api-stubs-docs. This change
replaces the white list of targets to check with a black list of targets
not to check so that the checks are performed by default.

The black list currently consists only of android.car-system-stubs-docs.

Bug: 134485888
Bug: 123222452
Test: m checkapi with an incompatible conscrypt API
Change-Id: I3b48b6cfb61e1f39d74fc48d9d2c0415f886d959
2020-01-06 15:19:02 +00:00
Automerger Merge Worker
24462b5cb6 Merge "java_sdk_library: Ensure that stubs library is not installed" am: 17cf0ab3bc am: 786d41db85 am: 87890b22b6
Change-Id: Ia60bdc9289704fe8f0bdc44a07bf70e52556bd71
2020-01-05 19:28:53 +00:00
Automerger Merge Worker
872780a494 Merge "java_sdk_library: Allow creation of impl shared library to be disabled" am: bcb6041b2a am: 603cad0d9f am: 09d2a80df9
Change-Id: I778701a963d613424b159226740edef56bbb145c
2020-01-05 18:55:38 +00:00
Automerger Merge Worker
da8b9ddd9b Merge "java_sdk_library: Allow api dir to be specified" am: 7e96dac325 am: 7da6648137 am: 21a48d2161
Change-Id: I97f4d144a54d307407ef3e4827b3be99333a9857
2020-01-05 17:30:12 +00:00
Colin Cross
1184b647d5 Add EarlyModuleContext for LoadHookContext
Make LoadHookContext embed a new EarlyModuleContext instead of
BaseModuleContext to reduce its API surface in preparation for
moving it to run during parsing instead of mutators.

Test: m checkbuild
Change-Id: I1cd3ff3b636e7e24991a9184d7521903473e505a
2020-01-04 08:40:55 -08:00
Automerger Merge Worker
1a73535558 Merge "java_sdk_library: Remove requirement for api_packages to be specified" am: 36809d52ba am: 160434a8d7 am: 710c7d3d0e
Change-Id: Id0877d4b59e12bd1155f9b0abbf06eb9d3204d3a
2020-01-03 14:00:55 +00:00
Automerger Merge Worker
ed94519ff1 Merge "java_sdk_library: support system_modules properly" am: 14544da609 am: c217e75762 am: b841cdf23f
Change-Id: Ic641f1f8ac2e27cbeab948707d5ef4d7ceb4a5e6
2020-01-03 14:00:44 +00:00
Jiyong Park
2fbf47f0c2 Remove unused system_modules
With
https://android-review.googlesource.com/c/platform/build/soong/+/1145829,
android_*stubs_current_system_modules are no longer used. Thus removing.

Bug: 142896162
Test: m checkbuild
Change-Id: Icb8ea48f9bdb73f780cd9bdacf4c111ca7b7cd9e
2020-01-03 14:16:22 +09:00
Automerger Merge Worker
ce1a0af7b9 Merge "java_sdk_library: Avoid generating system and test .txt files" am: 3afbc923dc am: f91ee9fb1a am: 3f8bcc2f82
Change-Id: I4b334fcb12b66905a9506cace767a8389560206e
2020-01-03 01:34:18 +00:00
Automerger Merge Worker
b0844b82e5 java_sdk_library: Rename createDocs to createStubsSources am: c4cea76c0d am: e616c37c88 am: 166c249881
Change-Id: I795e75484871ce45ceefe5ba6394f287ed4712ec
2020-01-02 16:43:23 +00:00
Automerger Merge Worker
bf54060404 java_sdk_library: Remove unused stubsLibraryDependencyTag am: 03fbd786b5 am: a17393c17c am: 1f0fe5c78f
Change-Id: Ib03943188161cb31428242f631de1ed3cfa5dc91
2020-01-02 16:43:20 +00:00
Paul Duffin
367ab91d60 java_sdk_library: Ensure that stubs library is not installed
Bug: 145998881
Test: m checkbuild
Change-Id: Ieabe563b8894f223ba66bf8ec7bf8bf1d9ca49b1
2020-01-02 15:38:42 +00:00
Paul Duffin
43db9bee5e java_sdk_library: Allow creation of impl shared library to be disabled
Most modules will be providing their implementations via APEX and so do
not need to create an implementation shared library as part of this.

Adds an api_only property which will:
* Prevent the creation of the implementation library.
* Prevent the creation of the .xml file needed at runtime to make
  the shared library available.
* Prevent the library being added to the list of java sdk libraries
  used by make to handle installation.

Bug: 145998881
Test: m checkbuild
Change-Id: Ida5e46a81aa5b0a041882d90d5f362ec79fdddb2
2020-01-02 15:38:42 +00:00
Paul Duffin
749f98fb64 java_sdk_library: Allow api dir to be specified
For modules that provide API surfaces in addition to the standard
current, test and system it is useful to be able to specify the
directory containing the api's .txt files to make it easy to create
multiple API surfaces from within the same Android.bp file. e.g. This
is useful for conscrypt, icu and libcore to manage their intra core
and core platform APIs.

Bug: 145998881
Test: m checkbuild
Change-Id: I753631d9b6993fbf30019fef5c052a9429e519de
2020-01-02 15:38:42 +00:00
Paul Duffin
7a586d3a59 java_sdk_library: Remove requirement for api_packages to be specified
If api_packages is not set then will try and generate stubs from all
the source packages.

Bug: 145998881
Test: m checkbuild
Change-Id: Ic9d7f82bb34c4b960a2f17614d7f64ddd13ad8b0
2020-01-02 15:38:39 +00:00
Paul Duffin
12ceb4699b java_sdk_library: support system_modules properly
Bug: 145998881
Test: m checkbuild
Change-Id: Ia7663dca4b0ce84fe6dafca27e1aeb1bcda86221
2020-01-02 15:38:20 +00:00
Paul Duffin
37e0b77e3b java_sdk_library: Avoid generating system and test .txt files
If the library does not provide system and test APIs then do not
generate/require corresponding .txt files.

Bug: 145998881
Test: m checkbuild
Change-Id: I21cfdb0b63fd575e8c8c63ea2b436e0c4aa8f3fc
2020-01-02 15:38:18 +00:00
Automerger Merge Worker
07cdf35920 Merge "java_sdk_library: construct droidstubs args as []string" am: 0a83b7961c am: bc1aa20ebb am: cd8b9a20f2
Change-Id: Ia8f52cdfb94aa3729ecb97ed730107f7cd4f4d34
2020-01-02 15:08:05 +00:00
Paul Duffin
c4cea76c0d java_sdk_library: Rename createDocs to createStubsSources
The createDocs(...) method was obviously named because it created a
droiddocs target that generated the stubs source but it now creates a
droidstubs target so the name was misleading.

Bug: 145998881
Test: m checkbuild
Change-Id: I7419b0a01ee87ecb2b396e4817e5e88a88a8b7b6
2020-01-02 14:56:00 +00:00
Paul Duffin
03fbd786b5 java_sdk_library: Remove unused stubsLibraryDependencyTag
Bug: 145998881
Test: m checkbuild
Change-Id: I3ce0fa498c261a9a1f0382f6d548bb070a656358
2020-01-02 14:55:27 +00:00
Treehugger Robot
0a83b7961c Merge "java_sdk_library: construct droidstubs args as []string" 2020-01-02 14:34:06 +00:00
Automerger Merge Worker
2828cebddc Add support for java_test in sdk am: 1b82e6a108 am: c520a1723c am: 38c5a8c468
Change-Id: I758b0d1b8b70bede7a726960c53babcc2071334c
2020-01-02 11:31:54 +00:00
Jiyong Park
114ff53f5e m <apex_name>-deps-info prints the internal/external deps of the APEX
We need to have a way to see the list of modules that directly or
indirectly contribute to an APEX. People find it difficult to determine
whether a module is included in which APEXes because APEX tracks
indirect dependencies as well as direct dependencies. Therefore, just
looking at Android.bp for the APEX itself doesn't give the answer.

This change adds a new make target <apex_name>-deps-info, which
generates out/soong/<apex_name>-deps-info.txt file that shows the
internal and external dependencies of the said APEX.
Here, internal means the dependencies are actually part of the
APEX, while external means the dependencies are still external to the
APEX.

Bug: 146323213
Test: m (apex_test amended)
Change-Id: I33d1ccf5d1ca335d71cd6ced0f5f66b8c3886d13
2020-01-02 09:41:30 +09:00
Automerger Merge Worker
585928fc5d Restrict SdkMemberTypes that can be used with sdk/sdk_snapshot am: e602918294 am: b39c226ff7 am: 5f7e9a061b
Change-Id: I1b7d00af424d786c1f166f7d93776ff65278899e
2019-12-31 20:33:16 +00:00
Paul Duffin
e602918294 Restrict SdkMemberTypes that can be used with sdk/sdk_snapshot
By default SdkMemberTypes are only supported on module_exports module
type. Support for sdk module type has to be explicitly specified.

The java_header_libs, native_shared_libs and stubs_sources are
supported on sdk. The latter is required to provide the stubs source
for an API specified in java_header_libs as they should be kept in
sync.

Bug: 146341462
Test: m nothing
Change-Id: I19b9e60792780a797458d4a9e489506602b13144
2019-12-31 15:08:59 +00:00
Paul Duffin
1b82e6a108 Add support for java_test in sdk
Adds java_test_import module type for use by the sdk snapshot and
adds java_tests property to the sdk and sdk_snapshot module type.

This is needed for the conscrypt test sdk.

Bug: 143678475
Test: m nothing
Change-Id: Ied4c56c978dac2f92a9b3bc34b3235d7eeba2fd3
2019-12-31 15:08:59 +00:00
Paul Duffin
235ffffbdc java_sdk_library: construct droidstubs args as []string
Bug: 145998881
Test: m checkbuild
Change-Id: Id3eb99577200a807050dbf86f47816a2476c3d9c
2019-12-31 15:08:33 +00:00
Automerger Merge Worker
33e8d09228 Merge "Dedup generating xml file for java_sdk_library" am: 380f85edd3 am: 0fcd3e1e59 am: ef3c83de43
Change-Id: Ibfce5ab855aa13145d265e68ee9678d4aab4831a
2019-12-28 00:17:54 +00:00
Jooyung Han
624058e6a5 Dedup generating xml file for java_sdk_library
Permission XML file for java_sdk_library is generated by
java_sdk_library itself now.

And, build rule is switched to android.WriteFile since "echo -e" is
not supported from build server. (-e is printed to output)

Bug: 145474221
Test: m com.android.cronet and check its permissions xml file
     also, m org.chromium.net.cronet.xml (created dynamically)
Change-Id: Iffb119151c49bc4fe6c4386fa267cca193f37dbc
2019-12-26 12:20:24 +00:00
Automerger Merge Worker
986fe22e22 Merge "Generate .srcjar for prebuilt_stubs_sources" am: e2bc36f12c am: 954e23e3e0 am: a8d9e2ecdd
Change-Id: Ica5b34271f7c1e7854f4cc7847e653851552ef26
2019-12-23 14:02:03 +00:00
Paul Duffin
e2bc36f12c Merge "Generate .srcjar for prebuilt_stubs_sources" 2019-12-23 13:32:08 +00:00
Mathew Inwood
4d0c19c271 Singleton build rule for merged compat config.
This creates a single build artifact with all compat config from the build.

Test: m out/soong/compat_config/merged_compat_config.xml
Bug: 144927670

Change-Id: Ie60575469c22c201cf1f4d4c187c03c7212dd26b
2019-12-20 13:55:12 +00:00
Automerger Merge Worker
5232819c83 Merge "Update build rule for updated script." am: 431b8a2fdd am: 8f7dd2e8f3 am: 1ff584d604
Change-Id: Ieae5c37dd11ad4149cd37c91e1261b6285725111
2019-12-20 10:13:15 +00:00
Mathew Inwood
431b8a2fdd Merge "Update build rule for updated script." 2019-12-20 09:33:42 +00:00
Paul Duffin
9b478b0831 Generate .srcjar for prebuilt_stubs_sources
Changes prebuilt_stubs_sources to generate a .srcjar from its input
instead of just exposing the srcs it is given. This ensures that it can
be used as a drop in replacement for a droidstubs module.

Updates the test for prebuilt_stubs_sources to be more representative
of the actual use made of it by sdk snapshot which outputs a directory
not a glob pattern. Added some documentation of the
prebuilts_stubs_sources srcs property to make it clear that it is
supposed to be a set of directories.

Extracts common code from sdk/testing.go for normalizing path/paths
for testing.

Bug: 143678475
Test: m conscrypt-module-sdk conscrypt-module-host-sdk conscrypt-module-test-sdk
      unzip those in place of external/conscrypt
	  build core-current-stubs-source which expects it to provide a .srcjar.
Change-Id: I8204a022557a9b0b45e19eac79ecba98ff95213d
2019-12-20 08:13:45 +00:00
Automerger Merge Worker
74375f5bb5 Merge "Support java_sdk_library as java_libs of apex" am: 120d73fe4f am: 1d39e165f7 am: 97dd8ef8e4
Change-Id: I6c920a472d77993fbc65cda2959b9b8f26e458b3
2019-12-20 05:46:55 +00:00
Treehugger Robot
120d73fe4f Merge "Support java_sdk_library as java_libs of apex" 2019-12-20 05:16:31 +00:00
Automerger Merge Worker
4e965ebbce Merge "Improve cc tests by adding sanitizer mutators" am: 7d211f1793 am: 152b5f8675 am: 5b91dc8d39
Change-Id: Ife351bc2628c32e7473ead96097b6ebd325604ec
2019-12-20 02:50:24 +00:00
Automerger Merge Worker
504b300fc6 Merge "Dedup prebuilt mutator registration" am: 82f4f99780 am: 849e8f7509 am: e05577b9a8
Change-Id: I094959ab23674cafcc40455f5ea1c062085c75f1
2019-12-20 02:50:06 +00:00
Automerger Merge Worker
598e0885e7 Merge "Dedup registration for cc default test config" am: 24de9ea201 am: 6da6395f16 am: 1971acf840
Change-Id: Iff72ebfc46ba03e5b9a26ba04e6810f720747bc7
2019-12-20 02:48:49 +00:00
Jeff Sharkey
2123b96921 Merge "Move MediaStore.java inside APEX boundary." 2019-12-20 01:17:46 +00:00
Jooyung Han
58f26aba4e Support java_sdk_library as java_libs of apex
When a java_sdk_library module is added, both impl jar and permission
xml files are packaged together.

For example, when a java_sdk_library "foo" is listed, following two
entries will be in an APEX package.

/javalibs/foo.jar
/etc/permissions/foo.xml

Bug: 145474221
Test: m com.android.cronet
      deapexer list com.android.cronet.apex

Change-Id: If5883c02255e9309f20810b1532d3fbe73bf4e95
2019-12-20 08:50:34 +09:00
Automerger Merge Worker
0662e65654 Merge changes I7e9440a0,I7f1a4b64,If5d6fdac am: b237de1914 am: ab879385eb am: 396fd80826
Change-Id: I96741af41ba539d783787abc0b79f82caef2e5d4
2019-12-19 23:37:41 +00:00
Automerger Merge Worker
d3bc7e35ab Merge changes I982fcb8d,I17f24fe1,If5740476 am: 4326e7375c am: 22cf68dcd1 am: d8b3bb0425
Change-Id: Iae44eab1a6a654117f221b04dce62d9edd5659dd
2019-12-19 23:34:51 +00:00
Jeff Sharkey
38338a951d Move MediaStore.java inside APEX boundary.
Recent work has paved the way to get MediaStore.java building against
"core_platform", and this change is actually shifting MediaStore.java
inside the MediaProvider APEX boundary.

This involves defining a new "updatable-mediaprovider" library JAR
and ensuring that it's spliced into classpaths where needed to keep
everything building and working.

Note that the MediaProvider APK itself is still bundled, so we're
manually including the MediaStore.java when building that APK so that
we can continue referencing @hide symbols, but there's a STOPSHIP
comment to remove that once we get the APK building against
"system_current".

Bug: 144247087
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I6d6da165848b934f4ca7ecfca7b97de6f97897e3
2019-12-19 22:16:04 +00:00
Paul Duffin
d686791c16 Improve cc tests by adding sanitizer mutators
This fixes an issue that arises when deduping cc build component
registration code.

The sanitize_runtime_deps and sanitize_runtime post deps mutators were
not previously added when running cc tests. That meant the tests were
not actually testing the same behavior as at runtime.

Adding the mutators breaks the TestFuzzTarget test as the mutator adds
libclang_rt.ubsan_standalone-aarch64-android as a dependency of libc++
and the former is not available.

This fixes the test by adding the missing dependency as a cc prebuilt
shared library.

Test: m checkbuild
Bug: 146540677
Change-Id: Ie13c7e6fcefef7d9cb1cc5364be3dc563ce40de5
2019-12-19 19:19:40 +00:00
Paul Duffin
0c4979bbdf Dedup prebuilt mutator registration
Test: m checkbuild
Bug: 146540677
Change-Id: I9f8a11adf61fe6f352ec1eabc7c5bac332348ba2
2019-12-19 19:19:40 +00:00
Paul Duffin
77980a8bb9 Dedup registration for cc default test config
The cc.GatherRequiredDepsForTest() method returns some default module
definitions that are required when using cc module types like
cc_library. Previously, the registration of the module types and
mutators needed to process those default definitions was duplicated
in the test config initialization.

This change removes that duplicated code and replaces it with calls
to cc.RegisterRequiredBuildComponentsForTest(ctx) which registers all
the required build components.

Test: m checkbuild
Bug: 146540677
Change-Id: I80b6913c5691ff164ce9d308b9e1da24940f2d42
2019-12-19 19:19:40 +00:00
Paul Duffin
43dc1cc2bc Dedup system modules and sdk library module type registration
Test: m checkbuild
Bug: 146540677
Change-Id: I982fcb8d723e8e2f7679434051ddc427d4fbd7be
2019-12-19 19:19:40 +00:00
Paul Duffin
b0f850784a Dedup java genrule module type registration
Test: m checkbuild
Bug: 146540677
Change-Id: I17f24fe145b4bb453e82aabaecc9c251f2b9769b
2019-12-19 19:19:40 +00:00
Paul Duffin
a48f758d84 Dedup prebuilt apis module type/mutator registration
Test: m checkbuild
Bug: 146540677
Change-Id: If5d6fdace2574df6314fbcf6441838cd11df58ae
2019-12-19 19:19:40 +00:00
Paul Duffin
884363e782 Dedup droiddoc module type registration
Some tests were changed as they were using the wrong name for the
droiddoc_exported_dir module type.

Test: m checkbuild
Bug: 146540677
Change-Id: If57404760d2df3757c93e237696359355cf0c96e
2019-12-19 19:19:40 +00:00
Automerger Merge Worker
8b60190dc5 Merge "Revert "Consistently use either "boot" or "apex" boot image as the default."" am: 18577fe8fb am: cbb1de50d6 am: 4f5b495732
Change-Id: Ia00232e849ad035dc6d54059a906cc2bcce7bf17
2019-12-19 18:42:13 +00:00
Jiyong Park
f3273c5587 Merge "Add updatable_media_stub to framework" 2019-12-19 18:04:54 +00:00
Lingfeng Yang
18577fe8fb Merge "Revert "Consistently use either "boot" or "apex" boot image as the default."" 2019-12-19 17:24:27 +00:00
Lingfeng Yang
54191fae42 Revert "Consistently use either "boot" or "apex" boot image as the default."
This reverts commit 48b3b3c71f.

Reason for revert: breaks emulator

BUG: 146558375

Change-Id: I2af3d11ad9a014b0d73a73540bc814f245bc6418
2019-12-19 16:41:40 +00:00
Automerger Merge Worker
f4353299a7 Merge "Dedup registration code for module types and singletons" am: 65b174c9c7 am: dffc72bf4e am: 418ee6e2ff
Change-Id: Iff6b4842cf433acdb6674b175023aa964533f64e
2019-12-19 16:08:56 +00:00
Treehugger Robot
65b174c9c7 Merge "Dedup registration code for module types and singletons" 2019-12-19 15:38:25 +00:00
Automerger Merge Worker
8f95562c8e Merge "Consistently use either "boot" or "apex" boot image as the default." am: 13c929e32e am: 292aed498c am: 9d148def53
Change-Id: Ibad33176769845d82e5eabf29fc5f5f71e619e86
2019-12-19 12:17:16 +00:00
Ulyana Trafimovich
13c929e32e Merge "Consistently use either "boot" or "apex" boot image as the default." 2019-12-19 10:22:01 +00:00
Paul Duffin
f9b1da0fcb Dedup registration code for module types and singletons
The registration of module types and singletons is duplicated between
init() functions that register them for use in the build runtime and
test context creation code that registers them for testing.

This is a proof of concept for a mechanism that will allow the code
to be shared. It defines a RegistrationContext interface that is
implemented by both the TestContext and the new initRegistrationContext
type. An instance of the the latter is available through the
InitRegistrationContext variable.

The intent is that the registration of the module types and singleton
types will be extracted from the init() function into a separate
function that takes a RegistrationContext parameter. That method is
called from init() passing in the InitRegistrationContext and from a
test passing in the TestContext. Something like this:

  func init() {
    RegisterBuildComponents(android.InitRegistrationContext)
  }

  func RegisterBuildComponents(ctx android.RegistrationContext) {
    ctx.RegisterModuleType(....)
    ....
  }

A test would do something like this:

  ctx := android.NewTestContext()
  RegisterBuildComponents(ctx)

Test: m nothing
Change-Id: I97173cabb6d6cf7ce98fdb5f73418438b1997b35
2019-12-19 10:09:53 +00:00
Automerger Merge Worker
b5aeec76a3 Merge "Merge multiple compat_config.xml's." am: b4cc0206bb am: a0f21a5a4f am: 9ada41ec20
Change-Id: I19876d52dfe47ee3616fb8f7c5be7ce33fc44ae2
2019-12-19 08:44:40 +00:00
Mathew Inwood
0dd06f6ff2 Update build rule for updated script.
The script now expects flags for filenames and no longer
just writes to stdout. Write full merged config too.

Test: m libcore-platform-compat-config
Change-Id: Ia524a8c271725665772c9543baecd4f494ee86f1
2019-12-19 08:27:33 +00:00
Mathew Inwood
b4cc0206bb Merge "Merge multiple compat_config.xml's." 2019-12-19 08:11:09 +00:00
Automerger Merge Worker
31093e63fd Merge "Revert submission 1194828-revert-1191937-art_apex_available-DWXQGTKMAR" am: aa21599d5d am: c945626671 am: a2dcda829a
Change-Id: Ibe327762165d8848eec14c016121babd47558219
2019-12-19 05:31:55 +00:00
Treehugger Robot
aa21599d5d Merge "Revert submission 1194828-revert-1191937-art_apex_available-DWXQGTKMAR" 2019-12-19 05:05:35 +00:00
Automerger Merge Worker
b47c56b232 Merge "Create public stub for platform's sysprop_library" am: 0cbb31e9e7 am: c044c0f713 am: a9ee40b723
Change-Id: Ic4c49427f484d0d23f01bd8dc3078b9d14cf1263
2019-12-19 03:51:44 +00:00
Treehugger Robot
0cbb31e9e7 Merge "Create public stub for platform's sysprop_library" 2019-12-19 03:23:01 +00:00