def GenerateBuildCommand(project, scheme, basic_args):
  """GenerateBuildCommand generates the build command.

  Args:
    project: The path to the project.
    scheme: The scheme of the project.
    basic_args: The basic arguments that are passed in.

  Returns:
    A string representing the command.
  """
  project_args = []
  if project.endswith('workspace'):
    project_args.append('-workspace {}'.format(project))
  else:
    project_args.append('-project {}'.format(project))
  project_args.append('-scheme {}'.format(scheme))
  cmd = 'xcodebuild {} {}'.format(' '.join(project_args), ' '.join(basic_args))
  return cmd