File: build.rs

package info (click to toggle)
gir-rust-code-generator 0.21.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,516 kB
  • sloc: python: 191; makefile: 31
file content (14 lines) | stat: -rw-r--r-- 341 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::{fs::File, io::Write};
use std::env;
// Build.rs does not use all provided functions
#[allow(dead_code)]
#[path = "src/git.rs"]
mod git;

fn main() {

    let ver = env!("CARGO_PKG_VERSION");
    File::create("src/gir_version.rs")
        .and_then(|mut f| writeln!(f, "pub const VERSION: &str = \"{ver}\";",))
        .unwrap();
}