Skip to content

Commit

Permalink
Run caliban via JAR directly (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyri-petrou authored Dec 29, 2024
1 parent b6a28c9 commit 4773087
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions graphql/caliban/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ lazy val root = (project in file("."))
name := "scala-caliban",
run / fork := true,
run / javaOptions ++= Seq("-Xms4G", "-Xmx4G"),
assembly / mainClass := Some("Main"),
assembly / assemblyMergeStrategy := {
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case PathList("META-INF", "io.netty.versions.properties") => MergeStrategy.first
case x => MergeStrategy.first
},
libraryDependencies ++= Seq(
"com.github.ghostdogpr" %% "caliban-quick" % "2.9.0",
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.32.0",
Expand Down
1 change: 1 addition & 0 deletions graphql/caliban/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.0")
3 changes: 2 additions & 1 deletion graphql/caliban/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set -e

pwd
cd graphql/caliban
./sbt run
JAR_FILE=$(find . -name "scala-caliban-assembly*")
java -Xms4G -Xmx4G -jar $JAR_FILE
4 changes: 2 additions & 2 deletions graphql/caliban/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# For caliban
cd graphql/caliban
./sbt compile
cd ../../
./sbt assembly
cd ../../
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cd ../../

# For caliban
cd graphql/caliban
./sbt compile
./sbt assembly
cd ../../

# For async-graphql
Expand Down

0 comments on commit 4773087

Please sign in to comment.