Commit graph

7573 commits

Author SHA1 Message Date
Colin Cross
4e7f581719 Merge changes I65b06238,I1ebef60a into main am: 29deca77ce am: 206329779d am: c2c9ee6554
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2834992

Change-Id: I1c317bf07ddd80ffc0185e311a795e1528434986
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-20 21:43:26 +00:00
Colin Cross
d442a0e882 Add DataPath.ToRelativeInstallPath
Add a method to DataPath that converts it to the relative install path
in preparation for adding additional complexity to DataPath.

Bug: 311428265
Test: builds
Change-Id: I65b06238aafda2db72c6a253744a3087976451cd
2023-11-17 19:06:50 -08:00
Colin Cross
09ad3a6505 Change deps of ctx.Install* from Paths to InstallPaths
Installed files should only depend on other installed files, change
the deps arguments of the ctx.Install* methods from Paths to
InstallPaths.

Bug: 311428265
Test: builds
Change-Id: I1ebef60a943bdbe907744cc43aa985371ac56d32
Merged-In: I1ebef60a943bdbe907744cc43aa985371ac56d32
2023-11-17 19:06:43 -08:00
Colin Cross
db25366860 Merge "Change deps of ctx.Install* from Paths to InstallPaths" into main 2023-11-17 23:29:34 +00:00
Roshan Pius
a68c2e9748 Merge "soong(nfc): Create framework-nfc sdk library" into main 2023-11-17 22:43:35 +00:00
Roshan Pius
a966a35e94 soong(nfc): Create framework-nfc sdk library
Using `framework-location` as reference.

Ignore-AOSP-First: Submitting separately to avoid merge conflicts. See
aosp/2828288
Bug: 303286040
Test: Device boots up after flashing
Test: atest CtsNfcTestCases

Change-Id: I309e76165f5563147dde5e581316ee4ac463fbc4
2023-11-17 14:40:20 -08:00
Spandan Das
3a48e11867 Merge "Skip error check if allow missing deps is true" into main am: 9915e03018 am: 31f8a122e4 am: 88d3e5a93d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2835006

Change-Id: I9b4d1cfbf5d1c273ff2147c95b01f87573a95df5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-17 21:07:23 +00:00
Spandan Das
9915e03018 Merge "Skip error check if allow missing deps is true" into main 2023-11-17 19:42:10 +00:00
Colin Cross
5fcd83edaa Change deps of ctx.Install* from Paths to InstallPaths
Installed files should only depend on other installed files, change
the deps arguments of the ctx.Install* methods from Paths to
InstallPaths.

Bug: 311428265
Test: builds
Ignore-AOSP-First: resolving conflict
Change-Id: I1ebef60a943bdbe907744cc43aa985371ac56d32
2023-11-17 11:05:39 -08:00
Spandan Das
2daded460c Skip error check if allow missing deps is true
Fixes: 311711411
Test: will use go/abtd
Change-Id: I6df6c679e3f122bbca317d16f89cca2ffc982794
2023-11-17 18:58:48 +00:00
Alyssa Ketpreechasawat
4217b56588 Merge "Revert "Revert "Added new framework-pdf jar inside MediaProvider..."" into main am: afd6963ab4 am: 103a95acf9 am: 7d0fd015a6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2822534

Change-Id: I6375050c50478f0872fe3a24c6d2e4d9490a742c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-17 11:40:05 +00:00
Jihoon Kang
b02789c513 Merge "Revert^2 "Modify conditionals for BuildFromTextStub()"" into main am: d8dd46e5be am: 99b1e8133d am: 6213c4c7b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2835958

Change-Id: I989b30ed6aeb1f23cbce8165fe1c6e3306b22dd3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-17 11:39:14 +00:00
Alyssa Ketpreechasawat
afd6963ab4 Merge "Revert "Revert "Added new framework-pdf jar inside MediaProvider..."" into main 2023-11-17 10:30:16 +00:00
Jihoon Kang
b4e5ddd22d Merge "Revert "Modify conditionals for BuildFromTextStub()"" into main am: 88d5104ca1 am: a7fa500d0b am: e05655ac90
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2835871

Change-Id: I2f0c0b01598cd30ffd6ac0897b1fb48bf2ad39b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-17 02:08:21 +00:00
Treehugger Robot
940c7fb0c5 Merge "Modify conditionals for BuildFromTextStub()" into main am: 72a8cee8fe am: 404fd1cce8 am: 48cbd06e68
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2832580

Change-Id: Id507ee1e8ba631427eac3a3a74de2929c5d15766
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-17 02:07:49 +00:00
Jihoon Kang
c1b04d6bc1 Revert^2 "Modify conditionals for BuildFromTextStub()"
This change modifies config.BuildFromTextStub() to return false when
deviceConfig.BuildFromSourceStub() is set to true.

This change resubmits https://r.android.com/2832580.

Test: m nothing
Bug: 311203379
Change-Id: I832364c3c42556e2b3aede2316e8927fd7163e91
2023-11-17 01:49:55 +00:00
Jihoon Kang
77f6ca4919 Revert "Modify conditionals for BuildFromTextStub()"
Revert submission 2832580-sdk-from-source-stub

Reason for revert: Breaking sdk builds
Reverted changes: /q/submissionid:2832580-sdk-from-source-stub

Change-Id: I447e0832950a1aa91df0aed348bdec01528d568d
2023-11-17 00:58:40 +00:00
Jihoon Kang
33e39ae583 Modify conditionals for BuildFromTextStub()
This change modifies config.BuildFromTextStub() to return false when
deviceConfig.BuildFromSourceStub() is set to true.

Test: m nothing
Bug: 311203379
Change-Id: I3b56881fbe2565da20e23470398bf6550c618fb0
2023-11-16 23:02:47 +00:00
Colin Cross
ed268f0403 Merge "Split *ModuleContext out of module.go" into main am: 8d25afd575 am: 516edfa5dd am: 526787aea7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2832037

Change-Id: I25fb993614f2a7e52efe883963d76b77ff7f5308
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 23:47:18 +00:00
Colin Cross
8d25afd575 Merge "Split *ModuleContext out of module.go" into main 2023-11-15 22:05:43 +00:00
Colin Cross
69452e14a3 Split *ModuleContext out of module.go
Move EarlyModuleContext, BaseModuleContext and ModuleContext out of
module.go and into early_module_context, base_module_context and
module_context.go respectively.

Test: builds
Change-Id: I52e6eb1589d1478233c1c55d770b395a16eaa1a3
2023-11-15 11:40:49 -08:00
Jihoon Kang
eecb95f35b Merge "Add environment variable BUILD_FROM_SOURCE_STUB" into main am: 37d679df33 am: 404bf92c95 am: 9d4a61d46b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2831230

Change-Id: Ia9373171a57dbcabf8772e5a37b36d3d070eaafd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 18:30:43 +00:00
Jihoon Kang
7c1958f0f4 Add environment variable BUILD_FROM_SOURCE_STUB
On top of the soong build flag --build-from-source-stub, the user can
configure build to generate stubs from source Java files by setting the
environment variable BUILD_FROM_SOURCE_STUB=true.

Test: m nothing
Bug: 310279899
Change-Id: I0c5247558455f09b8fc208d988aab3b60bf0ff16
2023-11-15 00:34:43 +00:00
Makoto Onuki
b66bba3a3c Allow Ravenwood to cross variant boundaries
Bug: 310268946
Bug: 292141694
Test: atest RavenwoodMockitoTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:43b648195bcf62f62cae5547f73b247c278e1883)
Merged-In: Ia395d32bad57007ec477a6410dcc4201853c8790
Change-Id: Ia395d32bad57007ec477a6410dcc4201853c8790
2023-11-11 00:13:14 +00:00
Makoto Onuki
190b1aacc8 Allow Ravenwood to cross variant boundaries
Bug: 310268946
Bug: 292141694
Test: atest RavenwoodMockitoTest
Change-Id: Ia395d32bad57007ec477a6410dcc4201853c8790
2023-11-10 16:07:39 -08:00
Jihoon Kang
bb61391aba Merge "Revert^2 "Default from-text stub generation in build"" into main am: 8c4387e478 am: 1a062bab81 am: 32fbd4a02b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2807659

Change-Id: If91cc1a8e7d00e275392ccbec65d511459fda14e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-10 05:29:32 +00:00
Jihoon Kang
8c4387e478 Merge "Revert^2 "Default from-text stub generation in build"" into main 2023-11-10 04:10:24 +00:00
Colin Cross
12228f7581 Merge changes I4d0b27ba,Ic48e9cf2 into main am: 4ade19fe94 am: e7601cc83d am: ace644b7ae
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2823833

Change-Id: Icee80b522710d9d6a2568ba8592685dd4c945341
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-09 20:56:34 +00:00
Colin Cross
4ade19fe94 Merge changes I4d0b27ba,Ic48e9cf2 into main
* changes:
  Fix soong_ui file rlimits for go 1.21
  Fix TestReverseSlice for go 1.21
2023-11-09 18:47:40 +00:00
Colin Cross
f2fab8347d Fix TestReverseSlice for go 1.21
Go 1.21 does a better job using the same empty allocation for empty
slices, check for cap > 0 before requiring slices to have different
backing arrays.

Bug: 309895579
Test: TestReverseSlice
Change-Id: Ic48e9cf2c95ea0b810a11cdc4a794a70c02a0a61
2023-11-08 22:11:24 -08:00
Spandan Das
e9f86b6b0b Merge changes from topic "apex_contributions_build_flags" into main am: c31b24977e am: e48000d86f am: 874d391f63
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2808754

Change-Id: Iea3c3e3ac6b9ae49c2b54bf78831495b19637df4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-09 03:17:22 +00:00
Spandan Das
fc12d2f494 Special-case java_sdk_library in source vs prebuilt selection
If a java_sdk_library is listed in `contents`, then restrict the source
vs prebuilt selection superseding to only the internal stub libraries.

Defer the source vs prebuilt selection mechanism of the top-level
library to the existing mechanisms for now. This is necessary because
this top-level library acts as a hook for
- hiddenapi: boot jars are deapxed from the prebuilt apex
- dexpreopt: system server jars are deapexed from the prebuilt apex and
  installed via required

If `next` uses `framework-foo` and `service-foo` as the top-level
library instead of the prebuilt equivalents, then the bootjars installed
in out/soong/dexpreopt_x86_64/apex_bootjars will come from source. And
the *.odex files of the system server jars will come from source.

Bug: 308174768
Test: Added a java_sdk_library unit test to assert that the new
mechanism supersedes the `prefer` flag

Change-Id: Ib43198a3b547c58b54f1f0966e95584215096d32
2023-11-08 18:37:24 +00:00
Spandan Das
1c4d94dccf Use all_apex_contributions for source/prebuilts selection
This flattened singleton module explicitly lists by module name whether source or
prebuilt version of a module should be used. If a module appears in this
metadata module, it supersedes all other source vs prebuilts selection
mechanism

Implementation details
- Update the module dep chain from <source> --> <prebuilt> to <source>
  --> <prebuilt> --> all_apex_contributions
- all_apex_contributions sets a provider which is bubbled up
  to the source module. This requires changing `prebuilt_select` to a
  bottom up mutator
- Update `usePrebuilt` to consult the new provider before falling back
  to existing source vs selection mechanisms. If (foo|prebuilt_foo) is
  listed in the selected `apex_contributions` modules, it
  will be used superseding any other selection mechanisms.
- Update this depTag to IsMetaDepTag so that bootclasspath_fragment's
  validation ignores this new dependency.

Test: Added unit tests to assert that this new mechanism supersedes
`use_source_config_var`

Bug: 308174768
Change-Id: I39a85639642711f3c96b6f18b94d626b55e80c66
2023-11-08 18:37:24 +00:00
Spandan Das
e3fcb41ff7 Create a singleton all_apex_contributions module type
This will be a container for the the apex_contributions
selected using build flags. This module will be used to query the state of
selected apex contributions instead of a global that can be mutated by
anyone.

It will set a provider containing metadata for source vs prebuilts
selection. To reduce the overhead of a new mutator, this will be done in
the existing `prebuilt_select` mutator.

It will validate that there are no dups (`foo` and `prebuilt_foo` cannot
be both selected)

Bug: 308174923

Test: go test ./android

Change-Id: Ie42999a71f35d70e0e977f5ab07ce451608d9f35
2023-11-08 18:37:18 +00:00
Alyssa Ketpreechasawat
9f63436385 Revert "Revert "Added new framework-pdf jar inside MediaProvider..."
Revert submission 2775627-revert-2759049-framework-pdf-UAOVGTHHXO

Reason for revert: submit together with the fix to allow this new jar to coexist w/ mainline prebuilts

Reverted changes: /q/submissionid:2775627-revert-2759049-framework-pdf-UAOVGTHHXO

Change-Id: I877af450918647524d7e24371fb3343a8a2900dc
2023-11-08 16:03:58 +00:00
Treehugger Robot
8f14181875 Merge "Export build flags to soong." into main am: 2ab031f467 am: 1d6e69cda7 am: 5ef54931f0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2803674

Change-Id: I52af4213a59f60378f0c1679ae19f00a3dea4c34
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 05:57:57 +00:00
Jihoon Kang
2a929ad250 Revert^2 "Default from-text stub generation in build"
This change defaults Java stubs to be generated from API text files
during build. Using the `--build-from-source-stubs` flag, users can
toggle between the feature.

This change relands aosp/2617457.

Test: m nothing && verify ninja path exists between android_stubs_current and android_stubs_current.from-text, and does not exist between android_stubs_current.from-source, m nothing --build-from-source-stub && verify the opposite
Bug: 301522358
Change-Id: Ic129dafc3231e71470af982374739930947b69cb
2023-11-08 04:25:52 +00:00
Treehugger Robot
2ab031f467 Merge "Export build flags to soong." into main 2023-11-08 04:15:17 +00:00
Inseob Kim
e4e85d5f9f Export build flags to soong.
This exports a map of build flags used in this release config to Soong.

Bug: 302514918
Test: manual
Change-Id: Id95c03e14cfbb91c0cb9c8c37a065b8387733317
2023-11-08 04:01:38 +00:00
Treehugger Robot
d0fb443b0e Merge changes from topic "apex-elf-checker" into main am: a19c9141aa am: 0b7bebe722 am: 8b75f6e1f3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2817254

Change-Id: I6e5ca5e47e0371815ec32587fe59cefde3d9c9ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 03:33:54 +00:00
Treehugger Robot
a19c9141aa Merge changes from topic "apex-elf-checker" into main
* changes:
  Add check for unwanted_transitive_deps
  Add JoinWithPrefixSuffixAndSeperator() utility
2023-11-08 01:50:01 +00:00
Treehugger Robot
6507f6e8d0 Merge "Create an apex_contributions module type" into main am: 29f5f2574d am: c3e8223cc3 am: afa4668550
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2808370

Change-Id: Ia7691545e7863747a550304a7a39c9b4fee8d5c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-07 20:56:44 +00:00
Treehugger Robot
29f5f2574d Merge "Create an apex_contributions module type" into main 2023-11-07 19:49:52 +00:00
Jooyung Han
b0864e086e Add JoinWithPrefixSuffixAndSeperator() utility
Bug: n/a
Test: m blueprint_tests
Change-Id: I0fa5d291ce10d699df787feaf9fdaf667aa22686
2023-11-07 13:08:53 +09:00
Jeff Sharkey
37e5e61aeb Merge "Add android_ravenwood_test build rule" into main 2023-11-06 18:47:29 +00:00
Alyssa Ketpreechasawat
0788a7e8bf Merge "Disable verify_overlaps test instead of hiddenapi check." into main am: 98e555c842 am: aa91b88610 am: d186d78927
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2816955

Change-Id: I34abbaea5c2114fdd5bd56878482879509181a8e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-06 12:46:55 +00:00
Alyssa Ketpreechasawat
7daf2786b6 Disable verify_overlaps test instead of hiddenapi check.
Disabling hiddenapi check entirely can be dangerous and it might change the
accessibility of @hide Api too. We should only disable verify_overlaps
test which is required for module_sdk and apexes mismatch.

Test: atest CtsInlineMockingTestCases
Bug: 308187068
Bug: 307480026
Change-Id: I44f48e85d802b3a8f2711bc2047bdab721369f08
2023-11-06 09:49:16 +00:00
Spandan Das
0d53dd289e Create an apex_contributions module type
This module type does not any build actions, but provides metadata about
the contributions of the mainline module to other mainline modules/
platform. One immediate use case for this metadata is source vs
prebuilts selection

Each mainline module can have more than 1 metadata modules. Static build
flags will be used to select the right one in trunk.bzl, next.bzl, ...

Bug: 308174923
Test: go build ./android
Change-Id: I5ead0c38fe64b78de08db1736d97a8ab7374d6d9
2023-11-03 22:33:02 +00:00
Makoto Onuki
32eb1338f0 Add android_ravenwood_test build rule
Modeled after android_robolectric_test.

Bug: 292141694
Test: m nothing --no-skip-soong-tests
Test: m hoststubgen ravenwood-runtime tradefed atest && atest-dev HostStubGenTest-framework-test
Change-Id: Ibef8953db45b86264c8a827868793b42f8f2d6ab
2023-11-03 10:36:08 -06:00
Treehugger Robot
ff3e22930f Merge "Optimize out empty path components" into main am: c012b631ae am: 35df455e56 am: 97aa75372d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2804377

Change-Id: I4e0bf2c3ea90a9d3ddffe4863f575abcd37ee23c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 23:56:46 +00:00