pubspec_builder 1.0.0 copy "pubspec_builder: ^1.0.0" to clipboard
pubspec_builder: ^1.0.0 copied to clipboard

A builder for extracting the contents of pubspec.yaml into code.

Pub Version Dart SDK Version Pub popularity

pubspec_builder #

A builder for extracting the contents of pubspec.yaml into code.

Usage #

  1. Add this package to your dev_dependencies in pubspec.yaml:

    dependencies:
      pubspec_parse: ^1.2.0
      
    dev_dependencies:
      build_runner: ^2.1.11
      pubspec_builder: any
    
  2. Run a build:

    dart pub run build_runner build
    
  3. lib/gen/pubspec.dart will be generated with content:

    // GENERATED CODE - DO NOT MODIFY BY HAND
       
    import 'package:pubspec_parse/pubspec_parse.dart';
       
    final pubspec = Pubspec.parse("""...""");
    

Optional #

To change the path of the generated file, create a build.yaml in the root of your package. By changing the output option of this builder, the path can be customized:

targets:
  $default:
    builders:
      pubspec_builder:
        options:
          output: 'lib/custom/path/to/pubspec.dart'

See also #

1
likes
140
pub points
6%
popularity

Publisher

verified publisherblendthink.dev

A builder for extracting the contents of pubspec.yaml into code.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

BSD-3-Clause (LICENSE)

Dependencies

build, build_config

More

Packages that depend on pubspec_builder