Chromium change: https://chromium.googlesource.com/chromium/src/+/4ad0ea2a806d6241a9fbbae0515727bde0879ad5 commit 4ad0ea2a806d6241a9fbbae0515727bde0879ad5 Author: dpapad <dpapad@chromium.org> Date: Tue Apr 19 17:15:07 2022 +0000 Grit: Migrate update_resource_ids from getopt to argparse.ArgumentParser This is in preparation of passing grit_defines to update_resource_ids, which requires more complex command line parsing (recurring arguments), and is easier to consume via ArgumentParser's action='append' feature. Bug: 1316544
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
# Copyright 2022 The Brave Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
import("//brave/resources/brave_grit.gni")
|
|
import("//build/config/compute_inputs_for_analyze.gni")
|
|
|
|
action("brave_resource_ids") {
|
|
script = "//tools/grit/grit.py"
|
|
inputs = [ "resource_ids.spec" ]
|
|
outputs = [ brave_grit_resource_id_file ]
|
|
deps = [ "//tools/grit:grit_sources" ]
|
|
depfile = "$target_gen_dir/$target_name.d"
|
|
_rebased_input = rebase_path(inputs[0], root_build_dir)
|
|
args = [
|
|
"update_resource_ids",
|
|
"-o",
|
|
rebase_path(brave_grit_resource_id_file, root_build_dir),
|
|
"--add-header",
|
|
"--depfile",
|
|
rebase_path(depfile, root_build_dir),
|
|
"--input",
|
|
_rebased_input,
|
|
]
|
|
|
|
if (compute_inputs_for_analyze) {
|
|
_depfile_inputs = exec_script(script,
|
|
[
|
|
"update_resource_ids",
|
|
"--analyze-inputs",
|
|
"--input",
|
|
_rebased_input,
|
|
],
|
|
"list lines")
|
|
inputs += rebase_path(_depfile_inputs, ".", root_build_dir)
|
|
}
|
|
}
|