mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 01:13:23 +00:00
Implement OSDK functionalities and opt-in OSDK for asterinas
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
bc9bce9dea
commit
f97d0f1260
27
osdk/src/commands/run.rs
Normal file
27
osdk/src/commands/run.rs
Normal file
@ -0,0 +1,27 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::config_manager::{BuildConfig, RunConfig};
|
||||
use crate::utils::{get_current_crate_info, get_target_directory};
|
||||
|
||||
use super::build::create_base_and_build;
|
||||
use super::utils::DEFAULT_TARGET_RELPATH;
|
||||
|
||||
pub fn execute_run_command(config: &RunConfig) {
|
||||
let osdk_target_directory = get_target_directory().join(DEFAULT_TARGET_RELPATH);
|
||||
let target_name = get_current_crate_info().name;
|
||||
let default_bundle_directory = osdk_target_directory.join(target_name);
|
||||
|
||||
let required_build_config = BuildConfig {
|
||||
manifest: config.manifest.clone(),
|
||||
cargo_args: config.cargo_args.clone(),
|
||||
};
|
||||
|
||||
// TODO: Check if the bundle is already built and compatible with the run configuration.
|
||||
let bundle = create_base_and_build(
|
||||
&default_bundle_directory,
|
||||
&osdk_target_directory,
|
||||
&required_build_config,
|
||||
);
|
||||
|
||||
bundle.run(&config);
|
||||
}
|
Reference in New Issue
Block a user