def get_library_from_file_path
      return nil if is_outside_project?
      sources_file_dir = find_sources_file_dir 
      if sources_file_dir
        #A sources.rb file was found."
        #Check if an existing library is already mapped to that folder. If so, return that library
        #and otherwise return a new library that is named according to the  folder
        already_mapped_lib = @project.library_mapped_to(sources_file_dir.to_s)
        return already_mapped_lib if already_mapped_lib
        #Use the name of the folder as the library name:"
        lib_dir = sources_file_dir
      else
#        puts "        #Could not find an existing sources.rb file for the given source file"
        lib_dir = get_default_library_dir_from_file_path
      end
      unless lib_dir.nil?
        lib_name = lib_dir.basename.to_s
        Ecic::Library.new(@project, lib_name, get_library_type_from_file_path, :path => lib_dir)
      end
    end
def get_library_from_file_path
      return nil if is_outside_project?
      sources_file_dir = find_sources_file_dir 
      if sources_file_dir
        #A sources.rb file was found."
        #Check if an existing library is already mapped to that folder. If so, return that library
        #and otherwise return a new library that is named according to the  folder
        already_mapped_lib = @project.library_mapped_to(sources_file_dir.to_s)
        return already_mapped_lib if already_mapped_lib
        #Use the name of the folder as the library name:"
        lib_dir = sources_file_dir
      else
#        puts "        #Could not find an existing sources.rb file for the given source file"
        lib_dir = get_default_library_dir_from_file_path
      end
      unless lib_dir.nil?
        lib_name = lib_dir.basename.to_s
        Ecic::Library.new(@project, lib_name, get_library_type_from_file_path, :path => lib_dir)
      end
    end
TBA: Make sure this function works for libraries under src/testbench as
well and make sure it returns nil, if the library name cannot be determined.
TBA: Update this function to first look for any sources.rb files within the
project folder structure.