resolveSource<T> function

Future<T> resolveSource <T>(String inputSource, FutureOr<T> action(Resolver resolver), { AssetId inputId, PackageResolver resolver, Future<Null> tearDown, Resolvers resolvers })

A convenience method for using resolveSources with a single source file.

Implementation

Future<T> resolveSource<T>(
  String inputSource,
  FutureOr<T> action(Resolver resolver), {
  AssetId inputId,
  PackageResolver resolver,
  Future<Null> tearDown,
  Resolvers resolvers,
}) {
  inputId ??= AssetId('_resolve_source', 'lib/_resolve_source.dart');
  return _resolveAssets(
    {
      '${inputId.package}|${inputId.path}': inputSource,
    },
    inputId.package,
    action,
    resolver: resolver,
    resolverFor: inputId,
    tearDown: tearDown,
    resolvers: resolvers,
  );
}