Crate xtasks

source ·
Expand description

XTasks

XTasks Logo

Essential tools and tasks for Rust projects using the xtask pattern, simplifying common build and development workflows.

Crates.io Lib.rs License Rust

xtasks is a comprehensive Rust library designed to facilitate common operations and tasks in projects that adhere to the xtask pattern. This pattern is prevalent in the Rust ecosystem, where it is used to define custom build, test, and deployment scripts within a project’s workspace.

Overview

The library aims to simplify and standardize the process of handling frequent project-related tasks, offering a range of functionalities from basic file operations to intricate continuous integration workflows and documentation generation. It provides both low-level building blocks and high-level abstractions to cater to different use cases and levels of complexity.

Modules

  • ops: This module contains fundamental building block operations such as file manipulation, confirmation prompts, and command execution. It serves as the foundation for more complex tasks.

  • tasks: Here, you’ll find higher-level functionalities and default implementations for common project tasks, streamlining processes like code coverage analysis, CI/CD workflows, and more.

  • macros: This module offers a collection of convenient macros designed to expedite common operations, reducing boilerplate and enhancing code readability.

Features

  • Simplicity: Provides a user-friendly API, making it easy for developers to integrate xtasks into their projects and start automating their workflows.

  • Extensibility: Designed with extensibility in mind, allowing developers to easily add new tasks and customize existing ones to meet the unique needs of their projects.

  • Robustness: Incorporates thorough error handling and validation, ensuring that tasks are executed reliably and any issues are promptly reported.

  • Integration: Seamlessly integrates with existing Rust tooling and conventions, ensuring a smooth development experience.

Usage

To integrate xtasks into your project, add it as a dependency in your Cargo.toml file. Once added, you can leverage the various functionalities and tasks provided by the library. Here’s an example on how to use a function from the ops module:

use xtasks::ops::clean_files;

clean_files("target/debug/*.tmp")?;

Contributing

Contributions to xtasks are warmly welcomed. Whether it’s enhancing existing features, fixing bugs, or implementing new functionalities, your input is valuable. Please ensure that all contributions are accompanied by comprehensive documentation and tests, adhering to the project’s coding standards. Please see CONTRIBUTING.md for details on how to contribute.

License

xtasks is distributed under the terms of both the MIT license and the Apache License (Version 2.0), providing flexibility and ensuring open-source readiness.

Enjoy automating your workflows with xtasks!

Modules

  • The macros module offers a collection of convenient macros designed to expedite common operations, reducing boilerplate and enhancing code readability.
  • The ops module contains fundamental building block operations such as file manipulation, confirmation prompts, and command execution. It serves as the foundation for more complex tasks. xtasks is a collection of building block operations such as copy, remove, confirm, and more for use in Rust project management tasks.
  • The tasks module contains higher-level functionalities and default implementations for common project tasks, streamlining processes like code coverage analysis, CI/CD workflows, and more.

Macros

  • Macros related to asserting conditions in the code.
  • Executes a cargo command with optional arguments and error handling.
  • Macros related to executing shell commands.
  • Prints a formatted message to the console without a newline.
  • Prints a formatted message to the console with a newline.
  • Executes a cargo command and provides context for any potential errors.
  • Executes a command and provides context for any potential errors.
  • Executes a standard command and provides context for any potential errors.