Crates.io | gdnative-project-utils |
lib.rs | gdnative-project-utils |
version | 0.1.4 |
source | src |
created_at | 2020-07-05 12:28:35.717347 |
updated_at | 2021-02-04 23:13:39.157387 |
description | Utilies for working with godot-rust GDNative projects |
homepage | |
repository | https://github.com/godot-rust/project-utils |
max_upload_size | |
id | 261583 |
size | 25,865 |
.gdnlib
and .gdns
filesThis crate autogenerates a .gdnlib
file for a crate and .gdns
files for all
types that derive NativeClass
from a cargo build script.
The following code in the build.rs
(or any cargo build script) will
automatically generate the Godot resources when the Rust code changes.
use gdnative_project_utils::*;
fn main() -> Result<(), Box<dyn std::error::Error>>{
/// directory to scan for Rust files
let classes = scan_crate("src")?;
/// generate files inside the Godot project directory
Generator::new()
.godot_project_dir("../")
.build(classes)?;
Ok(())
}
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed under the MIT license, without any additional terms or conditions.