import json


def load_dexpreopt_configs(configs):
  """Load dexpreopt.config files and map module names to library names."""
  module_to_libname = {}

  if configs is None:
    configs = []

  for config in configs:
    with open(config, 'r') as f:
      contents = json.load(f)
    module_to_libname[contents['Name']] = contents['ProvidesUsesLibrary']

  return module_to_libname