dmake 0.0.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new48

dmake

Simple, flexible build system in Dart. Supports incremental builds, file watching, and snapshotting for faster startup.

Usage

dmake is a DSL that creates a simple graph of inputs and outputs.

Try compiling a Dart app! In tool/all.dart:

import 'package:dmake/dmake.dart';
import 'package:dmake/dart.dart';

main(List<String> args) {
  make(args, () {
    if (isRelease) {
      // Build to JS in release mode.
      dart2js('web/main.dart');
    } else {
      // Run all web/ files through dartdevc.
      all(glob('web/*.dart', recursive: false), dartdevc);
    }
  });
}

Then, run dart tool/all.dart. All of your .dart files in web/ will be built to JavaScript via the Dart dev compiler.

Release mode

It's pretty common to have different build rules in debug and release mode. To switch over to dart2js, run dart tool/all.dart --release.

Snapshotting Builds

Build systems are called very often, and therefore should start up quickly. Using the dmake executable, you can easily snapshot your build script.

To create a snapshot of tool/all.dart, just run pub run dmake.

If you had another file, say, tool/foo.dart, the command would become pub run dmake -t foo.

The single caveat is that to distinguish between arguments passed to the dmake toplevel and to your actual script, you need to separate them with a --.

For example, to run in release mode:

pub run dmake -- --release

Run pub run dmake --help for help.

You can also pub global activate dmake. In this case, you can simply run dmake, dmake -t foo, etc.

Infrastructure

dmake includes utilities for quickly building files in different languages:

  • package:dmake/dart.dart
  • package:dmake/sass.dart

0.0.3

  • Fixed an error that prevented argument passing.

0.0.2

  • Fixed an error that prevented proper mode detection.

0.0.1

  • Added watch support.
  • Added SASS.

0.0.0

First version.

example/example.dart

import 'package:dmake/dmake.dart';
import 'package:dmake/dart.dart';

main(List<String> args) {
  make(args, () {
    if (isRelease) {
      // Build to JS in release mode.
      dart2js('web/main.dart');
    } else {
      // Run all web/ files through dartdevc.
      all(glob('web/*.dart', recursive: false), dartdevc);
    }
  });
}

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate dmake

2. Use it

The package has the following executables:


$ dmake

Use this package as a library

1. Depend on it

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


dependencies:
  dmake: ^0.0.3

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 flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dmake/dmake.dart';
  
Version Uploaded Documentation Archive
0.0.3 Oct 31, 2018 Go to the documentation of dmake 0.0.3 Download dmake 0.0.3 archive
0.0.2 Oct 31, 2018 Go to the documentation of dmake 0.0.2 Download dmake 0.0.2 archive
0.0.1 Oct 31, 2018 Go to the documentation of dmake 0.0.1 Download dmake 0.0.1 archive
0.0.0 Oct 30, 2018 Go to the documentation of dmake 0.0.0 Download dmake 0.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6

Platforms

Detected platforms: Flutter, other

Primary library: package:dmake/dmake.dart with components: io.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
args ^1.0.0 1.5.1
glob ^1.0.0 1.1.7
graphs ^0.1.2 0.1.3+1
io ^0.3.2 0.3.3
logging ^0.11.0 0.11.3+2
mime ^0.9.6 0.9.6+2
path ^1.0.0 1.6.2
rxdart ^0.19.0 0.19.0
watcher ^0.9.7 0.9.7+10
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
meta 1.1.6
source_span 1.4.1
string_scanner 1.0.4