DartDefine.fromFilesAndEntries constructor

DartDefine.fromFilesAndEntries({
  1. required List<String> files,
  2. required List<String> entries,
  3. required FileSystem fs,
})

Implementation

factory DartDefine.fromFilesAndEntries({
  required List<String> files,
  required List<String> entries,
  required FileSystem fs,
}) {
  final defined = <String, String>{};

  for (final file in files) {
    final dartDefine = DartDefine.fromFile(file, fs: fs);
    defined.addAll(dartDefine._defined);
  }

  for (final entry in entries) {
    final (:key, :value) = _parseEntry(entry);

    defined[key] = value;
  }

  return DartDefine(defined: defined, files: files);
}