Commit graph

2159 commits

Author SHA1 Message Date
Alix
ab1bac0e12 changed newLocation option to be new-location in bpmodify
This is more consitant with other options in bpmodify

Test: ran manually
Change-Id: Ia0d267bdd3c67c53e72ef6556ff253eab0ae9a68
2022-08-05 14:27:54 +00:00
Chris Parsons
c2753f9bfa Fix bpmodify Android.bp definition
With this fix, running `m bpmodify` will correctly generate a go binary
at out/host/linux-x86/bin/bpmodify, after running tests in
bpmodify_test.go.

Test: m bpmodify
Change-Id: I42be5a366891b51a559d39d72d2b013e3a115492
2022-08-02 15:25:59 -04:00
Alix
145d5a8c83 added moveProperty contents functionality to bpmodify
bpmodify can know move the contents of a property into another
property using moveProperty. After moving the contents, the original
property is deleted.

Bug: 226636335
Change-Id: Id68d11d59f00909b4c93aa78666d14f433f236fb
Test: manually ran on several Android.bp files in bug 226636335
2022-07-25 19:38:40 +00:00
Lukacs T. Berki
e76d4122ee Add godoc for TransitionMutator.
Test: Presubmits.
Change-Id: I5eba0a4f4d4653a36ff52ed81ee101461ff92b5d
2022-06-27 08:51:58 +02:00
Bob Badour
2a62643266 Add NinjaAndShellEscapeIncludingSpaces
Bug: 235333302

Test: m droid dist
Change-Id: Ic52fbdb64042148d851403b4afd2dd5392282f77
2022-06-21 11:10:16 -07:00
Lukacs T. Berki
eb641de659 Implement transition mutators.
These are more limited than bottom-up or top-down mutators but in
exchange have some pleasant properties:

- "variant not found" errors are impossible
- The logic is pleasantly split into multiple, mostly orthogonal
  parts
- Theoretically, if every mutator is refactored like this, they
  make it possible to partially cache the module graph
- Are quite close to a "configuration transition" in Bazel.

Bug: 231370928
Test: Presubmits.
Change-Id: Idcdb66b5ea75c0d2838f527aaa988df3b12553d8
2022-06-17 17:51:04 +02:00
Usta Shrestha
0ca2d0cb67 recommend a EventHandler.Do() am: 2a95e590b6
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2095267

Change-Id: Id932c62693ec48b264d855a0cdf7559718f00b81
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-31 16:11:02 +00:00
Usta Shrestha
2a95e590b6 recommend a EventHandler.Do()
Test: manually verified equivalence
Bug: N/A
Change-Id: I2a5abd5b1230ab1f1b5851672e80833c5d18d5c7
2022-05-27 15:39:16 -04:00
Treehugger Robot
13a7388e46 Merge "Allow users to specify extra json action data" am: 57d5937e6f
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2108469

Change-Id: I60c17451481ca3955e0f18270d531c773c0fd14e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 13:53:20 +00:00
Treehugger Robot
57d5937e6f Merge "Allow users to specify extra json action data" 2022-05-27 13:29:54 +00:00
Liz Kammer
d625c97587 Allow users to specify extra json action data
Test: m json-module-graph and validate output
Change-Id: I7ff7c2c98e49f515efb19845aa3a860e14360a32
2022-05-26 16:17:35 -04:00
Treehugger Robot
fcfc7e2f1a Merge "Add info to json module graph about CreateModule" am: 54c00c6618
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2085745

Change-Id: I3d72faa70682212c5f76cff0f513c208698bd130
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 19:45:19 +00:00
Treehugger Robot
54c00c6618 Merge "Add info to json module graph about CreateModule" 2022-05-24 19:20:28 +00:00
Christopher Parsons
94222dc0f7 Merge "Support pre-build-action hook in blueprint" am: df4ad24151
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2094704

Change-Id: Iea76743f2ae4fa3e5691092722f956df49d201cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 15:52:30 +00:00
Christopher Parsons
df4ad24151 Merge "Support pre-build-action hook in blueprint" 2022-05-20 14:13:49 +00:00
Bob Badour
1739902dcf Allow deferred module build action generation. am: 67a6d702d1
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2099161

Change-Id: I98824aff0318e2923515327ab165d7f4c4dd408a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 18:47:56 +00:00
Bob Badour
67a6d702d1 Allow deferred module build action generation.
Provide a means to generate build actions for modules from within the
later singleton context. Allows modules to depend on the metadata for
arbitrary modules without causing dependency cycles.

Care needs to be taken to establish all metadata during the normal
module GenerateBuildAction to avoid synchronization issues and only
use read-only access to modules from the singleton context.

Bug: 213388645

Change-Id: I82ed218926b1d8fbe2edde6d55c4bf40ea0d8618
2022-05-18 17:59:16 -07:00
Treehugger Robot
4bb43ed7a2 Merge "Add a filelock for in-place case" am: cdbab1ea51
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2092123

Change-Id: Ic1fecda84792216985d366c40e2b8afbecfdf58c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 19:50:05 +00:00
Chris Parsons
91f638f692 Support pre-build-action hook in blueprint
This allows for a bazel-invocation hook in mixed builds, which allows
for mixed builds to take place in only a single pass, greatly improving
its performance and complexity.

Test: Conjunction with build/soong CL
Change-Id: If89fb56830b4eb06d3263d6ca6da7b285e7ba315
2022-05-10 13:46:40 -04:00
Treehugger Robot
cdbab1ea51 Merge "Add a filelock for in-place case" 2022-05-10 04:06:52 +00:00
Jeongik Cha
28c7996f2c Add a filelock for in-place case
Multiple bpmodify process on the same Android.bp can run in parallel in
the case of aidl-freeze-api.

So, add a file lock for in-place editing case(-w)

Bug: 229413853
Test: run bpmodify in parallel and check result
Change-Id: I5368b0304b59f34fff60025120b38cc5f615ac40
2022-05-10 01:30:08 +00:00
Liz Kammer
72848a40d8 Rename jsonVariationMap to jsonVariations. am: c6d80893cb
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2075942

Change-Id: I0bdab16aac2d2c4b6000d9553f2e58634eba89c6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 15:09:11 +00:00
Liz Kammer
0cd0d4fbbc Add info to json module graph about CreateModule
Blueprint already stores the module that called CreateModule, let's
surface it.

Test: m json-module-graph and view results
Change-Id: Ie67bf8e431d764eb23727c90200f57c9de4ab053
2022-05-03 10:49:10 -04:00
Liz Kammer
c6d80893cb Rename jsonVariationMap to jsonVariations.
Test: m json-module-graph
Change-Id: I99663586ded4c5d7c0f61859292afbcf80a1e526
2022-05-03 12:33:02 +00:00
Treehugger Robot
6d5c00183d Merge "Update CreateModule to require a type name" am: 5208ee885c
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2075941

Change-Id: I4cf841f573e5315fdf468ca9ac79ad5f433419c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 17:27:49 +00:00
Treehugger Robot
5208ee885c Merge "Update CreateModule to require a type name" 2022-04-27 16:00:35 +00:00
Liz Kammer
9967d62fad Update CreateModule to require a type name
This makes the LoadHook and TopDownMutatorContext interfaces for
CreateModule the same.

Test: CI
Change-Id: I30122099bdf109cda40f9d81a574dd6fa861f459
2022-04-26 09:15:13 -04:00
Lukacs T. Berki
85011ed22a Remove the concept of "early mutator". am: 83a5a308b1
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2067144

Change-Id: Idef83a405d9f5be0fdeb198a72440aa15c0c42b8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-20 07:16:49 +00:00
Lukacs T. Berki
83a5a308b1 Remove the concept of "early mutator".
It was unused and as such, maintenance cost for no benefit.

Test: Presubmits.
Change-Id: Ifc35c0f55647ef88ed0bfa44bcf709e51a904ea4
2022-04-19 18:12:03 +02:00
Liz Kammer
465668494e Change jsonVariationMap to array of struct am: 8097d1a0e6
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2059708

Change-Id: Ie33f624c729e4dccc338361ac2da1334a74bb2c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-11 12:48:53 +00:00
Liz Kammer
8097d1a0e6 Change jsonVariationMap to array of struct
This more structured data is easier to query

Test: m json-module-graph & look at the graph
Change-Id: I44ba6a8df12208705f37ee6908ad5391a6f404a1
2022-04-08 13:14:13 -04:00
Treehugger Robot
ccd4224c8a Merge "Add event handling to blueprint for metrics" am: 0d2386c60a am: 588582db8a
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2043864

Change-Id: I8cc05142308c57fe3fd508fca8bb96f342eb8a32
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-26 00:54:03 +00:00
Treehugger Robot
588582db8a Merge "Add event handling to blueprint for metrics" am: 0d2386c60a
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2043864

Change-Id: Iac29ec571d3633869047716a6607e0c8212b5f91
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-26 00:37:56 +00:00
Treehugger Robot
0d2386c60a Merge "Add event handling to blueprint for metrics" 2022-03-26 00:21:21 +00:00
Chris Parsons
18ebb2318a Add event handling to blueprint for metrics
In conjunction with soong/build changes, this materialized runtime
metrics for various soong_build events.

Test: Manually verified materialized protos for bp2build, mixed builds,
and legacy build.

Change-Id: Ia92403605e3063028dbf6a1ded8449c190b9e63e
2022-03-25 13:15:17 -04:00
Treehugger Robot
92d62e820c Merge "force LoadHookContext to specify module type" am: 310b0cec5d am: e1c02fcc8f
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2018479

Change-Id: I5530afd6555cf0dc44e91517957d64f5363f5d27
2022-03-11 00:27:08 +00:00
Treehugger Robot
e1c02fcc8f Merge "force LoadHookContext to specify module type" am: 310b0cec5d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2018479

Change-Id: I91aee3cdf30c47302a2dbe0b0023c6c2dc97f248
2022-03-11 00:03:22 +00:00
Treehugger Robot
310b0cec5d Merge "force LoadHookContext to specify module type" 2022-03-10 23:37:08 +00:00
Sam Delmerico
518966d09e force LoadHookContext to specify module type
Modules created by a LoadHookContext do not currently set a module type
when creating new modules, but it would make analysis of the
module-graph.json much easier if this module type information was available.

Bug: 174879786
Test: m json-module-graph && check that module which previously had a
    blank module type now have the field populated
Change-Id: Ie2fa4244113b6254e6678da9a663d883e2a48a41
2022-03-09 20:50:48 +00:00
jiajia tang
1ee93e7dc8 Fix duplicate typo am: eb27645af9 am: 7fb64499c8
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2015036

Change-Id: I898fbac4b55919b6a3804064e8fadf87191b4ebd
2022-03-08 22:15:09 +00:00
jiajia tang
7fb64499c8 Fix duplicate typo am: eb27645af9
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2015036

Change-Id: I9f471d0db71f250b2d4791e62ae40d5e1802a25d
2022-03-08 21:48:01 +00:00
jiajia tang
eb27645af9 Fix duplicate typo
Comments typo fix

Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
Change-Id: I89bf5aa5a3a57cda4b1e74195894341f9089e11c
2022-03-08 19:50:09 +08:00
Jeongik Cha
ce15d515d3 bpmodify: remove-property am: 5860caea33 am: 7f6948364f
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1977929

Change-Id: I758373a11d68afcb8fe4fa7cd6465ebe8b0ccaa6
2022-02-14 04:24:26 +00:00
Jeongik Cha
7f6948364f bpmodify: remove-property am: 5860caea33
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1977929

Change-Id: Id817d44f9aa68665e310eb7dc61985e1065bb9e6
2022-02-14 04:06:49 +00:00
Xin Li
34c0e50293 [automerger skipped] Empty merge of sc-v2-dev-plus-aosp-without-vendor@8084891 am: 17c110c581 -s ours
am skip reason: Merged-In Ie32bc2a0d075b1b7cc9fe1247d1f02dc1af67449 with SHA-1 5319d07308 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/blueprint/+/16843586

Change-Id: I47b927111aeb64ad2ea447d8f91cd46d3262c2bf
2022-02-11 20:34:10 +00:00
Xin Li
17c110c581 Empty merge of sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: Ie32bc2a0d075b1b7cc9fe1247d1f02dc1af67449
Change-Id: I067e17c8207a4d9072bc259496759f954ffd693d
2022-02-11 06:10:32 +00:00
Jeongik Cha
5860caea33 bpmodify: remove-property
`r` option removes only item(s) in a list, so add `remove-property`
option to remove a property itself.

Bug: 146436251
Test: unittest
Change-Id: I0c838d31e72358f094cfb5fa9468dce07018e061
2022-02-11 05:54:33 +00:00
Jooyung Han
724340527a bpmodify: -add-literal to add a value to the list am: 451dd63611 am: 34f9c28f0f am: 94474d68bb
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1977927

Change-Id: I0bb4dbab747a6d4fc41d3e53f2822a0d3c3b9315
2022-02-11 00:45:54 +00:00
Jooyung Han
a485b36980 Add newlines around list of structs am: 0cb1064428 am: d5be0c1c66 am: 2f36907173
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1977926

Change-Id: Iceac1665f992325d36e5ea26b40c58f5aec33019
2022-02-11 00:45:53 +00:00
Jooyung Han
94474d68bb bpmodify: -add-literal to add a value to the list am: 451dd63611 am: 34f9c28f0f
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1977927

Change-Id: Ief368d04be77b6828338fcbb68d1bfc75bd1659d
2022-02-11 00:30:19 +00:00