parameters: (working_directory, configuration)
return_statement: return error
docstring: Issue build commands after all IDE projects have been built.
  
      This function can assume all other build projects have executed for final
      deployment or cleanup
  
      On exit, return 0 for no error, or a non zero error code if there was an
      error to report.
  
      Args:
          working_directory
              Directory this script resides in.
  
          configuration
              Configuration to build, ``all`` if no configuration was requested.
  
      Returns:
          None if not implemented, otherwise an integer error code.
docstring_summary: Issue build commands after all IDE projects have been built.
docstring_tokens: Issue build commands after all IDE projects have been built .
function: def postbuild(working_directory, configuration):
      """
      Issue build commands after all IDE projects have been built.
  
      This function can assume all other build projects have executed for final
      deployment or cleanup
  
      On exit, return 0 for no error, or a non zero error code if there was an
      error to report.
  
      Args:
          working_directory
              Directory this script resides in.
  
          configuration
              Configuration to build, ``all`` if no configuration was requested.
  
      Returns:
          None if not implemented, otherwise an integer error code.
      """
  
      # Copy the headers of burgerlib into their proper folder
  
      # Get the location of the super header
      dest_folder = os.path.join(working_directory, 'bin')
      headerfilepath = os.path.join(dest_folder, 'burger.h')
  
      # Was there a change in the output?
      error = 0
      for item in TARGETFOLDERS:
          destfolder = os.path.join(SDKS_FOLDER, item, 'burgerlib')
          create_folder_if_needed(destfolder)
          testfile = os.path.join(destfolder, 'burger.h')
  
          # Copy only if changed or doesn't exist
          if not os.path.isfile(testfile) or not compare_files(
                  headerfilepath, testfile):
              error = copy_file_if_needed(
                  headerfilepath, testfile, perforce=True)
              if error:
                  break
  
      # Was there a change in special headers?
      if not error:
  
          for dest in TARGETFOLDERS:
  
              # Special case, burgerlib has the folder msdos and SDKS
              # has dos. Perform the override here
  
              if dest == 'dos':
                  sourcefolder = os.path.join(
                      working_directory, 'source', 'msdos')
              else:
                  sourcefolder = os.path.join(working_directory, 'source', dest)
  
              # Is this platform's source code present?
              if not os.path.isdir(sourcefolder):
                  sourcefolder = None
  
              # Process the headers
              for item in SPECIALHEADERS:
  
                  # Assume the generic header
                  headerfilepath = os.path.join(working_directory, 'source', item)
                  if sourcefolder:
                      # Is there an override?
                      headerfiletest = os.path.join(sourcefolder, item)
                      if os.path.isfile(headerfiletest):
                          # Use the override
                          headerfilepath = headerfiletest
  
                  destfile = os.path.join(SDKS_FOLDER, dest, 'burgerlib', item)
  
                  # Copy if the destination doesn't exist or it's different
                  # from the header
                  if not os.path.isfile(destfile) or not compare_files(
                          headerfilepath, destfile):
                      error = copy_file_if_needed(
                          headerfilepath, destfile, perforce=True)
                      if error:
                          break
  
      if not error:
          # Did any of the Mac Carbon/Classic resource files change?
          sourcefolder = os.path.join(working_directory, 'source', 'mac')
          destfolder = os.path.join(SDKS_FOLDER, 'mac', 'burgerlib')
          filedata = os.listdir(sourcefolder)
          for item in filedata:
              if item.lower().endswith('.r'):
                  destfile = os.path.join(destfolder, item)
                  sourcefile = os.path.join(sourcefolder, item)
                  if not os.path.isfile(destfile) or not compare_files(
                          sourcefile, destfile):
                      error = copy_file_if_needed(
                          sourcefile, destfile, perforce=True)
                      if error:
                          break
  
      return error
function_tokens: def postbuild ( working_directory , configuration ) : # Copy the headers of burgerlib into their proper folder # Get the location of the super header dest_folder = os . path . join ( working_directory , 'bin' ) headerfilepath = os . path . join ( dest_folder , 'burger.h' ) # Was there a change in the output? error = 0 for item in TARGETFOLDERS : destfolder = os . path . join ( SDKS_FOLDER , item , 'burgerlib' ) create_folder_if_needed ( destfolder ) testfile = os . path . join ( destfolder , 'burger.h' ) # Copy only if changed or doesn't exist if not os . path . isfile ( testfile ) or not compare_files ( headerfilepath , testfile ) : error = copy_file_if_needed ( headerfilepath , testfile , perforce = True ) if error : break # Was there a change in special headers? if not error : for dest in TARGETFOLDERS : # Special case, burgerlib has the folder msdos and SDKS # has dos. Perform the override here if dest == 'dos' : sourcefolder = os . path . join ( working_directory , 'source' , 'msdos' ) else : sourcefolder = os . path . join ( working_directory , 'source' , dest ) # Is this platform's source code present? if not os . path . isdir ( sourcefolder ) : sourcefolder = None # Process the headers for item in SPECIALHEADERS : # Assume the generic header headerfilepath = os . path . join ( working_directory , 'source' , item ) if sourcefolder : # Is there an override? headerfiletest = os . path . join ( sourcefolder , item ) if os . path . isfile ( headerfiletest ) : # Use the override headerfilepath = headerfiletest destfile = os . path . join ( SDKS_FOLDER , dest , 'burgerlib' , item ) # Copy if the destination doesn't exist or it's different # from the header if not os . path . isfile ( destfile ) or not compare_files ( headerfilepath , destfile ) : error = copy_file_if_needed ( headerfilepath , destfile , perforce = True ) if error : break if not error : # Did any of the Mac Carbon/Classic resource files change? sourcefolder = os . path . join ( working_directory , 'source' , 'mac' ) destfolder = os . path . join ( SDKS_FOLDER , 'mac' , 'burgerlib' ) filedata = os . listdir ( sourcefolder ) for item in filedata : if item . lower ( ) . endswith ( '.r' ) : destfile = os . path . join ( destfolder , item ) sourcefile = os . path . join ( sourcefolder , item ) if not os . path . isfile ( destfile ) or not compare_files ( sourcefile , destfile ) : error = copy_file_if_needed ( sourcefile , destfile , perforce = True ) if error : break return error