build_barback 0.5.0+2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 93

Build Status

build_barback

Allows wrapping up a Builder as a Transformer so that it can be run in pub or vice-versa.

Using a Builder from Pub

Wrap the Builder instance with new BuilderTransformer(builder) and use it like any other Transformer. The Builder used this way must follow the rules of other Transformers, it cannot use inputs from outside the package where the Transformer is specified in pubspec.yaml

Using an exisiting Transformer with package:build

Wrap the Transformer instance with new TransformerBuilder(transformer) and run as any other Builder. The Transformer instance used this way must follow the rules of other Builders:

  • It cannot overwrite files it uses as inputs.
  • It must know before building what the outputs will be (it must be a DeclaringTransformer).

Features and bugs

Please file feature requests and bugs at the issue tracker.

0.5.0+2

  • Update to package:build version ^0.12.0.

0.5.0+1

  • Stop casting BuildStep to BuildStepImpl and remove src import from package:build.

0.5.0

  • Internally uses AnalysisOptions with the following changes:
    • Does not preserveFunctionBodies.
    • Does preserveComments (the default).
    • Uses strongMode.

This makes the resolver implementation identical to the experience using the bazel_codegen, but it is technically a breaking change if you relied on the current behavior.

0.4.0+2

  • TransformerAssetReader#findAssets now returns a Stream<AssetId> to match the latest build package, but this isn't considered a breaking change since the api is unsupported and throws in this implementation.

0.4.0+1

  • Use a single ResourceManager for all calls to runBuilder in BuilderTransformer. This makes Resources be shared across all build steps for a given package and Builder.

0.4.0

  • Breaking: Resolver interface updated for breaking change in package:build v0.10.0

0.3.0

  • Breaking BuilderTransformer is now an AggregateTransformer. This should be transparent for most use cases but could have errors if an instance was assigned to a variable of type Transformer.
  • Breaking BuilderTransformer no longer accepts a Resolvers instance, instead it will create and manage Resolvers on its own.

0.2.0

  • Update to build 0.9.0
  • Breaking TransformerBuilder must be constructed with a buildExtension configuration. Transformers wrapped as a builder must have outputs which vary only by input extension.

0.1.2

  • Only use the global log from build
  • Upgrade to build 0.8.0

0.1.1

  • Support the global log from build

0.1.0

Updated to reflect the new support for reading/writing as bytes in the build package, and the removal of the Asset class.

New Features

  • BuilderTransformer now supports wrapping transformers that read or write their inputs as bytes.
  • The Resolver implementation now has isLibrary to check whether an Asset is a Library and throws an exception rather than returns null on getLibrary when it isn't

Breaking Changes

  • Stopped exporting lib/src/util/barback.dart which contains internal only utilities. Specifically, the following items are no longer public (some are deleted entirely or had breaking changes as well):
    • toBarbackAsset
    • toBarbackAssetId
    • toBarbackTransform
    • toBuildAsset
    • toBuildAssetId
    • toTransformLogger
    • BuildStepTransform

0.0.3

  • Prevent asset writing from escaping beyond the complete() call in BuildStepImpl

0.0.2

  • Fix a bug forwarding logs from a BuilderTransformer

0.0.1

  • Initial separate release - split off from build package.

1. Depend on it

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


dependencies:
  build_barback: "^0.5.0+2"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:build_barback/build_barback.dart';
        
Version Uploaded Documentation Archive
0.5.0+2 Jan 18, 2018 Go to the documentation of build_barback 0.5.0+2 Download build_barback 0.5.0+2 archive
0.5.0+1 Jan 2, 2018 Go to the documentation of build_barback 0.5.0+1 Download build_barback 0.5.0+1 archive
0.5.0 Dec 7, 2017 Go to the documentation of build_barback 0.5.0 Download build_barback 0.5.0 archive
0.4.0+2 Nov 2, 2017 Go to the documentation of build_barback 0.4.0+2 Download build_barback 0.4.0+2 archive
0.4.0+1 Sep 21, 2017 Go to the documentation of build_barback 0.4.0+1 Download build_barback 0.4.0+1 archive
0.4.0 Aug 14, 2017 Go to the documentation of build_barback 0.4.0 Download build_barback 0.4.0 archive
0.3.0 Jul 18, 2017 Go to the documentation of build_barback 0.3.0 Download build_barback 0.3.0 archive
0.2.2 May 4, 2017 Go to the documentation of build_barback 0.2.2 Download build_barback 0.2.2 archive
0.2.0 Apr 25, 2017 Go to the documentation of build_barback 0.2.0 Download build_barback 0.2.0 archive
0.1.2 Apr 13, 2017 Go to the documentation of build_barback 0.1.2 Download build_barback 0.1.2 archive

All 15 versions...

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Jan 18, 2018
  • Dart: 2.0.0-dev.15.0
  • pana: 0.9.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
87 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
93

Platforms

Detected platforms: Flutter, server

Multiple platform identified in libraries.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use build_barback.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.1 <2.0.0
analyzer >=0.27.1 <0.31.0 0.30.0+4 0.31.0-alpha.2
barback ^0.15.0 0.15.2+14
build ^0.12.0 0.12.0
code_transformers >=0.5.1 <0.6.0 0.5.1+3
glob ^1.1.0 1.1.5
graphs ^0.1.0 0.1.0
logging ^0.11.2 0.11.3+1
Transitive dependencies
args 1.2.0
async 2.0.3
charcode 1.1.1
cli_util 0.1.2+1
collection 1.14.5
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
front_end 0.1.0-alpha.4.1 0.1.0-alpha.7
html 0.13.2+2
isolate 1.1.0
kernel 0.3.0-alpha.1.1 0.3.0-alpha.4
meta 1.1.2
package_config 1.0.3
path 1.5.1
plugin 0.2.0+2
pool 1.3.4
source_maps 0.10.4
source_span 1.4.0
stack_trace 1.9.1
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+3
watcher 0.9.7+6
yaml 2.1.13
Dev dependencies
build_test ^0.10.0
test ^0.12.0
transformer_test ^0.2.1