Skip to content

Commit

Permalink
feat: upgrade PlantUML to 1.2024.7 switching to the GitHub repository
Browse files Browse the repository at this point in the history
fix #12
  • Loading branch information
tmorin committed Sep 18, 2024
1 parent a596ac7 commit 65f49b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Continuous-Integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 4 additions & 5 deletions src/plantuml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
);

Expand All @@ -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)
Expand Down

0 comments on commit 65f49b8

Please sign in to comment.