aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTill Höppner2016-02-16 19:06:31 +0100
committerTill Höppner2016-02-16 19:06:31 +0100
commite215c9f8bff4e049ebce94d3c5620f8ec03ed832 (patch)
tree672ff1091888a96b956da6f4b696b15ac805ff79 /examples
downloadincludedir-e215c9f8bff4e049ebce94d3c5620f8ec03ed832.tar.gz
includedir-e215c9f8bff4e049ebce94d3c5620f8ec03ed832.tar.xz
includedir-e215c9f8bff4e049ebce94d3c5620f8ec03ed832.zip
Initial commit.
Diffstat (limited to 'examples')
-rw-r--r--examples/foo/Cargo.toml11
-rw-r--r--examples/foo/build.rs5
-rw-r--r--examples/foo/src/data/empty0
-rw-r--r--examples/foo/src/data/foo1
-rw-r--r--examples/foo/src/data/inner/boom1
-rw-r--r--examples/foo/src/main.rs9
6 files changed, 27 insertions, 0 deletions
diff --git a/examples/foo/Cargo.toml b/examples/foo/Cargo.toml
new file mode 100644
index 0000000..8a30ca2
--- /dev/null
+++ b/examples/foo/Cargo.toml
@@ -0,0 +1,11 @@
+[package]
+name = "foo"
+version = "0.1.0"
+authors = ["Till Höppner <till@hoeppner.ws>"]
+build = "build.rs"
+
+[dependencies]
+phf = "*"
+
+[build-dependencies.includedir]
+path = "../.."
diff --git a/examples/foo/build.rs b/examples/foo/build.rs
new file mode 100644
index 0000000..1196b6a
--- /dev/null
+++ b/examples/foo/build.rs
@@ -0,0 +1,5 @@
+extern crate includedir;
+
+fn main() {
+ includedir::build("src/data").unwrap();
+}
diff --git a/examples/foo/src/data/empty b/examples/foo/src/data/empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/foo/src/data/empty
diff --git a/examples/foo/src/data/foo b/examples/foo/src/data/foo
new file mode 100644
index 0000000..257cc56
--- /dev/null
+++ b/examples/foo/src/data/foo
@@ -0,0 +1 @@
+foo
diff --git a/examples/foo/src/data/inner/boom b/examples/foo/src/data/inner/boom
new file mode 100644
index 0000000..9e2ba7e
--- /dev/null
+++ b/examples/foo/src/data/inner/boom
@@ -0,0 +1 @@
+boom
diff --git a/examples/foo/src/main.rs b/examples/foo/src/main.rs
new file mode 100644
index 0000000..8270aec
--- /dev/null
+++ b/examples/foo/src/main.rs
@@ -0,0 +1,9 @@
+extern crate phf;
+
+include!(concat!(env!("OUT_DIR"), "/dir_data.rs"));
+
+fn main() {
+ for (k, v) in FILES.entries() {
+ println!("{}: {} bytes", k, v.len());
+ }
+}