include_dir

Build Status Build status license Crates.io

An extension to the include_str!() macro for embedding an entire directory tree into your binary.

Getting Started

To embed a directory and its contents into your binary, you'll need to add the following to your build.rs script.

```rust extern crate include_dir;

use std::env; use std::path::Path; use includedir::includedir;

fn main() { let outdir = env::var("OUTDIR").unwrap(); let destpath = Path::new(&outdir).join("assets.rs");

include_dir("assets")
    .as_variable("SRC")
    .to_file(dest_path)
    .unwrap();
}

```

Integration Tests

Because a large part of this crate's functionality depends on generated code, it's easier to test functionality from the point-of-view of an end user. Therefore, a large proportion of the crate's tests are orchestrated by a Python script.

For each *.rs file in the integration_tests/ directory, this Python script will: