Commit Graph

5529 Commits

Author SHA1 Message Date
Treehugger Robot
a458ac0ede Merge "Optimize isAncestor" 2023-01-12 22:14:46 +00:00
Treehugger Robot
26248cf580 Merge changes I48426a8e,Ic991e3ae,I9768241f
* changes:
  bp2build apex min_sdk_version w/ soong config var
  Handle soong config vars for string attrs
  bp2build correctly handle empty soong_config_var
2023-01-12 19:11:27 +00:00
Cole Faust
3ac7db80f1 Optimize isAncestor
Remove string copies.

Test: go test (there are existing visibility tests)
Change-Id: I575dcd8497527da03f88003ff0805f3d1271983e
2023-01-12 11:00:40 -08:00
Alix Espino
ed2491cf20 Merge "java_binary with kotlin sources" 2023-01-12 14:40:46 +00:00
Xin Li
2391a2c527 Merge tm-qpr-dev-plus-aosp-without-vendor@9467136
Bug: 264720040
Merged-In: I70802042e5665baa471a3e9e0bc27efaf7a97944
Change-Id: If7ed30b5104e479d61245a768507715c249ec583
2023-01-11 22:46:06 -08:00
Liz Kammer
f3963f8b9c bp2build correctly handle empty soong_config_var
Previously in cases where a variable value was set but empty in a bp
file we ignored the value in bp2build; however, the correct behavior is
to take the empty value for each case. The tests for soong config vars
with empty_prop_for_string_var and unused_string_var:
https://cs.android.com/android/platform/superproject/+/master:build/soong/android/soong_config_modules_test.go;l=243-283;drc=72beb34609217f3c98623fb6795b6417c7f0fc65
highlight the difference in when conditions default should be used or
not.

Test: go test bp2build tests
Change-Id: I9768241f013a1a1bc8fa23657a066b5b3f52f09b
2023-01-11 22:01:01 -08:00
Sasha Smundak
39a301c963 Clean up mixed builds module names filtering
* Remove `Bp2buildCcLibraryStaticOnlyList` it is never set
* Remove the rest of the sutff related to it
* Streamline MixedBuildsEnabled
* Rename BazelContext.BazelAllowlisted to BazelContext.NameFilter
  to reflect its action
* Rename bazelContext to mixedBuildBazelContext
* Fix minor warnings from Go static analyzer

Test: treehugger
Change-Id: Ie245c992f94bbfd5c7c23dd06917026200a28263
2023-01-12 00:32:45 +00:00
Jason Wu
c69b26311b Merge "Delete the noisy error message" 2023-01-11 21:21:32 +00:00
Sorin Basca
d6be9e51ca Target Java 17
Bug: 233029164
Test: TH
Change-Id: I750b866565c264eb4f4ac14ebc88be6fc9b1b458
2023-01-11 12:47:10 +00:00
Spandan Das
3dfb939243 Merge "Create a "Toolchain" API surface" 2023-01-11 01:08:25 +00:00
Treehugger Robot
0f2d054e4f Merge "Optimize PathForBazelOutRelative" 2023-01-10 22:58:07 +00:00
Jason Wu
ff1bb31670 Delete the noisy error message
Test: m nothing, m --bazel-mode-dev nothing
Bug: 263127170
Change-Id: I876311f0746f5291076827e0bba71bb0b6a72646
2023-01-10 17:36:41 -05:00
Cole Faust
0abd4b4f5d Optimize PathForBazelOutRelative
This isn't benchmarked or anything, but should give
minor performance improvements.

Test: Verified ninja files didn't change on aosp_arm64-userdebug
Change-Id: I030991f91c326669b7b7e73b8171da4b2a68cbb4
2023-01-10 11:38:40 -08:00
Paul Duffin
d6dd6a3c56 Merge changes I55dc71d2,I250ee4e1
* changes:
  Avoid separate call to module factory to create conditional properties
  Test using soong_config_module_type with singleton module type
2023-01-10 10:42:06 +00:00
Paul Duffin
0c79abc971 Merge "Dedup registration of Soong config module types" 2023-01-10 10:33:22 +00:00
Cole Faust
483d1f7a6b Remove SourcePath.srcDir
This was always set to "." after aosp/1652613 and
aosp/1796650. While doing some rudimentary performance
profiling of soong, it turned out that SourcePath.String()
was taking 600+MB of memory joining the "." to the rest
of the path. Remove it for performance gains.

Bug: 262629589
Test: Verfied ninja files didn't change with this cl on aosp_arm64-userdebug
Change-Id: Id6b552ab8defe37e0c2b58e813fb1dbae427ae96
2023-01-09 14:35:27 -08:00
Alix
7c8eaebc4f java_binary with kotlin sources
Test:  bp2build conversion tests and inspected build file for AnalyzerKt
Change-Id: I0f6d5c3d371a9dbd000b74144ad68d5d8bd156cf
2023-01-09 20:09:37 +00:00
Paul Duffin
e8b4768134 Avoid separate call to module factory to create conditional properties
Previously, the soong_config_module_type (and related module types)
would make a special call to the module factory of the module type
being customized to get the properties from which it created the
conditional properties. That caused problems when trying to customize
a singleton module. See the bug for more details.

This change avoids that special call by deferring the creation of the
conditional properties struct until just after the
soong_config_module_type's factory function calls the customized module
factory to create the module and properties. The properties are then
used to create the conditional properties struct avoiding the extra
factory call.

The conditional properties struct is only created once per module type
that soong_config_module_type (and related module types) creates.

Bug: 264876909
Test: m nothing
Change-Id: I55dc71d2553cb59d921a96c6458d0bc877512bbb
2023-01-09 16:49:00 +00:00
Paul Duffin
f1e6a048d0 Test using soong_config_module_type with singleton module type
Singleton module types have some special behavior that can cause
problems when trying to extend them with soong_config_module_type so
this adds some tests of how they work together.

Currently, the tests show that they do not work together, a follow up
change will correct that.

Bug: 264876909
Test: m nothing
Change-Id: I250ee4e18b3c04d1c91808f55722da74b813a570
2023-01-09 16:48:56 +00:00
Paul Duffin
3229998d37 Dedup registration of Soong config module types
Bug: 264876909
Test: m nothing
Change-Id: I467a2090b32438cbbf88bbb453bb4960757ec37a
2023-01-09 16:48:46 +00:00
Treehugger Robot
aceb04fb1b Merge "Remove memberDepsMutator, SdkAware et al" am: 351ca9aa81 am: 8f2dfe4dea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2314941

Change-Id: I6cc1c7e6d784fc1f58f49cf9d8faed384c913c3c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-07 15:41:54 +00:00
Treehugger Robot
0bba2d1ef1 Merge changes I07db8afc,Ia89e0239 am: 4520481c6a am: 8054072814
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2318638

Change-Id: Ia6b00e270390237cbb2491655aef19d0e7711d23
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-07 15:41:44 +00:00
Treehugger Robot
f10e829b94 Merge "Remove SdkAware.SdkMemberComponentName" am: 3c867b6ce8 am: 711b970c56
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2318637

Change-Id: I05fd6c8faa662b24b50c5bd059639c5873eb0fc6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-07 15:41:33 +00:00
Treehugger Robot
351ca9aa81 Merge "Remove memberDepsMutator, SdkAware et al" 2023-01-07 14:51:43 +00:00
Treehugger Robot
4520481c6a Merge changes I07db8afc,Ia89e0239
* changes:
  Stop module types being SdkAware
  Replace usages of SdkAware in sdk module with Module
2023-01-07 14:46:22 +00:00
Treehugger Robot
3c867b6ce8 Merge "Remove SdkAware.SdkMemberComponentName" 2023-01-07 14:36:24 +00:00
Cole Faust
392ba475f0 Merge "Bp2build support for multiple product configs" am: 501a7976be am: 25ba48a5ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2316418

Change-Id: I11ba1c9246a4bf79097f6dd0c30611a306c407b6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-07 04:12:48 +00:00
Cole Faust
501a7976be Merge "Bp2build support for multiple product configs" 2023-01-07 03:09:08 +00:00
Paul Duffin
fe6cc5b133 Merge "Remove IsModuleInVersionedSdk" am: e76fa00998 am: 377dae0a30
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2318636

Change-Id: I01f2bdb3b24e2ed7ed6378c2fc06fd8a809b1f15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-06 23:45:36 +00:00
Paul Duffin
e76fa00998 Merge "Remove IsModuleInVersionedSdk" 2023-01-06 22:37:59 +00:00
Sam Delmerico
290d17f7fd bp2build converts android.hardware.audio AIDL am: a2cccc3926 am: a7282fb5b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2376316

Change-Id: Ib9c538d66bfb3f6e1d36048b30b9476c7c6c705b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-06 02:54:07 +00:00
Sam Delmerico
a2cccc3926 bp2build converts android.hardware.audio AIDL
Test: build --config=android //hardware/interfaces/audio/aidl:android.hardware.audio.effect-V1-ndk_aidl_code_gen
Change-Id: I55764604fbed4e40dd85b1e2fd1491fa043c92f8
2023-01-05 16:55:28 -05:00
Cole Faust
b85d1a15cc Bp2build support for multiple product configs
Create a
build/bazel/product_config/generated/products/<product_name>/BUILD
file that contains the platform definitions needed for
a particular product. Currently we just create it for the
current lunch target, but the idea is that eventually when
all product config is in starlark, all the products will
have their platform definitions in the tree at once.

Bug: 249685973
Test: Presubmits
Change-Id: I08c82ff28dcf62f09d3b1d2e3186a6b961e12f6e
2023-01-05 12:49:14 -08:00
Paul Duffin
74fec4396f Merge "Stop changes to BAZEL_METRICS_DIR regenerating ninja file" am: 58f7784e95 am: 27139a1412
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2366149

Change-Id: Ib55774e848185be19defb9351859a9590c2f2d68
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-05 19:32:03 +00:00
Paul Duffin
58f7784e95 Merge "Stop changes to BAZEL_METRICS_DIR regenerating ninja file" 2023-01-05 18:02:10 +00:00
Cole Faust
1e905903ea Merge "Use WriteFileRule instead of custom echo commands" am: da5e739628 am: ce8d7f6d71
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2362261

Change-Id: Ia8861a4bf7bc8212de4f83d14b61e9f85ab33b4c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-04 20:38:01 +00:00
Paul Duffin
184366a18f Stop changes to BAZEL_METRICS_DIR regenerating ninja file
Bug: 262738679
Test: BAZEL_METRICS_DIR=dir1 m nothing
      BAZEL_METRICS_DIR=dir2 m nothing
      # Make sure that the second does not regenerate the ninja file.
Change-Id: If30f13eee5d27d902c894af04af38078f437b6df
2023-01-04 10:55:20 +00:00
Cole Faust
a734749148 Use WriteFileRule instead of custom echo commands
These instances could use WriteFileRule instead of
making their own shell code to write a file.

Test: Presubmits
Change-Id: I9c809b2164a68b4ce1c22fbbd0d7497240110b39
2023-01-03 14:42:23 -08:00
Spandan Das
5c8b2611bd Merge "Create (API) bp2build converters for droidstubs" am: 87c149dccb am: be85f83fa3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2322300

Change-Id: Ib4c7a32e94d3af8d9a8284913dcff7fb105142c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-29 19:01:04 +00:00
Zi Wang
59929b0e9f Merge "Add variant_prepend test for cc_library" am: 60adbe233e am: b3af712c7a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2370191

Change-Id: I1aef57c78c1076dcc3a498ae4d1b872481be5e53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-29 19:00:44 +00:00
Spandan Das
87c149dccb Merge "Create (API) bp2build converters for droidstubs" 2022-12-29 17:58:45 +00:00
Spandan Das
4ac2aed136 Create a "Toolchain" API surface
This creates a new API surface for the APIs provided by ART to compile
other API domains (e.g. this contains LambdaMetaFactory). The scope of
this API surface is restricted to compile-time. Unlike the other API
surfaces (e.g. public) whose APIs will exist on device in the form of
implementation libraries, these classes are not guaranteed to exist on
device.

This also updates the naming convention map used in Multi-tree API
export

Bug: 261244752
Test: TH
Change-Id: I164714d68618a3c289bac1a695958e36fdbbda5d
2022-12-28 23:58:55 +00:00
Spandan Das
0b555e323b Create (API) bp2build converters for droidstubs
- The converter runs for api_bp2build, not bp2build workspace
- Since droidstubs is an internal module created by java_sdk_library,
  the conversion encompasses the latter as well
- Since droidstubs do not have an api_surface attribute, this conversion
  uses naming convention to infer the api_surface represented by the api
  file e.g. *stubs.source -> publicapi, *stubs.source.system -> systemapi)
- Also adds an SdkIntraCore enum to represent the API surface provided
  by one core module to another

There is also ongoing work to check in java_api_contribution modules in
Soong. Once we have that, we can update this converter to operate on
that module type instead

Test: go test ./bp2build
Change-Id: Ia85828e04c738d9ffcc524856d7c3034ee29bbf9
2022-12-28 23:58:52 +00:00
Zi Wang
0f82844b75 Add variant_prepend test for cc_library
The comments in aosp/2336916 are also addressed here

Test: TH and TestCcLibraryVariantPrependPropOrder
Change-Id: If1472658fcd4b5544dec2e2691049a180520c84e
2022-12-28 11:18:11 -08:00
Yu Liu
67810eb926 Merge "We now support native code coverage in mixed build." am: acb884e2da am: 526ffcbeea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2366500

Change-Id: Ie5c026cb3ebccd39c8fbc77270d8748c49974122
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-22 20:55:10 +00:00
Yu Liu
acb884e2da Merge "We now support native code coverage in mixed build." 2022-12-22 19:31:05 +00:00
Treehugger Robot
2a3432e15a Merge "Swap error before setting to prevent nil error" am: aebab397b3 am: f83163f77f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2366948

Change-Id: Ic2f10a7ed82c33705ec36681227a9592ebb8a670
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-22 09:20:48 +00:00
Treehugger Robot
aebab397b3 Merge "Swap error before setting to prevent nil error" 2022-12-22 08:12:06 +00:00
Yu Liu
482b0ecb80 We now support native code coverage in mixed build.
Bug: 233660582
Test: None
Change-Id: Ied34189293d754256a0f69a8473f77a5d27597ea
2022-12-21 14:31:43 -08:00
Colin Cross
e92a183394 Merge changes I47b8fdd9,Ifbd121ab am: 62e4fe15dc am: d89cb23df2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2360867

Change-Id: I62e25fd1b329baad958ee761650f5e7161f490e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-21 20:58:39 +00:00