Commit Graph

6146 Commits

Author SHA1 Message Date
Colin Cross
99c3ed94b8 Allow defaults in java_genrule modules
Call InitDefaultableModule in java_genrule factories to allow
the defaults property to be used.

Bug: 202547639
Test: m checkbuild
Change-Id: I3a5960304af3e9babb30d036d63016087000d773
2021-10-08 17:52:32 -07:00
Anton Hansson
f2dffd9c04 Update reference to merged services txt
The module is changing name. Update the reference.

Bug: 169103987
Test: m
Change-Id: I1e3f05b6d9c0262adcde6881ea79df9338bb363a
2021-10-08 16:15:10 +01:00
Xin Li
800112b97f Merge "Merge Android 12" 2021-10-07 23:50:21 +00:00
Pedro Loureiro
d28e4b7077 Merge "Add module-lib to droidstubs' supported sdk types" am: 2937eb5bb4 am: bba5a387d6 am: ae4d32592a am: 0ac605d99b am: 3257af3c2f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844312

Change-Id: Ie7462e94b02ff8d15905ae2d624f7c0388cb29bb
2021-10-07 11:23:13 +00:00
Pedro Loureiro
bba5a387d6 Merge "Add module-lib to droidstubs' supported sdk types" am: 2937eb5bb4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844312

Change-Id: I3a23a868ff9b476bc3c60f01ad756d897829ff3b
2021-10-07 10:29:31 +00:00
Pedro Loureiro
2937eb5bb4 Merge "Add module-lib to droidstubs' supported sdk types" 2021-10-07 10:17:03 +00:00
Paul Duffin
ea14d9c0db Merge "Allow implementation details to be excluded from signature patterns file" am: 6546573ec9 am: dc3951c407 am: ea16a1f94f am: 9083f4ebfa am: 1d5030cc56
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788094

Change-Id: I412c3ae32e96a3b400bb886b56f5804c8731c2fe
2021-10-06 13:37:38 +00:00
Paul Duffin
dc3951c407 Merge "Allow implementation details to be excluded from signature patterns file" am: 6546573ec9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788094

Change-Id: I28f0ddcfe3746a8bf37471f9f1c9b9771fab690a
2021-10-06 12:35:12 +00:00
Paul Duffin
fca846b4eb Retry: Separate hidden API flags needed in sdk snapshots for S and T am: 191be3a186 am: bf027e4e58 am: 1f45d4a4d9 am: 16a312a1e6 am: 812583f057
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844294

Change-Id: I02a215a9702e4c4b2eae3084c0e5e751dfa76f9a
2021-10-05 19:00:18 +00:00
Paul Duffin
bf027e4e58 Retry: Separate hidden API flags needed in sdk snapshots for S and T am: 191be3a186
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844294

Change-Id: Id8977b8160f175b736214428cae94ea27f95675b
2021-10-05 18:04:10 +00:00
Pedro Loureiro
cc203505b9 Add module-lib to droidstubs' supported sdk types
If the android.jar is not found in the module-lib folder, it falls back
to searching it in the system folder and then falls back on the public
folder.

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

Test: m nothing
Bug: 202023154
Change-Id: I99c9004740c8e51faf53ebc3ba2444e8164215f3
2021-10-05 15:40:46 +00:00
Paul Duffin
1e18e98b14 Allow implementation details to be excluded from signature patterns file
Previously, the signature-patterns.csv file (which was output in an sdk
snapshot) included implementation details, e.g. the names of classes
that are not part of any API, including the hidden API. This change
allows a bootclasspath_fragment module owner to customize the generated
signature patterns file to remove as many implementation details as
possible from the sdk snapshot. That means that implementation only
changes would not require that sdk snapshots be updated in sync with
the corresponding APEX.

Module owners can remove implementation in the following ways:
1) Limit the number of packages that are treated as split packages by
   explicitly specifying the split packages in the split_packages
   property. A split package is one whose classes are provided by
   separate bootclasspath_fragment modules and so the signature
   patterns has to include every class in that package provided by a
   specific bootclasspath_fragment module, including implementation
   classes, instead of just listing the package.

   The default is to treat all packages as being split, so if no
   split_packages is specified then it defaults to ["*"] which matches
   all packages. Assuming that no package was split unless specifically
   stated would require that all the modules that had split packages
   explicitly list them before this change could be submitted as
   without them this change would break the build.

   Once all existing modules with split packages have been updated to
   include them then the default may be changed.

2) Adding package prefixes for any hierarchy of packages that are
   owned solely by that bootclasspath_fragment. This removes the need
   to list the packages in that hierarchy, including implementation
   specific packages.

Bug: 194063708
Test: atest --host verify_overlaps_test signature_patterns_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: If2f90cfc41b6fff9fa4ac8b9d4973110938b9392
2021-10-05 15:47:05 +01:00
Paul Duffin
191be3a186 Retry: Separate hidden API flags needed in sdk snapshots for S and T
Previous change that was reverted: https://r.android.com/1835222
An additional test was added that revealed a bug in the previous change
which has been fixed here.

Previously, the behavior of the stub_flags and all_flags properties
was different between S and T. In S they contained paths for the
complete set of stub flags and all the encoded flags. However, in T
they contained filtered sets of flags which if used in S would prevent
build checks from detecting possible inconsistencies. Also, a new
signature_patterns property was added in T that is not supported in S.

This change creates separate properties/files for T and reverts the
behavior of the properties/files that were added in S back to how they
behaved in S. The new properties are called filtered_stub_flags and
filtered_flags.

The S and T properties are tagged with the appropriate
supported_build_releases tag to ensure that they are only output when
specifically targeted.

Bug: 197842263
Test: m nothing
Change-Id: I1ce0a3d6623dabf73e32af1a7457b9b444fc3b7c
2021-10-05 15:27:42 +01:00
Pedro Loureiro
d9ab7aadf7 Merge "Perform validation of shared library attributes" 2021-10-05 10:15:50 +00:00
Treehugger Robot
28f9c8d9d9 Merge "Bp2Build common properties auto-handling" am: d905146590 am: 3e745e63f3 am: 98f0fd07ca am: 6aaaea1740 am: 37ba2d3f8d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815376

Change-Id: I110e0ec8b35ab3f86164e7cbd4db47aa01b65601
2021-10-04 20:15:38 +00:00
Treehugger Robot
3e745e63f3 Merge "Bp2Build common properties auto-handling" am: d905146590
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815376

Change-Id: I38f1063302ea90583a51e625076e6232b4364ab7
2021-10-04 19:20:28 +00:00
Treehugger Robot
d905146590 Merge "Bp2Build common properties auto-handling" 2021-10-04 19:02:07 +00:00
Ulya Trafimovich
366f689ab7 Update variable name in error messages. am: e5b2b49a73 am: ef92591c59 am: 1fae1299cd am: 79d4a86c7e am: efc3d6caec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844308

Change-Id: I078fd16c294446f6a6999c452b9cbdad75b8d060
2021-10-04 17:21:30 +00:00
Ulya Trafimovich
ef92591c59 Update variable name in error messages. am: e5b2b49a73
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844308

Change-Id: Icb57f58d9efdf8793162254eefe8e3150d6d9cf5
2021-10-04 16:18:58 +00:00
Ulya Trafimovich
e5b2b49a73 Update variable name in error messages.
Variable PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS was renamed to
PRODUCT_APEX_SYSTEM_SERVER_JARS in https://r.android.com/1779472.

Bug: 191127295
Test: m nothing
Change-Id: I0c8ae839cab443c824760b40d30b4374982010f9
2021-10-04 15:43:39 +01:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
447f6c99c9 Bp2Build common properties auto-handling
Introduce `commonAttributes` & `fillCommonBp2BuildModuleAttrs used in
CreateBazelTargetModule

Adapt `bp2BuildInfo` to use `commonAttrs` instead of `Name`.
And thus also all downstream users of `CreateBazelTargetModule`.

As initial user, the Soong `required` property will be
translated to Bazel's `data`.

Bug: 198146582, 196091467
Test: build_converstion_test.go:TestCommonBp2BuildModuleAttrs
Test: go test
Test: mixed_{libc,droid}.sh
Change-Id: Ib500e40f7e2cb48c459f1ebe3188962fc41ec124
2021-10-04 14:43:04 +00:00
Pedro Loureiro
f9e584dd20 Perform validation of shared library attributes
Perform consistency checks as per http://go/updatable-shared-libraries

These include:
  * no attribute can specified can be less than T
  * max-device-sdk can't be less than min-device-sdk
  * min and max-device-sdk need to be at least the module's
  min_sdk_version
  * using on-bootclasspath-before implies that the module's
  min_sdk_version is at least T or the library has min-device-sdk of at
  least T

Test: m nothing

Bug: 191978330

Change-Id: Iaca5cf23fb0bc7e65effb3529c8e829560894c2e
2021-10-04 14:42:34 +00:00
Paul Duffin
a7c8db44ee Remove unnecessary additionalCheckedModules field am: 0b58fdb058 am: 6c68db45d3 am: 4af54d88fa am: cd7b02f817 am: e838281188
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842815

Change-Id: I13ddf43a823f3255a9b4ee4bbf8d22157302e28c
2021-10-04 12:00:26 +00:00
Paul Duffin
6c68db45d3 Remove unnecessary additionalCheckedModules field am: 0b58fdb058
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842815

Change-Id: Ic6e55395138cfed7257529b2c5165bb4907460e1
2021-10-04 11:11:47 +00:00
Salmax Chang
b8d1ce3c2c Merge changes from topic "bb_201948713" am: 8bb9c6a1d9 am: 12d6b80da2 am: 9386534350 am: 711b068703 am: c06e66c21a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844137

Change-Id: I3a1554618c93276abf6ce3882b87dc1479154d98
2021-10-04 10:09:59 +00:00
Paul Duffin
0b58fdb058 Remove unnecessary additionalCheckedModules field
This change removes the field and the code that uses it which is
effectively dead code as it only does something when the list is not
empty and a previous change removed the only code that added a Path to
this list.

Bug: 201753898
Test: m nothing
Change-Id: I67c74ad2a3b115fd3b20b3b416f45b92c749749c
2021-10-04 10:42:56 +01:00
Salmax Chang
12d6b80da2 Merge changes from topic "bb_201948713" am: 8bb9c6a1d9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844137

Change-Id: Ia042b5b24141be4ebfa17ab15adf34c3af632635
2021-10-04 08:13:19 +00:00
Salmax Chang
8bb9c6a1d9 Merge changes from topic "bb_201948713"
* changes:
  Revert "Support generating sdk snapshot for specific build release"
  Revert "Separate hidden API flags needed in sdk snapshots for S and T"
2021-10-04 07:53:19 +00:00
Salmax Chang
8194d61ae0 Revert "Separate hidden API flags needed in sdk snapshots for S and T"
This reverts commit ba68c93630.

Reason for revert: suspect to cause build break in b/201948713

Change-Id: Ide3693ac1f8e24bd2f7c12857361885cb6b787ef
2021-10-04 05:28:58 +00:00
Paul Duffin
af2e1b86bd Merge "Separate hidden API flags needed in sdk snapshots for S and T" am: 6b383e9ef2 am: afe55d6598 am: 0385ea00cb am: fe419115a9 am: 0c6ebc66d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835222

Change-Id: Id56e96265cf03777bfda6d56c4f3c6ed5e99e20a
2021-10-02 12:30:25 +00:00
Paul Duffin
cbd23f6df5 Merge "Always perform permitted package check when building a library" am: f7db6ebaa1 am: 7f04fb7dbc am: 0c89f5fb04 am: d04cbf5fbb am: 7a228a3e01
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842459

Change-Id: I047ee7a5153a76133000ee3f4ce96a942bacb9cf
2021-10-02 12:29:45 +00:00
Paul Duffin
afe55d6598 Merge "Separate hidden API flags needed in sdk snapshots for S and T" am: 6b383e9ef2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835222

Change-Id: I092500dc977cc482a6c662ae9fcd4e71fea32810
2021-10-02 11:34:00 +00:00
Paul Duffin
7f04fb7dbc Merge "Always perform permitted package check when building a library" am: f7db6ebaa1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842459

Change-Id: I8be5f7deb33b67b5307cb3a4551f659414a3aee9
2021-10-02 11:33:32 +00:00
Paul Duffin
6b383e9ef2 Merge "Separate hidden API flags needed in sdk snapshots for S and T" 2021-10-02 11:27:45 +00:00
Paul Duffin
f7db6ebaa1 Merge "Always perform permitted package check when building a library" 2021-10-02 11:18:48 +00:00
Treehugger Robot
d7c0c8c4c0 Merge "Preopt APEX system server jars for java_import." am: 6f0c1a1e0c am: 3b54c2b055 am: 3c4cfc88ad am: 63dbb530cf am: 65655e49a2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1840056

Change-Id: Ic1058266ae3784b33d05865513909de3e08f36f4
2021-10-02 04:50:13 +00:00
Treehugger Robot
3b54c2b055 Merge "Preopt APEX system server jars for java_import." am: 6f0c1a1e0c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1840056

Change-Id: Ifc6895e47d0e7e6ed7d593a9d5d767f6cd2cf566
2021-10-02 03:48:25 +00:00
Treehugger Robot
6f0c1a1e0c Merge "Preopt APEX system server jars for java_import." 2021-10-02 03:33:22 +00:00
Colin Cross
7d55681ede Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory" am: 2df9ebf9ca am: 10ef62ea67 am: 6625d51343 am: 9fd25f214e am: 0401a96fe7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838375

Change-Id: I018853330f0dc99cc5e00d81f24acb6aa320b8b4
2021-10-01 17:46:54 +00:00
Colin Cross
10ef62ea67 Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory" am: 2df9ebf9ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838375

Change-Id: I9fd93be8154f2f1372ccde1eb9a37690738692b7
2021-10-01 16:46:26 +00:00
Paul Duffin
ba68c93630 Separate hidden API flags needed in sdk snapshots for S and T
Previously, the behavior of the stub_flags and all_flags properties
was different between S and T. In S they contained paths for the
complete set of stub flags and all the encoded flags. However, in T
they contained filtered sets of flags which if used in S would prevent
build checks from detecting possible inconsistencies. Also, a new
signature_patterns property was added in T that is not supported in S.

This change creates separate properties/files for T and reverts the
behavior of the properties/files that were added in S back to how they
behaved in S. The new properties are called filtered_stub_flags and
filtered_flags.

The S and T properties are tagged with the appropriate
supported_build_releases tag to ensure that they are only output when
specifically targeted.

Bug: 197842263
Test: m nothing
Change-Id: Iec8b9c539796c507245b69c0aed980fde6d8694f
2021-10-01 17:28:13 +01:00
Colin Cross
2df9ebf9ca Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory"
* changes:
  Add data_bins property
  Support per-testcase directories in all test suites
  Add environment variables to cc_genrule commands
2021-10-01 16:27:55 +00:00
Paul Duffin
08a18bf74a Always perform permitted package check when building a library
Previously, the permitted package check was designed to only be run
when building checkbuild. Although, that appears to now be broken.

This change uses a Validation dependency to ensure that the package
check is performed whenever the output file of a java_library is built
as part of the build. The package check runs in parallel with any other
rules that depend on the file.

Bug: 201753898
Test: - change the permitted_packages property in
        frameworks/base/test-mock so that the package check will fail.
      m out/soong/.intermediates/frameworks/base/test-mock/android.test.mock/android_common/package-check.stamp
      - as expected the package check failed.
      m droid
      - as expected the package check did not fail.
      # Made these changes then:
      m droid
      - as expected the package check now failed.
Change-Id: Id38fe280c79e5505ee4555b845c6da2ae6747bc4
2021-10-01 14:37:04 +01:00
Jiakai Zhang
8eb1e64ddc Merge changes I7876b077,Ib2e7d5e6,I7d2d2e02,Ibf5322f8 am: dcc42b6f7e am: d20f37f014 am: 7072f0158f am: c14dc5f34a am: cea147d102
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835088

Change-Id: Ib331425f6003b4194f881b8702eaca390a730e01
2021-09-30 16:18:01 +00:00
Jiakai Zhang
d20f37f014 Merge changes I7876b077,Ib2e7d5e6,I7d2d2e02,Ibf5322f8 am: dcc42b6f7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835088

Change-Id: Ifefcf876e203406967f44c035495dbba49c4362f
2021-09-30 15:24:48 +00:00
Jiakai Zhang
5b24f721fd Preopt APEX system server jars for java_import.
Similar to aosp/1821985, but for java_import.

Bug: 194150908
Test: See the next CL.
Change-Id: Ied1cfb1a7e1c2eea502b74b0d6e2344bcd02155e
2021-09-30 13:31:28 +00:00
Jiakai Zhang
a8d8660ab1 Generate prebuilt_systemserverclasspath_fragment.
Bug: 194150908
Test: m nothing
Test: manual - 1. Patch aosp/1835087.
  2. m out/soong/.intermediates/art/build/sdk/art-module-sdk/common_os/snapshot/Android.bp
  3. See prebuilt_systemserverclasspath_fragment modules and
     systemserverclasspath_fragments in an sdk_snapshot module.
Change-Id: I7876b077b0b4ed190f01dbfa9533de04ea32d524
2021-09-30 10:06:24 +00:00
Jiakai Zhang
ea18033f31 Add a new SDK member type java_systemserver_libs.
Similar to java_boot_libs, java_systemserver_libs only provide access
to their dex implementation jar for use by dexpreopting and do not
provide an actual implementation jar.

This is used in the subsequent CL.

Bug: 194150908
Test: m nothing
Change-Id: Ib2e7d5e6c002314a0231f46934a766f4a27e610a
2021-09-30 10:06:24 +00:00
Jiakai Zhang
774dd305f4 Add exported_systemserverclasspath_fragments to prebuilt_apex rule.
This is for exporting the contents of systemserverclasspath_fragment for
dexpreopting.

Bug: 194150908
Test: manual - 1. Patch aosp/1818020 and aosp/1834534
  2. m SOONG_CONFIG_art_module_source_build=false com.android.art
Change-Id: I7d2d2e02869d8a523f7c0efbbff81706672a95c5
2021-09-30 10:06:21 +00:00
Jiakai Zhang
c9864278da Add prebuilt_systemserverclasspath_fragment rule.
This is the prebuilt side of systemserverclasspath_fragment, currently
for used for dexpreopting.

The change to automactially generate
prebuilt_systemserverclasspath_fragment rules will be in a separate CL.

Bug: 194150908
Test: m nothing
Change-Id: Ibf5322f80f78ac3ca037489f4a279456fe38a23f
2021-09-30 10:05:58 +00:00