Skip to content

Commit

Permalink
resolves #1606 upgrade PlantUML to 1.2023.10 (#1615)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Aug 15, 2023
1 parent aed6e1d commit 6aa568e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ asciidoc:
blockdiag-version: 3.1.0
bpmn-version: 13.2.0
bytefield-version: 1.8.0
c4plantuml-version: 1.2023.7
c4plantuml-version: 1.2023.10
d2-version: 0.5.1
dbml-version: 1.0.26
diagramsnet-version: 16.2.4
Expand All @@ -20,7 +20,7 @@ asciidoc:
nwdiag-version: 3.1.0
packetdiag-version: 3.1.0
pikchr-version: '7269f78c4a'
plantuml-version: 1.2023.7
plantuml-version: 1.2023.10
rackdiag-version: 3.1.0
seqdiag-version: 3.1.0
structurizr-version: 1.32.0
Expand Down
6 changes: 3 additions & 3 deletions server/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ When a new version is available, we need to :

=== PlantUML

We are producing native binaries with GraalVM: https://github.com/ggrossetie/plantuml/releases
We are producing native binaries with GraalVM: https://github.com/yuzutech/plantuml/releases

When a new version is available, we need to:

. update the fork
. run the following workflow: https://github.com/ggrossetie/plantuml/actions/workflows/native-image-on-demand.yml
. run the following workflow: https://github.com/yuzutech/plantuml/actions/workflows/native-image-on-demand.yml
. update the argument variable `ARG PLANTUML_VERSION="x.y.z"` in `server/ops/docker/jdk11-jammy/Dockerfile`

=== UMLet
Expand All @@ -34,4 +34,4 @@ When a new version is available, we need to:

. update the fork
. run the following workflow: https://github.com/yuzutech/umlet/actions/workflows/release.yml
. update the argument variable `ARG UMLET_VERSION="x.y.z"` in `server/ops/docker/jdk11-jammy/Dockerfile`
. update the argument variable `ARG UMLET_VERSION="x.y.z"` in `server/ops/docker/jdk11-jammy/Dockerfile`
4 changes: 2 additions & 2 deletions server/ops/docker/jdk11-jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ RUN SVGBOB_VERSION=`cat Cargo.toml | grep "svgbob_cli =" | sed -r 's/.*"([^"]+)"
FROM eclipse-temurin:11.0.19_7-jre-jammy

ARG D2_VERSION="0.5.1"
ARG PLANTUML_VERSION="1.2023.7"
ARG PLANTUML_VERSION="1.2023.10"
ARG UMLET_VERSION="2023-03-20_UMLet_v15.1"
ARG GRAPHVIZ_VERSION="8.0.5"
ARG DITAA_VERSION="1.0.3"
Expand Down Expand Up @@ -289,7 +289,7 @@ RUN wget "https://github.com/terrastruct/d2/releases/download/v${D2_VERSION}/d2-
mv usr/bin/d2-v${D2_VERSION}/bin/d2 /usr/bin/d2 && \
chmod +x /usr/bin/d2

RUN wget "https://github.com/ggrossetie/plantuml/releases/download/v${PLANTUML_VERSION}/plantuml-linux-${TARGETARCH}-${PLANTUML_VERSION}" -O /usr/bin/plantuml && \
RUN wget "https://github.com/yuzutech/plantuml/releases/download/v${PLANTUML_VERSION}/plantuml-linux-${TARGETARCH}-${PLANTUML_VERSION}" -O /usr/bin/plantuml && \
chmod +x /usr/bin/plantuml

RUN wget "https://github.com/yuzutech/umlet/releases/download/${UMLET_VERSION}/umlet-linux-${TARGETARCH}" -O /usr/bin/umlet && \
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/io/kroki/server/service/Plantuml.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public SourceDecoder getSourceDecoder() {

@Override
public String getVersion() {
return "1.2023.7";
return "1.2023.10";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class DownloadPlantumlNativeImage {

public static Future<PlantumlCommand> download(Vertx vertx) {
String plantumlVersion = new Plantuml(vertx, new JsonObject()).getVersion();
String downloadUrl = "https://github.com/ggrossetie/plantuml/releases/download/v" + plantumlVersion + "/plantuml-linux-amd64-" + plantumlVersion;
String downloadUrl = "https://github.com/yuzutech/plantuml/releases/download/v" + plantumlVersion + "/plantuml-linux-amd64-" + plantumlVersion;
return DownloadNativeImage.download(vertx, downloadUrl, "PlantUML", "plantuml-linux-amd64-" + plantumlVersion).map(plantumlBinPath -> {
JsonObject options = new JsonObject();
options.put("KROKI_PLANTUML_BIN_PATH", plantumlBinPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -689,6 +686,29 @@ void should_use_specified_theme() throws IOException, InterruptedException {
assertThat(stripComments(new String(convert))).isEqualTo(read(expectedFileName));
}

@Test
void should_include_awslib() throws IOException, InterruptedException {
String diagram = "!include <awslib/AWSCommon>\n" +
"!include <awslib/Groups/all.puml>\n" +
"\n" +
"AWSAccountGroup(externalAccount, \"AWS account external\") {\n" +
"\n" +
"}";
byte[] convert = plantumlCommand.convert(diagram, FileFormat.SVG, new JsonObject());
assertThat(new String(convert)).contains("xlink:href=\"data:image/png;base64,");
}

@Test
void should_include_openiconic() throws IOException, InterruptedException {
String diagram = "listopeniconic";
byte[] convert = plantumlCommand.convert(diagram, FileFormat.SVG, new JsonObject());
System.out.println(new String(convert));
Pattern pattern = Pattern.compile("<path d=");
String output = new String(convert);
int countOccurrences= (output.length() - output.replace("<path d=\"", "").length()) / "<path d=\"".length();
assertThat(countOccurrences).isEqualTo(223); // 223 icons
}

private String read(String name) throws IOException {
try (BufferedReader buffer = new BufferedReader(new InputStreamReader(PlantumlServiceTest.class.getClassLoader().getResourceAsStream(name)))) {
return buffer.lines().collect(Collectors.joining("\n"));
Expand Down

0 comments on commit 6aa568e

Please sign in to comment.