From 65f49b8e38e31df3422bf9d1a1a65928b214d533 Mon Sep 17 00:00:00 2001 From: tmorin Date: Wed, 18 Sep 2024 20:26:48 +0200 Subject: [PATCH] feat: upgrade PlantUML to 1.2024.7 switching to the GitHub repository fix #12 --- .github/workflows/Continuous-Integration.yml | 2 +- src/constants.rs | 4 ++-- src/plantuml.rs | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/Continuous-Integration.yml b/.github/workflows/Continuous-Integration.yml index e789e48..a946919 100644 --- a/.github/workflows/Continuous-Integration.yml +++ b/.github/workflows/Continuous-Integration.yml @@ -117,7 +117,7 @@ jobs: rustup target add ${{ matrix.target }} - name: "Build the deb package" run: | - cargo deb --target=${{ matrix.target }} -- --release --features vendored-openssl + cargo deb --target=${{ matrix.target }} --profile release -- --features vendored-openssl - name: "Upload the deb package" uses: actions/upload-artifact@v3 with: diff --git a/src/constants.rs b/src/constants.rs index fcf1d3f..11d9787 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -106,13 +106,13 @@ pub fn get_default_tera_discovery_pattern() -> String { TERA_DISCOVERY_PATTERN.to_string() } -pub const PLANTUML_VERSION: &str = "1.2022.4"; +pub const PLANTUML_VERSION: &str = "1.2024.7"; pub fn get_default_plantuml_version() -> String { PLANTUML_VERSION.to_string() } -pub const PLANTUML_JAR: &str = ".cache/plantuml-1.2022.4.jar"; +pub const PLANTUML_JAR: &str = ".cache/plantuml-1.2024.7.jar"; pub fn get_default_plantuml_jar() -> String { PLANTUML_JAR.to_string() diff --git a/src/plantuml.rs b/src/plantuml.rs index 587d5c2..34c0d5a 100644 --- a/src/plantuml.rs +++ b/src/plantuml.rs @@ -4,9 +4,8 @@ use std::io::Write; use std::path::Path; use std::process::Command; -use anyhow::Result; - use crate::utils::create_parent_directory; +use anyhow::Result; #[derive(Debug)] pub struct PlantUML { @@ -49,10 +48,9 @@ impl PlantUML { Ok(()) } pub fn download(&self) -> Result<()> { - // https://netcologne.dl.sourceforge.net/project/plantuml/1.2022.4/plantuml.1.2022.4.jar - // https://downloads.sourceforge.net/project/plantuml/1.2022.4/plantuml.1.2022.4.jar + // https://github.com/plantuml/plantuml/releases/download/v1.2024.7/plantuml-1.2024.7.jar let url = format!( - "https://downloads.sourceforge.net/project/plantuml/{}/plantuml.{}.jar", + "https://github.com/plantuml/plantuml/releases/download/v{}/plantuml-{}.jar", self.plantuml_version, self.plantuml_version, ); @@ -70,6 +68,7 @@ impl PlantUML { anyhow::Error::new(e).context(format!("unable to open {}", &self.plantuml_jar)) })?; + log::info!("download the PlantUML jar from {}", url); reqwest::blocking::get(&url) .map_err(|e| anyhow::Error::new(e).context(format!("unable to download {}", &url)))? .copy_to(&mut destination_file)