Skip to content
Draft
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 .sbtopts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-J-Xmx2G
-J-Xmx4G
4 changes: 3 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ val V = new {
val decline = "2.4.0"
val jsoniter = "2.19.0"
val weaver = "0.8.1"
val rendition = "0.0.3"
val http4sJdkClient = "0.8.0"
val organizeImports = "0.6.0"

Expand Down Expand Up @@ -208,7 +209,8 @@ lazy val generate = projectMatrix
.dependsOn(meta)
.defaultAxes(V.default*)
.settings(
name := "generate"
name := "generate",
libraryDependencies += "com.indoorvivants" %%% "rendition" % V.rendition
)
.jvmPlatform(V.jvmScalaVersions)
.settings(noPublishing)
Expand Down
12 changes: 7 additions & 5 deletions modules/generate/src/main/scala/generate.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import scala.reflect.TypeTest

import langoustine.meta.*

import rendition.*

@main def run(path: String) =
import upickle.default.*
import json.{*, given}
Expand All @@ -23,14 +25,14 @@ import langoustine.meta.*

import Render.*

given Render.Config(indents = Indentation(0), indentSize = IndentationSize(2))

def inFile(s: String)(f: LineBuilder => Unit) =
val out = Render.LineBuilder()
def inFile(s: String)(f: Rendering => Unit) =
val out = LineBuilder()
out.appendLine(Constants.LICENCE)
out.appendLine("")

f(out)
out.render { r =>
f(r)
}
Using.resource(new FileWriter(Paths.get(path, s).toFile())) { fw =>
fw.write(out.result)
}
Expand Down
Loading