def _find_protobuf_path(toolkit_path): """Fetch and locate protobuf source""" global _protobuf_path if not _protobuf_path: logger.debug('Searching for latest protobuf source') _protobuf_path = task_utils.get_java_tool_path(toolkit_path, 'protobufJavaDir') return _protobuf_path
def execute(self, gapic_code_dir, toolkit_path): logger.debug('Formatting files in %s.' % os.path.abspath(gapic_code_dir)) path = task_utils.get_java_tool_path(toolkit_path, 'googleJavaFormatJar') targetFiles = [] for root, dirs, files in os.walk(gapic_code_dir): for filename in files: if filename.endswith('.java'): targetFile = os.path.abspath(os.path.join(root, filename)) targetFiles.append(targetFile) self.exec_command( ['java', '-jar', path, '--replace'] + targetFiles)
def grpc_plugin_path(self, toolkit_path): return task_utils.get_java_tool_path(toolkit_path, 'protoGenGrpcJavaExe')