#buildtool #dev

assemble-freight

The main executor for the assemble-rs project

4 releases

0.2.0 Dec 27, 2022
0.1.2 Sep 4, 2022
0.1.1 Sep 3, 2022
0.1.0 Jun 27, 2022

#1694 in Development tools

Download history 5/week @ 2023-11-06 7/week @ 2023-11-13 12/week @ 2023-11-20 19/week @ 2023-11-27 6/week @ 2023-12-04 4/week @ 2023-12-11 8/week @ 2023-12-18 16/week @ 2023-12-25 2/week @ 2024-01-01 4/week @ 2024-01-08 6/week @ 2024-01-15 2/week @ 2024-01-22 19/week @ 2024-01-29 4/week @ 2024-02-05 25/week @ 2024-02-12 124/week @ 2024-02-19

172 downloads per month
Used in assemble-exec

MIT/Apache

565KB
15K SLoC

assemble.rs

GitHub Workflow Status Crates.io Crates.io GitHub issues

A new building tool, built in rust. Inspired by make and gradle.

welcome task

Basic Concept

Creates a binary that can build a project by running tasks. This binary is created by this application and can be easily configured by end users.

There should be a multitude of ways of creating tasks for these projects that doesn't require extensive knowledge of rust.

The api for assemble.rs should provide ways of defining tasks, adding tasks to the build reactor, and checking on the result of the tasks.

Creating a build binary should be as easy as running

assemble-daemon startup # create the initial binary

Followed by

./assemble-daemon build

or

assemble-daemon build

Justification

Gradle is cool, but has certain limitations that could be avoided.

  • Requires a java installation
  • Requires internet connection for first build in order to get the wrapper
  • Many concepts are java specific, such as sourceSets

The aim for this project would be to address these issues while also providing other benefits for users.

Tasks

All tasks should have the following capabilities:

  • Run some actions
  • Define a set of inputs and outputs that can interacted with by other tasks.
  • Set task order:
    • Strict depends on - depended on task always runs
    • Strict finalized by - finalizer task always run after task
    • Run after - task should run after a task, but doesn't force the task to run
    • Run before - task should run before a task, but doesn't force the task to run
  • Report result of the Task

Once the project has been configured, the only parts of the task that should be mutable is the task properties.

Components

Besides tasks, here are some ideas for potential critical API objects

Project

Projects should hold the current state of the project as whole. This will include the actual project layout, tasks, and extensions to the project.

BuildException

This should represent that somehow the execution of building the project went wrong. This should be an Enum type to support multiple ways of representing states. The main exception types should be:

  • Stop Action - stop the current action of the task and move on to the next
  • Stop Task - stops the task without causing a failure
  • Task Failed - The task has failed, and should fail the build

TaskAction

Task actions should, in essence, be functions that take the form of

fn(&mut Self : ExecutableTask<Task>, &Project) -> Result<(), AssembleException>;

Freight and Parallelism

Tasks can be run in parallel with each-other, and freight automatically determines an order to execute tasks such that any tasks that aren't dependent on each-other can execute at the same time.

tasks in parallel

Bin Maker

Not implemented yet


lib.rs:

Freight is the main implementation library for how assemble projects are built.

Binaries produced by the bin maker should use this library for execution purposes.

Dependencies

~19–36MB
~611K SLoC