dmake 0.0.1

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

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.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.1

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]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
47
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: Flutter, other

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

Health issues and suggestions

Document public APIs. (-1 points)

25 out of 25 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/glob.dart. (-1 points)

Analysis of lib/src/glob.dart reported 2 hints:

line 6 col 40: Use = to separate a named parameter from its default value.

line 6 col 64: Use = to separate a named parameter from its default value.

Fix lib/src/process.dart. (-1 points)

Analysis of lib/src/process.dart reported 2 hints:

line 7 col 32: Use = to separate a named parameter from its default value.

line 9 col 36: Use = to separate a named parameter from its default value.

Fix lib/dart.dart. (-0.50 points)

Analysis of lib/dart.dart reported 1 hint:

line 5 col 43: Use = to separate a named parameter from its default value.

Fix lib/sass.dart. (-0.50 points)

Analysis of lib/sass.dart reported 1 hint:

line 6 col 65: Use = to separate a named parameter from its default value.

Maintenance suggestions

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

While nothing is inherently wrong with versions of 0.0.*, it might mean 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 0.2.0
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 0.20.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.7
source_span 1.5.4
string_scanner 1.0.4
term_glyph 1.1.0