Implement OSDK functionalities and opt-in OSDK for asterinas

This commit is contained in:
Zhang Junyang
2024-02-21 16:58:40 +08:00
committed by Tate, Hongliang Tian
parent bc9bce9dea
commit f97d0f1260
103 changed files with 1663 additions and 1295 deletions

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
use std::{collections::HashMap, fs::File, io::Read, ops::Add, process::Command, str::FromStr};
use std::{collections::HashMap, fs::File, io::Read, ops::Add, path::PathBuf, process::Command, str::FromStr};
use json::JsonValue;
use proc_macro2::{Group, TokenStream};
@ -11,6 +11,7 @@ use crate::COMPONENT_FILE_NAME;
#[derive(Debug)]
pub struct ComponentInfo {
name: String,
/// The absolute path to the component
path: String,
priority: u16,
}
@ -87,13 +88,14 @@ pub fn component_generate() -> Vec<ComponentInfo> {
};
let component_info = ComponentInfo {
name: package["name"].as_str().unwrap().to_string(),
path: path.to_owned(),
path: PathBuf::from(&workspace_root).join(path).to_str().unwrap().to_string(),
priority: *mapping
.get(&package["name"].as_str().unwrap().to_string())
.unwrap(),
};
components_info.push(component_info)
}
components_info
}