dartle 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 51

Dartle #

A simple build system written in Dart.

Dartle is designed to integrate well with pub and Dart's own build system, but help with automation tasks not covered by other tools.

It is inspired by Gradle.

How to use #

Add dartle to your dev_dependencies:

pubspec.yaml

dev_dependencies:
  dartle:

Write a dartle build file #

dartle.dart

import 'package:dartle/dartle.dart';

final allTasks = [Task(hello), Task(bye)];

main(List<String> args) async =>
    run(args, tasks: allTasks, defaultTasks: allTasks.sublist(0, 1));

hello() async {
  print("Hello!");
}

bye() async {
  print("Bye!");
}

Run your build! #

Option 1: using dartle #

You can use the dartle executable directly, which will snapshot your dartle.dart file and potentially run it faster.

First, activate it with pub:

pub global activate dartle

Now, simply run dartle (it will execute the dartle.dart file found in the working directory):

dartle

To run specific task(s), give them as arguments:

dartle hello bye

Output:

Running task: hello
Hello!
Running task: bye
Bye!
Option 2: using dart #

As dartle.dart files are simple Dart files, you can also execute them with dart, of course:

dart dartle.dart

To run specific task(s), give them as arguments:

dart dartle.dart hello bye

0.2.0 #

  • Implemented dartle executable. Snapshots dartle.dart in order to run faster.

0.1.0 #

  • Added basic functionality: run tasks, logging.

0.0.0 #

  • Initial version, created by Stagehand

example/dartle.dart

import 'package:dartle/dartle.dart';

final allTasks = [Task(hello), Task(bye)];

main(List<String> args) async =>
    run(args, tasks: allTasks, defaultTasks: allTasks.sublist(0, 1));

hello() async {
  print("Hello!");
}

bye() async {
  print("Bye!");
}

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate dartle

2. Use it

The package has the following executables:


$ dartle

Use this package as a library

1. Depend on it

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


dependencies:
  dartle: ^0.2.0

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:dartle/dartle.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
2
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
51
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:dartle/dartle.dart with components: io, isolate.

Health suggestions

Format lib/dartle_cache.dart.

Run dartfmt to format lib/dartle_cache.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
ansicolor ^1.0.2 1.0.2
args ^1.5.2 1.5.2
crypto ^2.1.2 2.1.3
logging ^0.11.3+2 0.11.3+2
meta ^1.1.7 1.1.7
path ^1.6.4 1.6.4
Transitive dependencies
charcode 1.1.2
collection 1.14.12
convert 2.1.1
typed_data 1.1.6
Dev dependencies
pedantic ^1.7.0
test ^1.5.0
test_process ^1.0.4