diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp index 373713055f..faa303e1c0 100755 --- a/tools/gn2bp/gen_android_bp +++ b/tools/gn2bp/gen_android_bp @@ -108,7 +108,7 @@ buildtools_protobuf_src = '//buildtools/protobuf/src' # Location of the protobuf src dir in the Android source tree. android_protobuf_src = 'external/protobuf/src' -response_file = '{{response_file_name}}' + # Compiler flags which are passed through to the blueprint. cflag_allowlist = [ @@ -737,11 +737,11 @@ class BaseActionSanitizer(): # Handle passing parameters via response file by piping them into the script # and reading them from /dev/stdin. - self.use_response_file = response_file in self.target.args + self.use_response_file = gn_utils.RESPONSE_FILE in self.target.args if self.use_response_file: # Replace {{response_file_contents}} with /dev/stdin - self.target.args = ['/dev/stdin' if it == response_file else it for it in - self.target.args] + self.target.args = ['/dev/stdin' if it == gn_utils.RESPONSE_FILE else it + for it in self.target.args] def _sanitize_outputs(self): pass diff --git a/tools/gn2bp/gn_utils.py b/tools/gn2bp/gn_utils.py index 8f33ca21ca..0511e8a25b 100644 --- a/tools/gn2bp/gn_utils.py +++ b/tools/gn2bp/gn_utils.py @@ -52,6 +52,8 @@ ODR_VIOLATION_IGNORE_TARGETS = { ARCH_REGEX = r'(android_x86_64|android_x86|android_arm|android_arm64|host)' DEX_REGEX = '.*__dex__%s$' % ARCH_REGEX COMPILE_JAVA_REGEX = '.*__compile_java__%s$' % ARCH_REGEX +RESPONSE_FILE = '{{response_file_name}}' + def repo_root(): """Returns an absolute path to the repository root.""" return os.path.join(