This is treated similar to other set commands, but add a single boolean
value to the property.
Test: bpmodify_test.go
Test: bpmodify -d -m android.hardware.drm -property frozen -set-bool
false Android.bp
Test: Same command above with "true" "misspelled" "1" for -set-bool
Bug: 231903487
Change-Id: I598da41a38409877af410f9715838d86b0873173
Test: go run bpmodify.go -w -m=libcore-memory-metrics-tests -property=something,static_libs,deps,required,test_suites -replace-property=ahat:ahat_lib,general-tests:something -s ~/aosp-master-with-phones/libcore/metrictests/memory/host/Android.bp
go test -v
Change-Id: I005b6dd675beb205f544e89c729fe9191e6470c2
`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
-a works with only string values. When we need to add numbers, booleans,
or even structs, -add-literal can be used now.
bpmodify -m foo -property list-of-ints -add-literal 123
bpmodify -m foo -property list-of-structs \
-add-literal "{key: \"value\"}"
Bug: 146436251
Test: go test ./bpmodify
Change-Id: I91d23d7bf89491643aa595f5ebccd9410a9cbb09
Make TestProcessModule use subtests, give the tests names, and
use named fields in the testcase struct.
Test: bpmodify_test.go
Change-Id: I85345bd419e4c3ccf0050b7efae0479dd03d8bea
bpmodify sorts touched list respecting numbers embedded in strings. For
example, "foo-2" comes before "foo-10".
Test: bpmodify_test.go
Change-Id: If2fe9bc871a463a47dd3c0b52982b34c9fde05f0
Co-authored-by: Jooyung Han <jooyung@google.com>
Add an option "-property", which is an alias to the option "-parameter".
For example if Android.bp contains:
cc_foo {
name: "foo",
}
Then `bpmodify -m foo -a bar -property baz.buz Android.bp` outputs:
cc_foo {
name: "foo",
baz: {
buz: ["bar"],
},
}
Bug: 149715904
Test: go test -v
Change-Id: I9660cff1b5239ccf5aa9ef1a41835b8ac6cd4b9f