Skip to content

Commit a4a55d8

Browse files
authored
Merge pull request #214 from bitjourney/dependabot/gradle/net.sourceforge.plantuml-plantuml-1.2025.10
Bump net.sourceforge.plantuml:plantuml from 1.2025.7 to 1.2025.10
2 parents 19f2d79 + e3d1d21 commit a4a55d8

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ final MainClassName = "${group}.Main"
66
// See
77
// http://plantuml.com/changes
88
// https://search.maven.org/artifact/net.sourceforge.plantuml/plantuml
9-
final PlantUmlVersion = "1.2025.7"
9+
final PlantUmlVersion = "1.2025.10"
1010

1111
final ArchiveName = "plantuml-service.jar"
1212

src/main/kotlin/com/bitjourney/plantuml/DataSource.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.bitjourney.plantuml
22

3-
import net.sourceforge.plantuml.Option
3+
import net.sourceforge.plantuml.FileFormat
44

5-
data class DataSource(val source: String, val option: Option) {
5+
data class DataSource(val source: String, val fileFormat: FileFormat) {
66

77
// returns a rough count of the memory sizes
88
fun weight(): Int {

src/main/kotlin/com/bitjourney/plantuml/Main.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package com.bitjourney.plantuml
33
import com.github.benmanes.caffeine.cache.Caffeine
44
import com.github.benmanes.caffeine.cache.LoadingCache
55
import com.google.gson.JsonObject
6-
import net.sourceforge.plantuml.Option
6+
import net.sourceforge.plantuml.FileFormat
7+
import net.sourceforge.plantuml.FileFormatOption
78
import net.sourceforge.plantuml.SourceStringReader
89
import net.sourceforge.plantuml.code.TranscoderSmart
910
import net.sourceforge.plantuml.dot.GraphvizUtils
@@ -80,7 +81,7 @@ class Main {
8081

8182
// NOTE: Remove "skinparam monochrome true" for a while because it lets "SALT" to cause errors :(
8283
//val defaultConfig: List<String> = Arrays.asList()
83-
val option = Option("-tsvg")
84+
val fileFormat = FileFormat.SVG
8485

8586
val loader: LoadingCache<DataSource, ByteArray> = Caffeine.newBuilder()
8687
.maximumWeight(50 * 1024 * 1024) // about 50MiB
@@ -150,15 +151,15 @@ class Main {
150151
fun renderToResponse(source: String, response: Response) {
151152
response.type("image/svg+xml")
152153

153-
val svg = loader.get(DataSource(source, option))!!
154+
val svg = loader.get(DataSource(source, fileFormat))!!
154155
response.header("Content-Length", svg.size.toString())
155156
response.raw().outputStream.write(svg)
156157
}
157158

158159
fun render(data: DataSource): ByteArray {
159-
val renderer = SourceStringReader(data.option.defaultDefines, data.source, data.option.config)
160+
val renderer = SourceStringReader(data.source)
160161
val outputStream = ByteArrayOutputStream()
161-
renderer.outputImage(outputStream, data.option.fileFormatOption)
162+
renderer.outputImage(outputStream, FileFormatOption(data.fileFormat))
162163
return outputStream.toByteArray()
163164
}
164165

0 commit comments

Comments
 (0)