build_resolvers 1.3.2

  • Readme
  • Changelog
  • Installing
  • 91

Provides an in-memory Resolvers implementation for use with package:build.

This implementation does a monolithic analysis from source, with fine grained invalidation, which works well when it can be shared across multiple build steps in the same process. It is not however suitable for use in more general build systems, which should build up their analysis context using analyzer summaries.

1.3.2 #

  • Improve detection of the flutter SDK for older flutter versions.

1.3.1 #

  • Add an exception on trying to resolve an AssetId that is not a Dart library with libraryFor to fit the contract expressed by the doc comment on Resolver.

1.3.0 #

New feature #

You can now resolve additional libraries other than those imported by the primary entrypoint.

  • This is supported through the isLibrary and libraryFor methods on Resolver, which will now resolve the provided asset if it is not already resolved.
  • Note: Doing this may affect the result of subsequent calls to resolver.libraries and resolver.findLibraryByName if new libraries are discovered.

Note: If using build_runner then this will also require you to upgrade to version 4.2.0 of build_runner_core .

Other #

  • Changed a hide declaration to a show declaration to support a package:analyzer change.

1.2.2 #

  • Update to package:analyzer version 0.39.0.

1.2.1 #

Check the build_resolvers version as a part of sdk summary invalidation.

1.2.0 #

Add flutters embedded sdk to the summary if available. This has the effect of making dart:ui and any future libraries available if using the flutter sdk instead of the dart sdk.

1.1.1 #

Bug Fix #

Check the analyzer path before reading cached summaries in addition to the SDK version.

1.1.0 #

Bug Fix: #38499 #

Update the AnalysisResolvers class to no longer use the SDK summary that is shipped with the SDK by default. This is not guaranteed compatible with analyzer versions shipped on pub and should not be used by any non-sdk code.

In order to fix this the AnalysisResolvers class now takes an optional method that returns the path to an arbitrary SDK summary. By default it will lazily generate a summary under .dart_tool/build_resolvers which is invalidated based on the Platform.version from dart:io.

1.0.8 #

  • Allow build version 1.2.x.

1.0.7 #

  • Allow analyzer version 0.38.0.

1.0.6 #

  • Allow analyzer version 0.37.0.

1.0.5 #

  • Fix a race condition where some assets may be resolved with missing dependencies. This was likely to have only manifested in tests using resolveSource.

1.0.4 #

  • Increase lower bound sdk constraint to 2.1.0.
  • Increased the upper bound for package:analyzer to <0.37.0.

1.0.3 #

  • Fixes a bug where transitive dart-ext: imports would cause the resolver to fail. These uris will now be ignored.

1.0.2 #

  • Ensure that BuildAssetUriResolver.restoreAbsolute never returns null.
    • Fixes a crash when a resolver is requested but not all transitive sources are available yet.

1.0.1 #

  • Fix a bug causing crashes on windows.

1.0.0 #

  • Migrate to AnalysisDriver. There are behavior changes which may be breaking. The LibraryElement instances returned by the resolver will now:
    • Have non-working context fields.
    • Have no source offsets for annotations or their errors.
    • Have working session fields.
    • Have Source instances with different URIs than before.
    • Not include missing libraries in the importedLibraries getter. You can instead use the imports getter to see all the imports.

0.2.3 #

  • Update to build 1.1.0 and add assetIdForElement.

0.2.2+7 #

  • Updated _AssetUriResolver to prepare for a future release of the analyzer.
  • Increased the upper bound for package:analyzer to <0.35.0.

0.2.2+6 #

  • Increased the upper bound for package:analyzer to <0.34.0.

0.2.2+5 #

  • Increased the upper bound for the build to <1.1.0.

0.2.2+4 #

  • Removed dependency on cli_util.
  • Increased the upper bound for the build to <0.12.9.

0.2.2+3 #

  • Don't log a severe message when a URI cannot be resolved. Just return null.

0.2.2+2 #

  • Use sdk summaries for the analysis context, which makes getting the initial resolver faster (reapplied).

0.2.2+1 #

  • Restore new keyword for a working release on Dart 1 VM.

0.2.2 #

  • Use sdk summaries for the analysis context, which makes getting the initial resolver faster.
  • Release broken on Dart 1 VM.

0.2.1+1 #

  • Increased the upper bound for the sdk to <3.0.0.

0.2.1 #

  • Allow passing in custom AnalysisOptions.

0.2.0+2 #

  • Support package:analyzer 0.32.0.

0.2.0+1 #

  • Switch to firstWhere(orElse) for compatibility with the SDK dev.45

0.2.0 #

  • Removed locking between uses of the Resolver and added a mandatory reset call to indicate that a complete build is finished.

0.1.1 #

  • Support the latest analyzer package.

0.1.0 #

  • Initial release as a migration from code_transformers with a near-identical implementation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  build_resolvers: ^1.3.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:build_resolvers/build_resolvers.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and build_resolvers.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
analyzer ^0.39.0 0.39.4
build >=1.1.0 <1.3.0 1.2.2
crypto ^2.0.0 2.1.4
graphs ^0.2.0 0.2.0
logging ^0.11.2 0.11.4
package_resolver ^1.0.0 1.0.10
path ^1.1.0 1.6.4
yaml ^2.0.0 2.2.0
Transitive dependencies
_fe_analyzer_shared 1.0.3
args 1.5.2
async 2.4.0
charcode 1.1.2
collection 1.14.12
convert 2.1.1
csslib 0.16.1
glob 1.2.0
html 0.14.0+3
http 0.12.0+4
http_parser 3.1.3
js 0.6.1+1
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
pedantic 1.9.0
pub_semver 1.4.2
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+13
Dev dependencies
build_modules any
build_runner ^1.0.0
build_test ^0.10.1
build_vm_compilers >=0.1.0 <2.0.0
test ^1.0.0