gn2bp: move jni_generator.py --output_dir to sanitizer
It would probably make sense for arg-related helpers to just fail silently if an arg does not exist. That will eliminate the has_arg check. Test: none Change-Id: Id04dbe1b5357b3e42e96f1c66ec1f939586113f8
This commit is contained in:
@@ -705,6 +705,8 @@ class JniGeneratorSanitizer(BaseActionSanitizer):
|
|||||||
def get_args(self):
|
def get_args(self):
|
||||||
if self._has_arg('--jar_file'):
|
if self._has_arg('--jar_file'):
|
||||||
self._append_arg('--javap', '$$(find out/.path -name javap)')
|
self._append_arg('--javap', '$$(find out/.path -name javap)')
|
||||||
|
if self._has_arg('--output_dir'):
|
||||||
|
self._update_value_arg('--output_dir', self._sanitize_dir)
|
||||||
return super().get_args()
|
return super().get_args()
|
||||||
|
|
||||||
|
|
||||||
@@ -761,10 +763,7 @@ def create_action_module(blueprint, target):
|
|||||||
|
|
||||||
if target.script == '//base/android/jni_generator/jni_generator.py':
|
if target.script == '//base/android/jni_generator/jni_generator.py':
|
||||||
for i, val in enumerate(target.args):
|
for i, val in enumerate(target.args):
|
||||||
if val == '--output_dir':
|
if val == '--input_file':
|
||||||
# replace --output_dir gen/jni_headers/... with --output_dir $(genDir)/...
|
|
||||||
target.args[i + 1] = re.sub('^gen/jni_headers', '$(genDir)', target.args[i + 1])
|
|
||||||
elif val == '--input_file':
|
|
||||||
# --input_file supports both .class specifiers or source files as arguments.
|
# --input_file supports both .class specifiers or source files as arguments.
|
||||||
# Only source files need to be wrapped inside a $(location <label>) tag.
|
# Only source files need to be wrapped inside a $(location <label>) tag.
|
||||||
if re.match('.*\.class$', target.args[i + 1]):
|
if re.match('.*\.class$', target.args[i + 1]):
|
||||||
|
|||||||
Reference in New Issue
Block a user