def regenerateFile(srcFile, pathComponents, sourceType, makeBackup)
      #puts "regenerateFile, srcFile = #{srcFile}, sourceType = #{sourceType.inspect}"
      outFile = File.join(@sourceTypeDirs[@oppositeSourceType[sourceType]], File.join(pathComponents))
      #puts " outFile = #{outFile}"
      outFileDir = File.dirname(outFile)
      if !File.exists?(outFileDir)
        if sourceType == :output
          raise "Cannot create missing source directory #{outFileDir} - please do so manually if required"
        end
        ensureDirectoryExists(outFileDir)
      end
      if sourceType == :output
        regenerateSourceFromOutput(srcFile, pathComponents)
      elsif sourceType == :source
        regenerateFileFromSource(srcFile, pathComponents, makeBackup)
      end
    end
def regenerateFile(srcFile, pathComponents, sourceType, makeBackup)
      #puts "regenerateFile, srcFile = #{srcFile}, sourceType = #{sourceType.inspect}"
      outFile = File.join(@sourceTypeDirs[@oppositeSourceType[sourceType]], File.join(pathComponents))
      #puts " outFile = #{outFile}"
      outFileDir = File.dirname(outFile)
      if !File.exists?(outFileDir)
        if sourceType == :output
          raise "Cannot create missing source directory #{outFileDir} - please do so manually if required"
        end
        ensureDirectoryExists(outFileDir)
      end
      if sourceType == :output
        regenerateSourceFromOutput(srcFile, pathComponents)
      elsif sourceType == :source
        regenerateFileFromSource(srcFile, pathComponents, makeBackup)
      end
    end
Regenerate (or generate) a file, either from source file or from output file