Commit Graph

4800 Commits

Author SHA1 Message Date
Paul Duffin
894546d301 Skip initHiddenAPI check of prebuilt's boot dex jar for APEX modules
There is a check in initHiddenAPI that makes sure that if the source
module has been replaced by a prebuilt the prebuilt provides a boot dex
jar. The check was added to try and detect an issue with hidden API
processing early at build time rather than at runtime.

That check relies on the source module having a PrebuiltDepTag
dependency on the prebuilt module that is preferred and will be used by
hidden API processing. That is true for modules that are not in an APEX
but doesn't work for modules that are in an APEX.

The issue is that an APEX variant of a source module depends on the
non-APEX variant of the corresponding prebuilt module. However, that
variant of the prebuilt is not the one that will be used by hidden API
processing; it will use the APEX variant of the prebuilt module which
is the one that has access to the boot dex jar.

That results in the initHiddenAPI check giving a false negative as it
states that the boot dex jar is not available when it may be.

This change simply skips the check is the source module is an APEX
variant. This is a temporary work around as the hidden API processing
is being modularized for each APEX at which point initHiddenAPI will
either be removed entirely or just skipped for APEXes altogether.

Bug: 179354495
Bug: 185828824
Test: m nothing
Change-Id: I2dc3654c9aa476541855b3f0f243a181ddf8d723
2021-04-21 12:53:58 +01:00
Paul Duffin
cc17bfe7de Rename propertyAccessor to propertyValueReader
Bug: 179354495
Test: m nothing
Change-Id: I956e93fdbe43e09b5460337d2eb72084440f14be
2021-04-21 10:14:02 +01:00
Jaewoong Jung
abfbb7183f Merge changes Ibdeb2e5a,I520a5af4,I0db32bec,Id3ab0f3b am: cbb3825d86 am: 2c44af282d am: 51d2ef5cf1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1681228

Change-Id: I2e5630b7ad8a7c34c85a54a2ea2fa4c82b6e2d21
2021-04-20 23:54:19 +00:00
Jaewoong Jung
51d2ef5cf1 Merge changes Ibdeb2e5a,I520a5af4,I0db32bec,Id3ab0f3b am: cbb3825d86 am: 2c44af282d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1681228

Change-Id: Iddf5ae3c76e73e123342f0e2e2a3d8bd3b7c25cb
2021-04-20 23:29:46 +00:00
Jaewoong Jung
cbb3825d86 Merge changes Ibdeb2e5a,I520a5af4,I0db32bec,Id3ab0f3b
* changes:
  Add lint_project_xml_test.py
  Rename lint-project-xml.py to remove dashes.
  Lint baseline file check in lint-project-xml
  Extract getBaselineFilepath method.
2021-04-20 22:59:38 +00:00
Jaewoong Jung
5a4202575e Rename lint-project-xml.py to remove dashes.
So that a future test can import it without a dirty syntax.

Test: m lint-check
Bug: 182349282
Change-Id: I520a5af49543801ab2a8ee888ff235876546dc74
2021-04-20 07:06:03 -07:00
Paul Duffin
f4a24068fe Merge "platform_bootclasspath: aggregate hidden API flag files from fragments" am: 42030eafff am: c06c6534ad am: 19257738c4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675871

Change-Id: I9c8b8b7baba671fd322b0fa512e15093acde8218
2021-04-20 13:13:46 +00:00
Paul Duffin
19257738c4 Merge "platform_bootclasspath: aggregate hidden API flag files from fragments" am: 42030eafff am: c06c6534ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675871

Change-Id: Ief66e4cffc81214e8e197c6a8d4604d2f9a86255
2021-04-20 11:26:54 +00:00
Paul Duffin
42030eafff Merge "platform_bootclasspath: aggregate hidden API flag files from fragments" 2021-04-20 11:02:23 +00:00
Paul Duffin
5c71e4255c Merge "java_sdk_library: Make dex stub jars available for hiddenapi" am: cb5d20887b am: 99e7f3354a am: bb4825abc1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1678146

Change-Id: I07839672b84caef91ef810bf2fa0b5f85c041067
2021-04-20 10:56:43 +00:00
Paul Duffin
bb4825abc1 Merge "java_sdk_library: Make dex stub jars available for hiddenapi" am: cb5d20887b am: 99e7f3354a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1678146

Change-Id: Ia94ccad3365c41934a1b807a9ce5843f7c8f692c
2021-04-20 10:34:20 +00:00
Paul Duffin
cb5d20887b Merge "java_sdk_library: Make dex stub jars available for hiddenapi" 2021-04-20 09:48:53 +00:00
Colin Cross
fff5665f2e Merge "Reland: Add jni_libs property to java tests" am: 91fc8cbc73 am: 9f288cbe22 am: 55c7b4040a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680065

Change-Id: I02b9fcf8ef56ff66010250cee7b1311a45d6dc9a
2021-04-19 22:57:20 +00:00
Colin Cross
55c7b4040a Merge "Reland: Add jni_libs property to java tests" am: 91fc8cbc73 am: 9f288cbe22
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680065

Change-Id: I7bf54eafb384167d9d89d249bb366a87f4e41208
2021-04-19 22:18:38 +00:00
Colin Cross
82da9e5887 Merge changes Iefe133ce,I893f3dd0,I604a11c9 am: b5fa2646d8 am: 1edfe15518 am: 3e0b38d6ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675964

Change-Id: I4fd78410b40b37597497272adc081fff2b235b89
2021-04-19 18:43:13 +00:00
Colin Cross
f8d9c499d4 Reland: Add jni_libs property to java tests
Add jni_libs property to java tests and treat it as test data that
should be copied to the lib or lib64 directory in the test directory.

This relands I3a118b933ab30dcd731c6dc2708da9bc63ab5520 with fixes for
the test on mac.

Fixes: 176593487
Test: java_test.go
Change-Id: I2f8c46643cff7a7ae6dc4d4dbad58f0396e45f09
2021-04-19 10:57:55 -07:00
Colin Cross
3e0b38d6ec Merge changes Iefe133ce,I893f3dd0,I604a11c9 am: b5fa2646d8 am: 1edfe15518
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675964

Change-Id: I886102e516f0862cefe6f9a39bdc93b46cf47c36
2021-04-19 16:28:27 +00:00
Jaewoong Jung
302c5b8d80 Extract getBaselineFilepath method.
Test: m nothing
Bug: 182349282
Change-Id: Id3ab0f3b7d398af9dcfd66ee3c0bda64d999178d
2021-04-19 08:54:36 -07:00
Colin Cross
b5fa2646d8 Merge changes Iefe133ce,I893f3dd0,I604a11c9
* changes:
  Fix metalava api baseline update command
  sbox: print failing command line before output
  sbox: best-effort copy output files on failure
2021-04-19 15:34:57 +00:00
Jeongik Cha
c6246671ea Expose "full" dexpreopt.config
1. Instead of 'slim' config, use full config even for libs
2. Define moduleJSONConfig for fields which cannot be converted to JSON
field directly(Path type field, ProfileBootListing,
DexPreoptImagesDeps are added in this CL) and exclude fields which is
convertible(DexPreoptImageLocations)

Bug: 158843648
Test: m dist
Change-Id: I3f9192ab5292bd079be1b686bb3b25735a836cbc
2021-04-19 18:24:42 +09:00
Colin Cross
289584c20c Merge "Revert "Add jni_libs property to java tests"" am: de1b891690 am: 6aaa526881 am: 964d4a4c7b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1677947

Change-Id: I98779c7847902c12c1b7c4a2297764823c0542e3
2021-04-17 06:45:13 +00:00
Colin Cross
964d4a4c7b Merge "Revert "Add jni_libs property to java tests"" am: de1b891690 am: 6aaa526881
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1677947

Change-Id: I0af8e86d59322272223e5ef9e0d31badc42b00ba
2021-04-17 06:17:21 +00:00
Treehugger Robot
33accf0115 Merge changes from topic "tvts-test-host-jni" am: aef14db78a am: 3640bc3f70 am: af25c6cab8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1560314

Change-Id: I1894a0a5bc90eba3a8151813834864344c881790
2021-04-17 05:53:34 +00:00
Treehugger Robot
af25c6cab8 Merge changes from topic "tvts-test-host-jni" am: aef14db78a am: 3640bc3f70
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1560314

Change-Id: I0a1531f9830b489fb04d44b23df3f895420ee41f
2021-04-17 05:29:50 +00:00
Colin Cross
de1b891690 Merge "Revert "Add jni_libs property to java tests"" 2021-04-17 05:17:45 +00:00
Colin Cross
26616d4cfd Revert "Add jni_libs property to java tests"
This reverts commit 246164a055.

Reason for revert: broke the mac build
Bug: 176593487

Change-Id: Id0242e37aa40d84d291bf7b8ee46dfe98c4d5905
2021-04-17 05:17:03 +00:00
Treehugger Robot
aef14db78a Merge changes from topic "tvts-test-host-jni"
* changes:
  Add jni_libs property to java tests
  Add Target to cc.SharedLibraryInfo
2021-04-17 04:35:24 +00:00
Colin Cross
246164a055 Add jni_libs property to java tests
Add jni_libs property to java tests and treat it as test data that
should be copied to the lib or lib64 directory in the test directory.

Fixes: 176593487
Test: java_test.go
Change-Id: I3a118b933ab30dcd731c6dc2708da9bc63ab5520
2021-04-16 21:59:23 +00:00
Colin Cross
63eeda027c Fix metalava api baseline update command
metalava is run inside sbox with a modified $PWD, so putting $PWD in
the output message results in an incorrect path.  It was also always
incorrect when the output directory was an absolute path.  Add a
cd $ANDROID_BUILD_TOP to the command line and use relative paths
instead.

Bug: 185516277
Test: m out/soong/.intermediates/frameworks/base/system-api-stubs-docs-non-updatable/android_common/metalava/api_lint.timestamp with lint error
Change-Id: Iefe133cea4c3a604ecd2b0ea20f4ba14ae13b425
2021-04-16 14:55:50 -07:00
Paul Duffin
1267d875b6 java_sdk_library: Make dex stub jars available for hiddenapi
The hidden API processing needs access to dex jars for the API stubs in
order to determine which dex members are part of an API surface. The
dex stubs used for the monolithic file are provided by normal
java_library modules for legacy reasons. However, the APEXes that
contribute to the bootclasspath, and so need to perform hidden API
processing, typically provide stubs created by a java_sdk_library.

This change adds support to java_sdk_library/_import to make the dex
stub jars available when requested, that involves:
1. Adding compile_dex property to java_sdk_library_import and
   propagating it down the the java_import modules for the stubs. That
   is already handled for java_sdk_library.
2. Propagating the java_sdk_library compile_dex property to the
   java_sdk_library_import in the generated snapshot.
3. Refactoring and wiring to make the dex stubs jar available to other
   parts of Soong.

Bug: 179354495
Test: m nothing
Change-Id: I5895d4f2ba0b684870862b9429b2364865e4afc6
2021-04-16 18:48:20 +01:00
Jeongik Cha
485c26a6a0 Merge "Made ManifestPath OptionalPath instead of Path" am: 06d6373bbe am: 86b0677262 am: 8c16e8a061
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675472

Change-Id: I5c1a2402098d9562e5f92a7c3960319f3d4c1714
2021-04-16 04:47:46 +00:00
Jeongik Cha
8c16e8a061 Merge "Made ManifestPath OptionalPath instead of Path" am: 06d6373bbe am: 86b0677262
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675472

Change-Id: Ib5f8d4203fe3803c8d9050739877abd1ff79263e
2021-04-16 04:19:41 +00:00
Jeongik Cha
06d6373bbe Merge "Made ManifestPath OptionalPath instead of Path" 2021-04-16 03:40:51 +00:00
Paul Duffin
9b381ef2b8 platform_bootclasspath: aggregate hidden API flag files from fragments
Aggregates hidden API flag files from the bootclasspath_fragments which
will allow the hidden API flag files in frameworks/base/boot/hiddenapi
to be modularized and moved to the appropriate repo.

Bug: 177892522
Test: verified that the out/soong/hiddenapi/... files are unchanged
      by this change
      also verified that changes to the fragment provided files do
      affect the monolithic files.
Change-Id: Ifce14c9ef24c58c7ab1085475d85b61cfbfefecd
2021-04-16 00:29:53 +01:00
Treehugger Robot
91a6d73a97 Merge "Handle boot jars on /system_ext correctly." am: 107f92efbe am: c04c5d3d47 am: 2154e60320
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1672245

Change-Id: If7bfbe8e4fb630ee0d6f2bcf5920f82e749ccf5a
2021-04-15 17:37:58 +00:00
satayev
d103e4cb3f Merge "Generate classpaths.proto config for *CLASSPATH variables." am: 76f88384c4 am: 68e73fcb62 am: 95fe7fca0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1650411

Change-Id: I890d6b67dc63d5795f0a5f962b3f39dfef44f46f
2021-04-15 17:37:52 +00:00
Paul Duffin
8d66423462 Merge "Rename hidden API types ..Augmentation.. to ..FlagFile.." am: d9d1102b35 am: 3e6023da6a am: f1016c4a30
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675870

Change-Id: I25a4f414dcb34bd14e0ab706021f7324ced17b63
2021-04-15 17:37:47 +00:00
Paul Duffin
0fce865c86 Merge "Generalize hiddenAPIAugmentationInfo to make it easier to use" am: bca75b1f77 am: 1b9d52d01e am: 6c58d44428
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675869

Change-Id: Ifca59738c555ca5213a61025d30de19d045a9b2b
2021-04-15 17:37:36 +00:00
Treehugger Robot
2154e60320 Merge "Handle boot jars on /system_ext correctly." am: 107f92efbe am: c04c5d3d47
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1672245

Change-Id: Iaa11eb02f71aaa750e6c48f264d1b0efd9fb6c89
2021-04-15 16:48:50 +00:00
satayev
95fe7fca0f Merge "Generate classpaths.proto config for *CLASSPATH variables." am: 76f88384c4 am: 68e73fcb62
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1650411

Change-Id: Icb330819a50e59b978e56fc025e55000420c1401
2021-04-15 16:48:44 +00:00
Paul Duffin
f1016c4a30 Merge "Rename hidden API types ..Augmentation.. to ..FlagFile.." am: d9d1102b35 am: 3e6023da6a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675870

Change-Id: I8d01bc2bc9866fcd3684c9b386d8ed24a06a0d90
2021-04-15 16:48:39 +00:00
Paul Duffin
6c58d44428 Merge "Generalize hiddenAPIAugmentationInfo to make it easier to use" am: bca75b1f77 am: 1b9d52d01e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675869

Change-Id: Iaa55ecf2d6a6638b64dc0d4378c1a522a4ad2a99
2021-04-15 16:48:12 +00:00
Treehugger Robot
107f92efbe Merge "Handle boot jars on /system_ext correctly." 2021-04-15 16:30:03 +00:00
satayev
76f88384c4 Merge "Generate classpaths.proto config for *CLASSPATH variables." 2021-04-15 16:07:13 +00:00
Paul Duffin
d9d1102b35 Merge "Rename hidden API types ..Augmentation.. to ..FlagFile.." 2021-04-15 15:29:18 +00:00
Paul Duffin
bca75b1f77 Merge "Generalize hiddenAPIAugmentationInfo to make it easier to use" 2021-04-15 15:29:07 +00:00
Ulya Trafimovich
e736e13a8d Handle boot jars on /system_ext correctly.
When Soong looks for boot jars among all modules, it applies certain
constraints to each module that looks like a boot jar (e.g. that it
comes from the right apex or platform). Previously these constraints did
not handle boot jars on /system_ext correctly (they were handled like
apex jars, while they should be handled like platform jars).

Bug: 154976937
Test: m nothing (the modified Soong test would fail previously)
Change-Id: I0746a2fd276ab5ef0400340c5b61cf26c2570e5a
2021-04-15 15:07:06 +01:00
Pedro Loureiro
f0ff1d5243 Merge "Introduce NewApi lint checks" am: 53d69eb028 am: 4a77ab744d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675510

Change-Id: Iff91bd3211debb0058541fcd01182d10994f695d
2021-04-15 12:27:01 +00:00
Paul Duffin
724f24e68a Merge "Move hidden API metadata file rule to platform_bootclasspath" am: fd105d469c am: c552799891 am: a9a8e07643
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674033

Change-Id: I68f24d678cdd437a1672047be672338184e12cd5
2021-04-15 11:23:04 +00:00
Paul Duffin
06f7d3d4c1 Merge "Move handling of prebuilt hiddenapi-index.csv to hiddenapi singleton" am: e2243eac3a am: 0b48ba43c4 am: 86963f54bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674032

Change-Id: I01dfda491e16a257e691c10ba506a84d9f89bcf7
2021-04-15 11:22:58 +00:00