3 unstable releases

0.2.0 Dec 27, 2022
0.1.2 Sep 5, 2022
0.1.1 Sep 3, 2022

#687 in Development tools

37 downloads per month
Used in 3 crates

MIT/Apache

540KB
14K 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:

The Assemble Standard Library

Contains extra stuff for assemble-daemon-rs that don't need to be in the core crate, but provide good content.

Dependencies

~18–36MB
~594K SLoC