gn2bp: move get_action_sanitizer below code it references
Putting definitions ahead of their use aids top-down readability. This is a plain move without any other changes. Test: none Change-Id: I7c05b1bdae67e0db9d2e0b8f6eb89d7d037c0d89
This commit is contained in:
@@ -618,17 +618,6 @@ def create_proto_group_modules(blueprint, gn, module_name, target_names):
|
|||||||
|
|
||||||
blueprint.add_module(module)
|
blueprint.add_module(module)
|
||||||
|
|
||||||
def get_action_sanitizer(target):
|
|
||||||
if target.script == "//build/write_buildflag_header.py":
|
|
||||||
return WriteBuildFlagHeaderSanitizer(target)
|
|
||||||
elif target.script == "//build/write_build_date_header.py":
|
|
||||||
return WriteBuildDateHeaderSanitizer(target)
|
|
||||||
elif target.script == '//base/android/jni_generator/jni_generator.py':
|
|
||||||
return JniGeneratorSanitizer(target)
|
|
||||||
else:
|
|
||||||
# TODO: throw exception here once all script hacks have been converted.
|
|
||||||
return BaseActionSanitizer(target)
|
|
||||||
|
|
||||||
|
|
||||||
class BaseActionSanitizer():
|
class BaseActionSanitizer():
|
||||||
def __init__(self, target):
|
def __init__(self, target):
|
||||||
@@ -705,6 +694,17 @@ class JniGeneratorSanitizer(BaseActionSanitizer):
|
|||||||
return super().get_args()
|
return super().get_args()
|
||||||
|
|
||||||
|
|
||||||
|
def get_action_sanitizer(target):
|
||||||
|
if target.script == "//build/write_buildflag_header.py":
|
||||||
|
return WriteBuildFlagHeaderSanitizer(target)
|
||||||
|
elif target.script == "//build/write_build_date_header.py":
|
||||||
|
return WriteBuildDateHeaderSanitizer(target)
|
||||||
|
elif target.script == '//base/android/jni_generator/jni_generator.py':
|
||||||
|
return JniGeneratorSanitizer(target)
|
||||||
|
else:
|
||||||
|
# TODO: throw exception here once all script hacks have been converted.
|
||||||
|
return BaseActionSanitizer(target)
|
||||||
|
|
||||||
def create_action_foreach_modules(blueprint, target):
|
def create_action_foreach_modules(blueprint, target):
|
||||||
""" The following assumes that rebase_path exists in the args.
|
""" The following assumes that rebase_path exists in the args.
|
||||||
The args of an action_foreach contains hints about which output files are generated
|
The args of an action_foreach contains hints about which output files are generated
|
||||||
|
|||||||
Reference in New Issue
Block a user