feat: commit build field

This commit is contained in:
mrxiaozhuox committed 2022-08-18 15:54:42 -07:00
1 parent 6f4028f065
commit d9891d9f0c
9 files changed
+249 -248

No files matched your search

+5 -1
View File
@@ -1,3 +1,5 @@
use crate::plugin::PluginManager;
use super::*;
/// Build the Rust WASM app and all of its assets.
@@ -9,7 +11,7 @@ pub struct Build {
}
impl Build {
pub fn build(self) -> Result<()> {
pub fn build(self, plugin_manager: PluginManager) -> Result<()> {
let mut crate_config = crate::CrateConfig::new()?;
// change the release state.
@@ -32,6 +34,8 @@ impl Build {
.clone()
});
let _ = plugin_manager.on_build_event(&crate_config, &platform);
match platform.as_str() {
"web" => {
crate::builder::build(&crate_config, false)?;
+14
View File
@@ -56,3 +56,17 @@ pub enum Commands {
#[clap(subcommand)]
Tool(tool::Tool),
}
impl Commands {
pub fn to_string(&self) -> String {
match self {
Commands::Build(_) => "build",
Commands::Translate(_) => "translate",
Commands::Serve(_) => "sevre",
Commands::Create(_) => "create",
Commands::Clean(_) => "clean",
Commands::Config(_) => "config",
Commands::Tool(_) => "tool",
}.to_string()
}
}