Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Add build script to compile .gresource files
Browse files Browse the repository at this point in the history
Also add the required xml file and .gitignore rule.
  • Loading branch information
her001 committed Nov 29, 2017
1 parent e212d8c commit df0ed2f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
target
*~
*.gresource

1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -4,6 +4,7 @@ authors = ["Jonas Platte <mail@jonasplatte.de>"]
license = "GPL-3.0+"
version = "0.1.0"
repository = "https://github.com/fest-im/fest"
build = "build/build.rs"

[dependencies]
futures = "0.1.17"
Expand Down
17 changes: 17 additions & 0 deletions build/build.rs
@@ -0,0 +1,17 @@
use std::process::Command;

fn main() {
let gen_gresource = |file_prefix, dir| {
let fname = [file_prefix, "gresource.xml"].join(".");
let emsg = format!("Compiling {}/{}.gresource.xml failed.", dir, fname);
Command::new("glib-compile-resources")
.arg(fname)
.current_dir(dir)
.status()
.expect(&emsg);
};

gen_gresource("fest", "res");
gen_gresource("icons", "res/icons/hicolor");
}

8 changes: 8 additions & 0 deletions res/fest.gresource.xml
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/fest-im/fest">
<file>main_window.glade</file>
<file>gtk/menus.ui</file>
</gresource>
</gresources>

0 comments on commit df0ed2f

Please sign in to comment.