original_docstring: Builds an executable for the application if necessary.
  
      Args:
        maybe_modified_since_last_build: True if any files in the application root
            or the GOPATH have changed since the last call to maybe_build, False
            otherwise. This argument is used to decide whether a build is Required
            or not.
  
      Returns:
        True if compilation was successfully performed (will raise
          an exception if compilation was attempted but failed).
        False if compilation was not attempted.
  
      Raises:
        BuildError: if building the executable fails for any reason.
      
docstring: Builds an executable for the application if necessary.
docstring_tokens: Builds an executable for the application if necessary .
code: def maybe_build(self, maybe_modified_since_last_build):
      """Builds an executable for the application if necessary.
  
      Args:
        maybe_modified_since_last_build: True if any files in the application root
            or the GOPATH have changed since the last call to maybe_build, False
            otherwise. This argument is used to decide whether a build is Required
            or not.
  
      Returns:
        True if compilation was successfully performed (will raise
          an exception if compilation was attempted but failed).
        False if compilation was not attempted.
  
      Raises:
        BuildError: if building the executable fails for any reason.
      """
      if not self._work_dir:
        self._work_dir = tempfile.mkdtemp('appengine-go-bin')
        atexit.register(_rmtree, self._work_dir)
  
      if not os.path.exists(_GAB_PATH):
        # TODO: This message should be more useful i.e. point the
        # user to an SDK that does have the right components.
        raise go_errors.BuildError(
            'Required Go components are missing from the SDK.')
  
      if self._go_executable and not maybe_modified_since_last_build:
        return False
  
      (self._go_file_to_mtime,
       old_go_file_to_mtime) = (self._get_go_files_to_mtime(),
                                self._go_file_to_mtime)
  
      if not self._go_file_to_mtime:
        raise go_errors.BuildError('no .go files found in %s' %
                                   self._module_configuration.application_root)
  
      self._extras_hash, old_extras_hash = (self._get_extras_hash(),
                                            self._extras_hash)
  
      if (self._go_executable and
          self._go_file_to_mtime == old_go_file_to_mtime and
          self._extras_hash == old_extras_hash):
        return False
  
      if self._go_file_to_mtime != old_go_file_to_mtime:
        logging.debug('Rebuilding Go application due to source modification')
      elif self._extras_hash != old_extras_hash:
        logging.debug('Rebuilding Go application due to GOPATH modification')
      else:
        logging.debug('Building Go application')
      self._build()
      return True
code_tokens: def maybe_build ( self , maybe_modified_since_last_build ) : if not self . _work_dir : self . _work_dir = tempfile . mkdtemp ( 'appengine-go-bin' ) atexit . register ( _rmtree , self . _work_dir ) if not os . path . exists ( _GAB_PATH ) : raise go_errors . BuildError ( 'Required Go components are missing from the SDK.' ) if self . _go_executable and not maybe_modified_since_last_build : return False ( self . _go_file_to_mtime , old_go_file_to_mtime ) = ( self . _get_go_files_to_mtime ( ) , self . _go_file_to_mtime ) if not self . _go_file_to_mtime : raise go_errors . BuildError ( 'no .go files found in %s' % self . _module_configuration . application_root ) self . _extras_hash , old_extras_hash = ( self . _get_extras_hash ( ) , self . _extras_hash ) if ( self . _go_executable and self . _go_file_to_mtime == old_go_file_to_mtime and self . _extras_hash == old_extras_hash ) : return False if self . _go_file_to_mtime != old_go_file_to_mtime : logging . debug ( 'Rebuilding Go application due to source modification' ) elif self . _extras_hash != old_extras_hash : logging . debug ( 'Rebuilding Go application due to GOPATH modification' ) else : logging . debug ( 'Building Go application' ) self . _build ( ) return True
short_docstring: Builds an executable for the application if necessary.
short_docstring_tokens: Builds an executable for the application if necessary .
comment: """Builds an executable for the application if necessary.
  
      Args:
        maybe_modified_since_last_build: True if any files in the application root
            or the GOPATH have changed since the last call to maybe_build, False
            otherwise. This argument is used to decide whether a build is Required
            or not.
  
      Returns:
        True if compilation was successfully performed (will raise
          an exception if compilation was attempted but failed).
        False if compilation was not attempted.
  
      Raises:
        BuildError: if building the executable fails for any reason.
      """$SEP$# TODO: This message should be more useful i.e. point the$SEP$# user to an SDK that does have the right components.