Beispiel #1
0
    def execute(self,
                language,
                api_name,
                api_version,
                organization_name,
                output_dir,
                src_proto_path,
                import_proto_path,
                packman_flags=None,
                remote_repo_dir=None,
                final_src_proto_path=None,
                final_import_proto_path=None):
        src_proto_path = final_src_proto_path or src_proto_path
        import_proto_path = final_import_proto_path or import_proto_path

        packman_flags = packman_flags or []
        api_name_arg = task_utils.packman_api_name(
            task_utils.api_full_name(api_name, api_version, organization_name))
        pkg_dir = protoc_utils.pkg_root_dir(output_dir, api_name, api_version,
                                            organization_name, language)
        arg_list = [
            language, api_name_arg, '-o', pkg_dir, '--package_prefix', 'grpc-'
        ]

        # Import path must be absolute. See
        #   https://github.com/googleapis/packman/issues/1
        import_proto_path = [os.path.abspath(imp) for imp in import_proto_path]

        arg_list += [arg for imp in import_proto_path for arg in ('-i', imp)]
        arg_list += [arg for src in src_proto_path for arg in ('-r', src)]
        arg_list += packman_flags
        if remote_repo_dir:
            arg_list += ['-r', remote_repo_dir]
        self.run_packman(*arg_list)
        return os.path.join(pkg_dir, language)
Beispiel #2
0
    def execute(self, language, api_name, api_version, organization_name,
                output_dir, src_proto_path, import_proto_path,
                packman_flags=None, remote_repo_dir=None,
                final_src_proto_path=None, final_import_proto_path=None):
        src_proto_path = final_src_proto_path or src_proto_path
        import_proto_path = final_import_proto_path or import_proto_path

        packman_flags = packman_flags or []
        api_name_arg = task_utils.packman_api_name(
            task_utils.api_full_name(api_name, api_version, organization_name))
        pkg_dir = protoc_utils.pkg_root_dir(
            output_dir, api_name, api_version, organization_name, language)
        arg_list = [language, api_name_arg, '-o', pkg_dir,
                    '--package_prefix', 'grpc-']

        # Import path must be absolute. See
        #   https://github.com/googleapis/packman/issues/1
        import_proto_path = [os.path.abspath(imp) for imp in import_proto_path]

        arg_list += [arg for imp in import_proto_path for arg in ('-i', imp)]
        arg_list += [arg for src in src_proto_path for arg in ('-r', src)]
        arg_list += packman_flags
        if remote_repo_dir:
            arg_list += ['-r', remote_repo_dir]
        self.run_packman(*arg_list)
        return os.path.join(pkg_dir, language)
Beispiel #3
0
 def execute(self, language, api_name, api_version, organization_name,
             gapic_code_dir, skip_packman=False):
     if not skip_packman:
         api_full_name = task_utils.api_full_name(
             api_name, api_version, organization_name)
         # TODO: Use TaskBase.exec_command()
         self.run_packman(language,
                          task_utils.packman_api_name(api_full_name),
                          '--gax_dir=' + gapic_code_dir,
                          '--template_root=templates/gax')
     return gapic_code_dir
Beispiel #4
0
 def execute(self, language, api_name, api_version, organization_name,
             gapic_code_dir, skip_packman=False):
     if not skip_packman:
         api_full_name = task_utils.api_full_name(
             api_name, api_version, organization_name)
         # TODO: Use TaskBase.exec_command()
         self.run_packman(language,
                          task_utils.packman_api_name(api_full_name),
                          '--gax_dir=' + gapic_code_dir,
                          '--template_root=templates/gax')
     return gapic_code_dir