buildExtensions property

  1. @override
Map<String, List<String>> get buildExtensions

Mapping from input file extension to output file extensions.

All input sources matching any key in this map will be passed as build step to this builder. Only files with the same basename and an extension from the values in this map are expected as outputs.

Implementation

@override
Map<String, List<String>> get buildExtensions {
  if (p.isRelative(config.outputDirectory)) {
    return Map.fromEntries(
      kGraphQLFileExtensions.map(
        (extension) => MapEntry(
          '{{dir}}/{{file}}.${extension}',
          [
            p.join(
              '{{dir}}',
              config.outputDirectory,
              '{{file}}.${extension}.dart',
            ),
          ],
        ),
      ),
    );
  }
  return {
    ...Map.fromEntries(
      kGraphQLFileExtensions.map(
        (e) => MapEntry(
          p.join(_assetsPrefix, '{{file}}.${e}'),
          [
            p.join(
              p.relative(config.outputDirectory, from: '/'),
              '{{file}}.${e}.dart',
            )
          ],
        ),
      ),
    )
  };
}