platform_build_soong/scripts/Android.bp
Jooyung Han 04329f131a Add jsonmodify tool
This tool is used to modify apex_manifest.json when building apex
module.

Here's the usage:

usage: jsonmodify [-h] [-o output] [-v path value] [-s path value]
                     [-r path] [-a path [value ...]]
                     [input]

positional arguments:
  input                 JSON file

optional arguments:
  -h, --help            show this help message and exit
  -o output, --out output
                        write result to a file. If omitted, print to stdout
  -v path value, --value path value
                        set value of the key specified by path. If path
                        doesn't exist, creates new one.
  -s path value, --replace path value
                        replace value of the key specified by path. If path
                        doesn't exist, no op.
  -r path, --remove path
                        remove the key specified by path. If path doesn't
                        exist, no op.
  -a path [value ...], --append_list path [value ...]
                        append values to the list specified by path. If path
                        doesn't exist, creates new list for it.

Bug: 138695532
Test: m jsonmodify
Test: echo {} | jsonmodify -v name hello -a list.nested a b c
{
  "name": "hello",
  "list": {
    "nested": [
      "a",
      "b",
      "c"
    ]
  }
}

Change-Id: I2cd043c614b3ad2306a0c27ccee302633c6d2525
2019-08-02 00:08:05 +09:00

87 lines
1.5 KiB
Text

python_binary_host {
name: "manifest_fixer",
main: "manifest_fixer.py",
srcs: [
"manifest_fixer.py",
"manifest.py",
],
version: {
py2: {
enabled: true,
},
py3: {
enabled: false,
},
},
}
python_test_host {
name: "manifest_fixer_test",
main: "manifest_fixer_test.py",
srcs: [
"manifest_fixer_test.py",
"manifest_fixer.py",
"manifest.py",
],
version: {
py2: {
enabled: true,
},
py3: {
enabled: false,
},
},
test_suites: ["general-tests"],
}
python_binary_host {
name: "manifest_check",
main: "manifest_check.py",
srcs: [
"manifest_check.py",
"manifest.py",
],
version: {
py2: {
enabled: true,
},
py3: {
enabled: false,
},
},
}
python_test_host {
name: "manifest_check_test",
main: "manifest_check_test.py",
srcs: [
"manifest_check_test.py",
"manifest_check.py",
"manifest.py",
],
version: {
py2: {
enabled: true,
},
py3: {
enabled: false,
},
},
test_suites: ["general-tests"],
}
python_binary_host {
name: "jsonmodify",
main: "jsonmodify.py",
srcs: [
"jsonmodify.py",
],
version: {
py2: {
enabled: true,
},
py3: {
enabled: false,
},
}
}