Crates.io | xtasks |
lib.rs | xtasks |
version | 0.0.2 |
source | src |
created_at | 2023-11-04 14:03:53.98409 |
updated_at | 2023-12-29 23:55:29.352636 |
description | Essential tools and tasks for Rust projects using the xtask pattern, simplifying common build and development workflows. |
homepage | https://xtasks.pro |
repository | https://github.com/sebastienrousseau/xtasks |
max_upload_size | |
id | 1025172 |
size | 111,917 |
Essential tools and tasks for Rust projects using the xtask pattern, simplifying common build and development workflows.
• Website • Documentation • Report Bug • Request Feature • Contributing Guidelines
ops.rs
)lib.rs
)macros.rs
)tasks.rs
)main.rs
)powerset.rs
)bloat.rs
)ci.rs
)docs.rs
)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.
ops.rs
)lib.rs
)macros.rs
)println!
and print!
macros for formatted console output.tasks.rs
)main.rs
)XTasks
binary, integrating various components of the project.powerset.rs
)bloat.rs
)ci.rs
)docs.rs
)These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You will need Rust and Cargo installed on your system. If you don't have them installed, you can install them from the official Rust website.
To use XTasks
, add it as a dependency to your Cargo.toml
file:
[dependencies]
xtasks = "0.0.2"
Then, in your lib.rs
or main.rs
file, add:
extern crate xtasks;
You can use XTasks
to simplify and standardize the process of building,
testing, and deploying your Rust projects. For more detailed usage examples,
please refer to the library's documentation.
To run the tests, use the following command:
cargo test
This section provides basic examples to demonstrate how to use some of the key features of XTasks in your Rust projects.
Using the enhanced file operations from ops.rs
:
// Assuming you've included the `xtasks` crate
use xtasks::file_operations;
fn main() {
// Copying a file
file_operations::copy("path/to/source.file", "path/to/destination.file").unwrap();
// Removing files based on a glob pattern
file_operations::remove_files("path/to/temporary/*.tmp").unwrap();
}
Implementing the custom println! and assert! macros:
// Importing macros from xtasks
use xtasks::{println, assert};
fn main() {
// Using the enhanced println! macro
println!("This is a formatted {} message", "output");
// Using a custom assert! macro
assert!(2 + 2 == 4, "Math error: 2 + 2 should equal 4");
}
Configuring and running CI tasks with ci.rs:
use xtasks::ci::CI;
fn main() {
let ci_config = CI::builder()
.nightly(true)
.enable_clippy_lints(true)
.build()
.unwrap();
ci_config.run();
}
For transparency into our release cycle and in striving to maintain backward compatibility, XTasks follows semantic versioning.
The project is licensed under the terms of both the MIT license and the Apache License (Version 2.0).
We welcome all people who want to contribute. Please see the contributing instructions for more information.
Contributions in any form (issues, pull requests, etc.) to this project must adhere to the Rust's Code of Conduct.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
A big thank you to all the awesome contributors of xtasks for their help and support.
A special thank you goes to the Rust Reddit community for providing a lot of useful suggestions on how to improve this project.