dcli
  • Introduction
  • What does DCli do?
  • Install DCli
    • Installing on Windows
  • Writing your first CLI app
  • Add DCli to your project
  • pub.dev
  • github
  • Dart basics
    • Dart lambda functions
    • Function Arguments
    • Futures
    • stdin/stdout/stderr a primer
  • Tour
    • Overview
    • Using DCli functions
    • User input
      • Ask Validators
    • Displaying information
    • Managing Files And Directories
    • Environment variables
    • Calling apps
    • Redirecting output
    • Command Line Arguments
    • Paths
    • Glob Expansion
    • Piping
    • Locking
    • Fetch
    • The evils of CD
    • Assets/Resources
    • Cross Platform
      • Posix
      • Windows
      • Docker
        • Detecting Docker
        • Add DCli to a Docker Container
        • Example DCli app in Docker
  • Elevated Privileges
    • Sudo
  • Performance
  • Dependency Management
    • Dependency Management
    • Pubspec Managment
  • DCli Tools
    • DCli tools
    • Use a shebang #!
    • DCli Compile
    • DCli Clean
    • DCli Create
    • DCli Doctor
    • DCli Install
    • DCli Run
    • DCli Warmup
    • DCli Pack
    • Upgrade DCli
  • Internal Workings
    • Internal Workings
    • waitForEx
  • Contributing
    • Creating a release
    • Running Unit tests
    • Implemention support for a shell
    • Templates
  • References
  • Examples
    • Projects
    • Code
      • hello world.
      • dcompress
      • dpath
      • dmysql
      • dshell
      • dwhich
      • dipaddr
      • gnome launcher
  • Articles
    • build CLI apps in dart - part 1
    • build CLI apps in dart - part 2
    • Dealing with permissions
    • 3rd Party console packages
  • Dart on Linux - the perfect CLI tooling
  • Improving your build environment
    • Existing tooling
    • Building with Dart
    • A home for your build tools
  • Olivier Revial - CLI apps made easy
  • Video: package of the week
Powered by GitBook
On this page
  • Native Dart tools
  • build_runner
  • Github Actions

Was this helpful?

  1. Improving your build environment

Existing tooling

As with any software project the first thing you should do is have a look at what pre-existing software is available that might solve your problem.

Maintaining any software is expensive, so if someone else is offering to do it for you...

Dart that eco system has a number of pre-exiting tools this guide notes a few of the more common ones.

Drop us a line if you know of some other build tools that you think should be listed here.

Native Dart tools

To be complete here are some of the build related tools built into dart

  • dart format - format your source code

  • dart doc - generates Dart api documenation

  • dart fix - fixes common lint errors

  • dart compile - compiles a Dart library with a main entry point to an exe

  • dart create - creates a Dart project

build_runner

build_runner is a core Dart package and used by many packages to automate the build process.

If you are doing json serialisation then you will already have come across build_runner as it is used to generate the toJson and fromJson methods.

You can also use build_runner in your on project to automate build steps.

Unfortunately the documentation on build runner is fairly sparse and and hard to follow. If you want to use build_runner have a look at some of the projects that depend on build_runner.

pub.dev shows a list of packages that use (depend on) a package. This provides an easy way to find sample code for any package.

Github Actions

Github supports actions which allow you to automate a build/test process each time you push to git.

Github actions support Linux, Windows and MacOS which allows you to build a target for multiple OSs.

Github actions are essentially a declarative system as opposed to procedural.

I've never been a fan of declarative build systems (all the way back to make) as they tend to rely on too many magic interactions between declarative steps.

PreviousImproving your build environmentNextBuilding with Dart

Last updated 1 year ago

Was this helpful?