Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Remove support for external location with new Structurizr version #89

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ EXPOSE 3000

WORKDIR /docs

CMD ["java", "-jar", "/app/structurizr-to-png.jar"]
ENTRYPOINT ["/opt/java/openjdk/bin/java", "-jar", "/app/structurizr-to-png.jar"]
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
Create PNGs from [Structurizr DSL](https://github.com/structurizr/dsl#readme) files.

This project uses [PlantUML](https://plantuml.com) or [Graphviz](https://graphviz.org) to render Structurizr DSL to PNG
images with various rendering strategies. Image rendering is based on exports from the Structurizr CLI. The project
performs some post-processing of the workspace model to support conventions around external software systems.
images with various rendering strategies. Image rendering is based on exports from the Structurizr CLI.

* Tags are mapped to shapes in the [`theme.json`](./src/main/resources/themes/theme.json)
* Systems tagged with `External`, `External System` or `Existing System` will be rendered as external
A default [`theme.json`](./src/main/resources/themes/theme.json) is used when no user provided theme is referenced. The
default theme maps tags to shapes and has some conventions around external systems.

## Features

Expand Down
Binary file modified images/c4plantuml/structurizr-PriceTracker-Container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/c4plantuml/structurizr-PriceTracker-SystemContext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/graphviz/structurizr-PriceTracker-Container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/graphviz/structurizr-PriceTracker-SystemContext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/structurizr/structurizr-PriceTracker-Container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/structurizr/structurizr-PriceTracker-SystemContext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-stack-depchain</artifactId>
<version>4.4.4</version>
<version>4.5.9</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -83,22 +83,22 @@
<dependency>
<groupId>com.structurizr</groupId>
<artifactId>structurizr-client</artifactId>
<version>1.24.1</version>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.structurizr</groupId>
<artifactId>structurizr-core</artifactId>
<version>1.24.1</version>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.structurizr</groupId>
<artifactId>structurizr-dsl</artifactId>
<version>1.30.2</version>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.structurizr</groupId>
<artifactId>structurizr-export</artifactId>
<version>1.15.0</version>
<version>2.2.0</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand All @@ -124,7 +124,7 @@
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.5.0</version>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
Expand All @@ -137,12 +137,12 @@
<dependency>
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2023.10</version>
<version>1.2024.6</version>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>2.4.0</version>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -191,11 +191,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<version>3.3.1</version>
<configuration>
<argLine>@{argLine} -Dfile.encoding=UTF-8</argLine>
<runOrder>random</runOrder>
Expand All @@ -204,7 +204,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<version>0.8.12</version>
<executions>
<execution>
<id>jacoco-surefire</id>
Expand Down Expand Up @@ -233,7 +233,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<version>3.7.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
Expand All @@ -253,7 +253,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.2</version>
<configuration>
<archive>
<manifest>
Expand Down
19 changes: 9 additions & 10 deletions src/main/java/com/extendaretail/dsl2png/WorkspaceReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.structurizr.Workspace;
import com.structurizr.dsl.StructurizrDslParser;
import com.structurizr.dsl.StructurizrDslParserException;
import com.structurizr.model.Location;
import com.structurizr.model.SoftwareSystem;
import com.structurizr.view.ComponentView;
import com.structurizr.view.Configuration;
Expand Down Expand Up @@ -54,7 +53,7 @@ public WorkspaceReader(int themePort) {
public Workspace loadFromDsl(File dslFile) throws IOException, StructurizrDslParserException {
Workspace workspace = parseDsl(dslFile);
addTheme(workspace);
setExternalLocation(workspace);
// setExternalLocation(workspace);
workspace
.getViews()
.getViews()
Expand Down Expand Up @@ -121,12 +120,12 @@ private void addTheme(Workspace workspace) throws IOException {
}
}

private void setExternalLocation(Workspace workspace) {
workspace.getModel().getSoftwareSystems().stream()
.filter(hasExternalTag)
.forEach(
s -> {
s.setLocation(Location.External);
});
}
// private void setExternalLocation(Workspace workspace) {
// workspace.getModel().getSoftwareSystems().stream()
// .filter(hasExternalTag)
// .forEach(
// s -> {
// s.setLocation(Location.External);
// });
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.extendaretail.dsl2png.vertx.MainVerticle;
import com.structurizr.Workspace;
import com.structurizr.dsl.StructurizrDslParserException;
import com.structurizr.model.Location;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Vertx;
import io.vertx.junit5.VertxExtension;
Expand Down Expand Up @@ -42,11 +41,6 @@ void dslWithValidSyntax(TestInfo testInfo, Vertx vertx, VertxTestContext testCon
assertEquals(2, workspace.getModel().getSoftwareSystems().size());
assertEquals(4, workspace.getViews().getViews().size());

// Location should've been decorated.
assertEquals(
Location.External,
workspace.getModel().getSoftwareSystemWithName("Existing System").getLocation());

testContext.completeNow();
});
}
Expand All @@ -61,7 +55,8 @@ void dslWithSyntaxError(TestInfo testInfo, VertxTestContext testContext) throws
() -> new WorkspaceReader(httpPort).loadFromDsl(createInvalidDsl(testInfo)));
assertThat(e)
.hasMessageContaining("Unexpected tokens")
.hasMessageContaining("at line 3: user = personX \"User\" \"A user\"");
.hasMessageContaining("at line 3")
.hasMessageContaining("user = personX \"User\" \"A user\"");
testContext.completeNow();
});
}
Expand Down
Loading