Commit Graph

48135 Commits

Author SHA1 Message Date
Treehugger Robot
1a8394b6de Merge changes Ie5939628,Id103f70f am: d519b331f2 am: 6aa1338f6c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1963154

Change-Id: I5c8fbed7690dd4e39ed0314df9a2004794b9ce90
2022-02-02 18:24:55 +00:00
Treehugger Robot
6aa1338f6c Merge changes Ie5939628,Id103f70f am: d519b331f2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1963154

Change-Id: Ib6df523c3d8847eec27deb5ed7de27ff58c519a0
2022-02-02 18:12:16 +00:00
Treehugger Robot
d519b331f2 Merge changes Ie5939628,Id103f70f
* changes:
  Only output annotations properties in snapshots for T+
  Allow pruning of unsupported fields in structs in maps
2022-02-02 17:43:57 +00:00
Paul Duffin
635a71352c Merge "Refactor build_release and test code" am: 8af15e0297 am: bfb9f280c6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1963152

Change-Id: I5b6060671342ba308e58ddc5cd12e81ed6148d03
2022-02-02 16:09:06 +00:00
Paul Duffin
bfb9f280c6 Merge "Refactor build_release and test code" am: 8af15e0297
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1963152

Change-Id: Id5e368f806a637701f73cb530364340fc5efd18c
2022-02-02 15:56:25 +00:00
Paul Duffin
8af15e0297 Merge "Refactor build_release and test code" 2022-02-02 15:36:18 +00:00
Sam Delmerico
ab2fb64e8f Merge changes I09902215,I4f86780c am: ca1701f518 am: 1a55f241a3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1963619

Change-Id: I4d3ca3fbebf2e7fe47bc9f517c481411375e6588
2022-02-02 15:06:06 +00:00
Sam Delmerico
1a55f241a3 Merge changes I09902215,I4f86780c am: ca1701f518
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1963619

Change-Id: I48f4fd9946f6c0ffcfd537a3ecfa3348e7d5bfd9
2022-02-02 14:45:42 +00:00
Sam Delmerico
ca1701f518 Merge changes I09902215,I4f86780c
* changes:
  convert java_plugin with bp2build
  convert java static dependencies
2022-02-02 14:27:32 +00:00
Sam Delmerico
c06ea03c9e convert java_plugin with bp2build
Also, because java_plugin is only intended to be built for the host
platform to make additions to the javac compiler, a compatibility
requirement is added to java_plugin that ensure that it is not built
for android targets.

Bug: 215229742
Test: go test ./bp2build
Change-Id: I09902215a9f1e8b14d4de5a51328d08a7a0a4450
2022-02-01 22:59:19 +00:00
Sam Delmerico
fde9fb5c9c convert java static dependencies
This commit enables conversions of java_library_static and adds the
static_deps Soong attribute to Bazel deps for all Java libraries.
Currently, Soong handles static dependencies for Java differently, and
Bp2build may need to address that later (see b/217236083).

Bug: 215229742
Test: go test ./bp2build
Change-Id: I4f86780c634dca0a2cfb9294084b14e139cc2375
2022-02-01 22:59:04 +00:00
Cole Faust
e7c0691f31 Merge "Allow variable-prefixed include statements in mk2rbc" am: f8a4bb6d7f am: 87cdd48d55
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1962181

Change-Id: Ica0dd8f502b0aae780895196f7f4cadb5f469556
2022-02-01 19:26:10 +00:00
Cole Faust
87cdd48d55 Merge "Allow variable-prefixed include statements in mk2rbc" am: f8a4bb6d7f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1962181

Change-Id: I27f6d098d83bd4c99e3a25f891b1ee72b4292d82
2022-02-01 19:02:46 +00:00
Cole Faust
f8a4bb6d7f Merge "Allow variable-prefixed include statements in mk2rbc" 2022-02-01 18:44:28 +00:00
Gurpreet Singh
95068d632f Merge "Add testOnly attribute to AndroidManifest file of apex_test" am: ac0a9b00a4 am: dc3ffc8c3a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1959021

Change-Id: Ia75b0223924a6b38225e881d1d0346533b9984ad
2022-02-01 15:01:40 +00:00
Gurpreet Singh
dc3ffc8c3a Merge "Add testOnly attribute to AndroidManifest file of apex_test" am: ac0a9b00a4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1959021

Change-Id: Iac9dd6f860368fd8f9d8cf554fba376fd091207c
2022-02-01 14:44:10 +00:00
Gurpreet Singh
ac0a9b00a4 Merge "Add testOnly attribute to AndroidManifest file of apex_test" 2022-02-01 14:25:16 +00:00
Gurpreet Singh
75d65f360c Add testOnly attribute to AndroidManifest file of apex_test
If the build file contains the apex_test module, add the
testOnly attribute to the application element of the
corresponding AndroidManifest file and set its value to true.
If the testOnly attribute is already present and has value
false, then do nothing.

Tests added in manifest_fixer_test.py to check if the updated
AndroidManifest file has the testOnly attribute set to true or not.

Bug: 213310150
Test: atest --host manifest_fixer_test
Test: m nothing
Test: manually checked the AndroidManifest file generated
Change-Id: I36247dbe0261c342d451a4422c314fd8fe0c2369
2022-02-01 12:03:48 +00:00
Treehugger Robot
f59ea3c29a Merge "Remove variableDefinedExpr" am: 6a21d959e5 am: 88720b9807
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1963693

Change-Id: Ia8ae5164509f94e7bc4e1c6cd780e8e765b3ddc2
2022-02-01 04:42:12 +00:00
Treehugger Robot
88720b9807 Merge "Remove variableDefinedExpr" am: 6a21d959e5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1963693

Change-Id: I69cef5d616f3b0bf1023f663e3cd716b2cee562c
2022-02-01 04:29:21 +00:00
Treehugger Robot
6a21d959e5 Merge "Remove variableDefinedExpr" 2022-02-01 04:16:02 +00:00
Usta Shrestha
8a144a3d88 Merge "redundant statement" am: aab5e87431 am: fd551d0ba2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965383

Change-Id: I43a17b31c44bc004d38f7e51c60f267cf99c7f30
2022-02-01 02:50:17 +00:00
Usta Shrestha
fd551d0ba2 Merge "redundant statement" am: aab5e87431
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965383

Change-Id: I8e829be715eac6a16ee812f70821fbba88bdb47e
2022-02-01 02:31:53 +00:00
Usta Shrestha
aab5e87431 Merge "redundant statement" 2022-02-01 02:17:46 +00:00
Yuntao Xu
ba5406c24e Merge "Add LOCAL_GENERATED_SOURCES to androidmk" am: 844d8f52d6 am: e52f480a74
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965345

Change-Id: I38c03d4d2ddb3fae87b8f59db0d7dfa9336e793f
2022-02-01 00:45:06 +00:00
Yuntao Xu
e52f480a74 Merge "Add LOCAL_GENERATED_SOURCES to androidmk" am: 844d8f52d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965345

Change-Id: Id5ae65e4b6ff1628996ca88863f66044c61525cf
2022-02-01 00:32:37 +00:00
Yuntao Xu
844d8f52d6 Merge "Add LOCAL_GENERATED_SOURCES to androidmk" 2022-02-01 00:12:26 +00:00
Treehugger Robot
211d8cd822 Merge changes from topic "sdk_repo_license" am: 97cffec54e am: 3e17f67a38
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965242

Change-Id: I5f94f0a6f6f7d831706c9d5ed6bc2b8e065fed5c
2022-02-01 00:03:26 +00:00
Rob Seymour
301f65b1b0 Merge "Fix host snapshot dependency cycle" am: 4012047331 am: ac283cbcd6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1966860

Change-Id: Id8f5c3953cf0b351beed8e50ecbb7557d99453bb
2022-02-01 00:03:15 +00:00
Treehugger Robot
3e17f67a38 Merge changes from topic "sdk_repo_license" am: 97cffec54e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965242

Change-Id: Ie0b4bcd695f089f2d1218b299fde22ee93d053ee
2022-01-31 23:45:11 +00:00
Rob Seymour
ac283cbcd6 Merge "Fix host snapshot dependency cycle" am: 4012047331
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1966860

Change-Id: I957c5d9f473d4ccaee7f01bf5d86cb8d19d3d82b
2022-01-31 23:44:45 +00:00
Cole Faust
069aba64f6 Allow variable-prefixed include statements in mk2rbc
mk2rbc was already searching the whole android tree
for Makefiles, so allowing variable-prefixed include
statements doesn't affect performance on the file searching
front. On the generated code front, there's already a cap
of 150 potentially-included makefiles that prevents the
performance from getting too bad, and it can be lowered
if necessary.

Bug: 213508006
Test: go test
Change-Id: I3a4e81acb3d97bee08ac3dbe63052a274acf5793
2022-01-31 15:35:28 -08:00
Treehugger Robot
97cffec54e Merge changes from topic "sdk_repo_license"
* changes:
  Generate sdk_repo notice files from license metadata
  Annotate more java dependencies for licensing
  Track transitive packaged license deps of containers
2022-01-31 23:34:59 +00:00
Rob Seymour
4012047331 Merge "Fix host snapshot dependency cycle" 2022-01-31 23:26:39 +00:00
Usta Shrestha
fcbda828ee Merge "cosmetic: 1)typos 2)parameters named for clarity" am: 36a0a138ab am: d2560c3efc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965382

Change-Id: Ia0036e2ed4ae1f93ab0797a19a1663c6113171e2
2022-01-31 21:03:07 +00:00
Usta Shrestha
d2560c3efc Merge "cosmetic: 1)typos 2)parameters named for clarity" am: 36a0a138ab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965382

Change-Id: Idab25c22f50b82863b05ceae4ec5e490b936c411
2022-01-31 20:41:09 +00:00
Rob Seymour
0800ef7007 Fix host snapshot dependency cycle
Test: m host-snapshot
Bug: 216351382
Change-Id: Iaa8b7e8373fab0db931cbe7a6328c2adca27d95b
2022-01-31 20:38:00 +00:00
Usta Shrestha
36a0a138ab Merge "cosmetic: 1)typos 2)parameters named for clarity" 2022-01-31 20:19:47 +00:00
Yuntao Xu
680478266b Add LOCAL_GENERATED_SOURCES to androidmk
Added the LOCAL_GENERATED_SOURCES support to the androidmk tool.

Bug: 216527541
Test: TreeHugger
Change-Id: I05b7aa4be6b50e405ec8ec15765d375a4626cc48
2022-01-31 11:54:43 -08:00
Kousik Kumar
3533396003 Merge "Support fetching config files from experiments fetcher binary" am: dedd43c7b9 am: 5965fcc09f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1962540

Change-Id: I2f802a72953d36a3280cbafabbf1a357193d9aa0
2022-01-31 19:13:02 +00:00
Kousik Kumar
5965fcc09f Merge "Support fetching config files from experiments fetcher binary" am: dedd43c7b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1962540

Change-Id: Ib6c590adabb2bba2fd4c46436c14b31b375a9c04
2022-01-31 18:57:09 +00:00
Kousik Kumar
dedd43c7b9 Merge "Support fetching config files from experiments fetcher binary" 2022-01-31 18:34:33 +00:00
Treehugger Robot
4cff831ac7 Merge "Adding metalava team to OWNERS to be able to disable metalava checks that will break platform build." am: b8df4b890c am: 0f89a61d36
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965539

Change-Id: I24af92c494a3a308b47f75344f969183607d75f8
2022-01-31 18:26:08 +00:00
Treehugger Robot
0f89a61d36 Merge "Adding metalava team to OWNERS to be able to disable metalava checks that will break platform build." am: b8df4b890c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1965539

Change-Id: I37badb057f6bd3919bd6584b8266b52263bd79df
2022-01-31 18:08:45 +00:00
Treehugger Robot
b8df4b890c Merge "Adding metalava team to OWNERS to be able to disable metalava checks that will break platform build." 2022-01-31 17:49:47 +00:00
Paul Duffin
a54016c3ba Only output annotations properties in snapshots for T+
Marks the `scopeProperties.AnnotationsZip` property as only being
supported on T builds and above.

Bug: 204763318
Test: m nothing
Change-Id: Ie59396287c08da77a6a1f15d4be202429e011e17
2022-01-31 12:28:04 +00:00
Paul Duffin
545c59273d Refactor build_release and test code
Minor restructuring of the build_release pruning code to make it easier
to add logic for handling fields of maps of structs. That includes:
1. Moving some code that is specific to clearing a selected field
   inside the associated if block.
2. Replacing an if with a switch.
3. Improving the error handling by separating the reporting of the
   container that broke from information about which field could not be
   set. That allows follow up code to provide information about the map
   key instead.

The tests were restructed by:
1. Switching from using AssertDeepEquals to compare the structs to
   comparing the output of marshalling the structs to JSON. That was
   for a couple of reasons. Firstly, because JSON will marshal (and so
   allow comparison of) the contents of pointers to structs whereas
   AssertDeepEquals will just compare the pointers themselves.
   Secondly, because JSON can pretty print the output and make it
   easier to read.
2. Using a func to create a new instance of the input structure for
   each test. That is to allow the test to modify the input structure,
   e.g. by clearing a field in a struct that is pointed to by a map.
   The test previously relied on the input structure being immutable
   and passed by value but a follow up change will change that by
   adding a map field that contains pointers to structs.

Bug: 204763318
Test: m nothing
Change-Id: I84dc99621497b7263e30466895b823eb02cb2b56
2022-01-31 12:28:04 +00:00
Paul Duffin
106a3a4bec Allow pruning of unsupported fields in structs in maps
Adds support for traversing into a field that is of type:
   map[...]*struct{...}

This is needed to allow java_sdk_library to mark scope specific
properties, e.g. public.annotations as being target build release
specific.

It was necessary to change the Scope field from:
   Scope map[*apiScope]scopeProperties
to:
   Scope map[*apiScope]*scopeProperties

That is because there is no way in go to change the field of a struct
value of a map. i.e. you cannot do the following, not even using
reflection:
   Scope[apiScopePublic].AnnotationsZip = nil

Bug: 204763318
Test: m nothing
Change-Id: Id103f70f55d4202971321ef4925cbec4b55f8136
2022-01-31 12:28:04 +00:00
Kousik Kumar
9cd2b998a5 Merge "Move env var config loading to be within the config package." am: 5ddefa3df4 am: 15747009b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1961101

Change-Id: I6f28e08165e1ebdfd6029c3ca221ccba960f6ac4
2022-01-31 05:13:52 +00:00
Kousik Kumar
15747009b8 Merge "Move env var config loading to be within the config package." am: 5ddefa3df4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1961101

Change-Id: I2e488240c4cab2b960049d1b1fe4373715fc3205
2022-01-31 04:59:35 +00:00