aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTill Höppner2016-02-16 19:42:53 +0100
committerTill Höppner2016-02-16 19:43:48 +0100
commit970ced24c7105d52c2b93735e625f4510ca0d231 (patch)
tree159c91edb3e4bd4cf913ae852bbcf71f6d550c6b
parentfb3a628cbb2f95fb7e025eb40480488e45ed04cb (diff)
downloadincludedir-970ced24c7105d52c2b93735e625f4510ca0d231.tar.gz
includedir-970ced24c7105d52c2b93735e625f4510ca0d231.tar.xz
includedir-970ced24c7105d52c2b93735e625f4510ca0d231.zip
Add readme and travis testing
-rw-r--r--.travis.yml5
-rw-r--r--Cargo.toml2
-rw-r--r--README.md50
3 files changed, 56 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..b4f863c
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,5 @@
+language: rust
+rust:
+ - stable
+ - beta
+ - nightly
diff --git a/Cargo.toml b/Cargo.toml
index a1a4081..b6bbd4c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "includedir"
description = "Include a whole directory tree at compile time!"
-tags = ["include", "tree", "directory", "build", "static"]
+keywords = ["include", "tree", "directory", "build", "static"]
version = "0.1.1"
authors = ["Till Höppner <till@hoeppner.ws>"]
license = "MIT"
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5bb03ff
--- /dev/null
+++ b/README.md
@@ -0,0 +1,50 @@
+includedir
+===========
+
+[![Build Status](https://img.shields.io/travis/tilpner/includedir.svg?style=flat-square)](https://travis-ci.org/tilpner/includedir)
+[![Crates.io version](https://img.shields.io/crates/v/includedir.svg?style=flat-square)](https://crates.io/crates/includedir)
+[![Crates.io license](https://img.shields.io/crates/l/includedir.svg?style=flat-square)](https://crates.io/crates/includedir)
+
+Include a directory in your Rust binary, e.g. static files for your web server or assets for your game.
+
+## Example
+
+**Cargo.toml**
+```toml
+[package]
+name = "example"
+version = "0.1.0"
+
+build = "build.rs"
+include = ["data"]
+
+[dependencies]
+phf = "0.7.12"
+
+[build-dependencies]
+includedir = "0.1.1"
+```
+
+**build.rs**
+
+```rust
+extern crate includedir;
+
+fn main() {
+ includedir::build("data").unwrap();
+}
+```
+
+**src/main.rs**
+
+```rust
+extern crate phf;
+
+include!(concat!(env!("OUT_DIR"), "/dir_data.rs"));
+
+fn main() {
+ for (k, v) in FILES.entries() {
+ println!("{}: {} bytes", k, v.len());
+ }
+}
+```