def collect_sources_and_toolchains
      sources_to_build = {}

      exclude_files = Set.new
      exclude_sources.each do |p|
        if p.include?("..")
          Printer.printError "Error: Exclude source file pattern '#{p}' must not include '..'"
          return nil
        end

        Dir.glob(p).each {|f| exclude_files << f}
      end
      files = Set.new  # do not build the same file twice

      add_to_sources_to_build(sources_to_build, exclude_files, sources)

      source_patterns.each do |p|
        if p.include?("..")
          Printer.printError "Error: Source file pattern '#{p}' must not include '..'"
          return nil
        end

        globRes = Dir.glob(p)
        if (globRes.length == 0)
          Printer.printWarning "Warning: Source file pattern '#{p}' did not match to any file"
        end
        add_to_sources_to_build(sources_to_build, exclude_files, globRes, tcs4source(p))
      end
      return sources_to_build
    end
def collect_sources_and_toolchains
      sources_to_build = {}

      exclude_files = Set.new
      exclude_sources.each do |p|
        if p.include?("..")
          Printer.printError "Error: Exclude source file pattern '#{p}' must not include '..'"
          return nil
        end

        Dir.glob(p).each {|f| exclude_files << f}
      end
      files = Set.new  # do not build the same file twice

      add_to_sources_to_build(sources_to_build, exclude_files, sources)

      source_patterns.each do |p|
        if p.include?("..")
          Printer.printError "Error: Source file pattern '#{p}' must not include '..'"
          return nil
        end

        globRes = Dir.glob(p)
        if (globRes.length == 0)
          Printer.printWarning "Warning: Source file pattern '#{p}' did not match to any file"
        end
        add_to_sources_to_build(sources_to_build, exclude_files, globRes, tcs4source(p))
      end
      return sources_to_build
    end
returns a hash from all sources to the toolchain that should be used for a source