def _find_protobuf_path(toolkit_path): """Fetch and locate protobuf source""" global _protobuf_path if not _protobuf_path: logger.info('Searching for latest protobuf source') _protobuf_path = task_utils.get_gradle_task_output( 'showProtobufPath', toolkit_path) return _protobuf_path
def execute(self, gapic_code_dir, toolkit_path): logger.info('Formatting files in %s.' % os.path.abspath(gapic_code_dir)) # TODO(shinfan): Move gradle task into requirement path = task_utils.get_gradle_task_output('showJavaFormatterPath', toolkit_path) 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 execute(self, gapic_code_dir, toolkit_path): logger.info('Formatting files in %s.' % os.path.abspath(gapic_code_dir)) # TODO(shinfan): Move gradle task into requirement path = task_utils.get_gradle_task_output( 'showJavaFormatterPath', toolkit_path) 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): if self.path is None: logger.info('start gradle process to locate GRPC Java plugin') self.path = task_utils.get_gradle_task_output( 'showGrpcJavaPluginPath', toolkit_path) return self.path