From b63a92502723e31ebff70a5db2dbb5dc154c81a3 Mon Sep 17 00:00:00 2001 From: haixuantao Date: Wed, 18 Jan 2023 14:12:21 +0100 Subject: [PATCH] Update `[workspace.dependencies]` version and template version --- Cargo.toml | 6 +++--- binaries/cli/src/template/rust/mod.rs | 5 +++-- binaries/cli/src/template/rust/node/Cargo-template.toml | 2 +- binaries/cli/src/template/rust/operator/Cargo-template.toml | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8ea3215e..dd46cb85 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,9 +22,9 @@ members = [ version = "0.1.3" [workspace.dependencies] -dora-node-api = { version = "0.1.2", path = "apis/rust/node", default-features = false } -dora-operator-api = { version = "0.1.2", path = "apis/rust/operator", default-features = false } -dora-core = { version = "0.1.2", path = "libraries/core" } +dora-node-api = { version = "0.1.3", path = "apis/rust/node", default-features = false } +dora-operator-api = { version = "0.1.3", path = "apis/rust/operator", default-features = false } +dora-core = { version = "0.1.3", path = "libraries/core" } [package] name = "dora-examples" diff --git a/binaries/cli/src/template/rust/mod.rs b/binaries/cli/src/template/rust/mod.rs index b74f0437..c9cd2fe4 100644 --- a/binaries/cli/src/template/rust/mod.rs +++ b/binaries/cli/src/template/rust/mod.rs @@ -4,6 +4,7 @@ use std::{ path::{Path, PathBuf}, }; +const VERSION: &str = env!("CARGO_PKG_VERSION"); pub fn create(args: crate::CommandNew) -> eyre::Result<()> { let crate::CommandNew { kind, @@ -81,7 +82,7 @@ fn create_operator(name: String, path: Option) -> Result<(), eyre::ErrR fs::create_dir(&src) .with_context(|| format!("failed to create directory `{}`", src.display()))?; - let cargo_toml = CARGO_TOML.replace("___name___", &name); + let cargo_toml = CARGO_TOML.replace("___name___", &name).replace("___version___", &VERSION); let cargo_toml_path = root.join("Cargo.toml"); fs::write(&cargo_toml_path, &cargo_toml) .with_context(|| format!("failed to write `{}`", cargo_toml_path.display()))?; @@ -117,7 +118,7 @@ fn create_custom_node(name: String, path: Option) -> Result<(), eyre::E fs::create_dir(&src) .with_context(|| format!("failed to create directory `{}`", src.display()))?; - let cargo_toml = CARGO_TOML.replace("___name___", &name); + let cargo_toml = CARGO_TOML.replace("___name___", &name).replace("___version___", &VERSION); let cargo_toml_path = root.join("Cargo.toml"); fs::write(&cargo_toml_path, &cargo_toml) .with_context(|| format!("failed to write `{}`", cargo_toml_path.display()))?; diff --git a/binaries/cli/src/template/rust/node/Cargo-template.toml b/binaries/cli/src/template/rust/node/Cargo-template.toml index 0052894b..1f937d2f 100644 --- a/binaries/cli/src/template/rust/node/Cargo-template.toml +++ b/binaries/cli/src/template/rust/node/Cargo-template.toml @@ -6,4 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dora-node-api = { git = "https://github.com/dora-rs/dora.git", tag = "v0.1.2" } +dora-node-api = { git = "https://github.com/dora-rs/dora.git", tag = "___version___" } diff --git a/binaries/cli/src/template/rust/operator/Cargo-template.toml b/binaries/cli/src/template/rust/operator/Cargo-template.toml index fe920b45..90388fdd 100644 --- a/binaries/cli/src/template/rust/operator/Cargo-template.toml +++ b/binaries/cli/src/template/rust/operator/Cargo-template.toml @@ -9,4 +9,4 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -dora-operator-api = { git = "https://github.com/dora-rs/dora.git", tag = "v0.1.2" } +dora-operator-api = { git = "https://github.com/dora-rs/dora.git", tag = "___version___" }