oysterpack_built 0.1.0

OysterPack Built
Documentation

oysterpack_built

This builds upon built ... pun intended :)

How to integrate within your project

  1. Add the following to Cargo.toml:

    [package]
    build = "build.rs"
    
    [build-dependencies]
    oysterpack_built = "0.1.0"
    
  2. Include the following in build.rs:

    Libraries

    extern crate oysterpack_built;
    
    fn main() {
        oysterpack_built::write_lib_built_file().expect("Failed to acquire build-time information");
    }
    

    Applications

    extern crate oysterpack_built;
    
    fn main() {
        oysterpack_built::write_app_built_file().expect("Failed to acquire build-time information");
    }
    
    • includes application dependency info
      • NOTE: dependency info can only be collected for standalone projects, i.e., this will not work for projects that are part of a Cargo workspace.
        • Cargo.lock is used to get the application's dependencies. Since Cargo.lock is shared by all projects in a workspace, this approach won't work for workspaces.
  3. The build script will by default write a file named built.rs into Cargo's output directory. It can be picked up like this:

    // Use of a mod or pub mod is not actually necessary.
    pub mod build {
       // The file has been placed there by the build script.
       include!(concat!(env!("OUT_DIR"), "/built.rs"));
    }