parsli 0.0.1

Parallel status lines for Rust
Documentation
use std::fs::File;
use std::io::Write;
use parsli::graph::DependencyGraph;
use parsli::task::Task;

/// This is a minimal example on how to use parsli
fn main() {
    let tasks = vec![
        Task::dummy("llvm.fetch", vec![]),
        Task::dummy("clang.configure", vec!["llvm.fetch"]),
        Task::dummy("compiler-rt.configure", vec!["llvm.fetch"]),
        Task::dummy("clang.compile", vec!["clang.configure"]),
        Task::dummy("compiler-rt.compile", vec!["compiler-rt.configure"]),
        Task::dummy("clang.install", vec!["clang.compile"]),
        Task::dummy("compiler-rt.install", vec!["compiler-rt.compile"]),
    ];
    let targets = vec!["clang.install".to_string(), "clang.configure".to_string(), "compiler-rt.configure".to_string()];
    // Create graph
    let mut graph = DependencyGraph::from(tasks);

    // Render graph
    let mut f = File::options().create(true).write(true).open("before.dot").unwrap();
    f.write(graph.to_string().as_bytes()).unwrap();

    // Produce targets
    graph.retain_dependencies(targets);
    for t in graph.toposort() {
        println!("{}", t);
    }

    // Render graph
    let mut f = File::options().create(true).write(true).open("after.dot").unwrap();
    f.write(graph.to_string().as_bytes()).unwrap();
}