-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.rs
31 lines (26 loc) · 925 Bytes
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#[allow(warnings)]
mod bindings;
use bindings::exports::morphir::platform::command_runner;
use bindings::exports::morphir::platform::project;
use bindings::exports::morphir::platform::project::ProjectInfo;
struct Component;
impl command_runner::Guest for Component {
fn run(args: Vec<String>) -> Result<String, ()> {
println!("Args are: {:?}", args);
let args_str = format!("Arguments are: {:?}", args);
Ok(args_str.to_string())
}
}
impl project::Guest for Component {
fn get_project_info(_path: String) -> Result<project::ProjectInfo, ()> {
let project_info = ProjectInfo {
name: "HardCoded.Project".to_string(),
source_directory: "src".to_string(),
includes: vec![],
dependencies: vec![],
local_dependencies: vec![],
};
Ok(project_info)
}
}
bindings::export!(Component with_types_in bindings);