buildConfig method

Future<EnsembleConfig> buildConfig({
  1. Locale? forcedLocale,
})

Implementation

Future<EnsembleConfig> buildConfig({Locale? forcedLocale}) async {
  return await RunnerBenchmark.async('lifecycle', 'buildConfig', () async {
    final target = appPath != null && appHome != null
        ? EnsembleTestAppTarget(
            appPath: appPath!,
            appHome: appHome!,
            i18nPath: i18nPath,
          )
        : await loadEnsembleTestAppTarget();
    final normalized = normalizeAppPath(appPath ?? target.appPath);
    final home = appHome ?? target.appHome;
    final translations =
        i18nPath ?? target.i18nPath ?? '${normalized}translations';
    final i18n = I18nProps(translations);

    final provider = await LocalDefinitionProvider(
      normalized,
      home,
      i18nProps: i18n,
      initialForcedLocale: forcedLocale,
    ).init();

    final config = EnsembleConfig(definitionProvider: provider);
    final updated = await config.updateAppBundle();
    return updated;
  });
}