Skip to content

Commit b760a50

Browse files
committed
Add sbt-assembly for dotty-bot
1 parent 04c1ce2 commit b760a50

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

bot/src/dotty/tools/bot/BotServer.scala renamed to bot/src/dotty/tools/bot/Main.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ object Main extends ServerApp with PullRequestService {
99

1010
val user = sys.env("USER")
1111
val token = sys.env("TOKEN")
12+
val port = sys.env("PORT").toInt
1213

1314
/** Services mounted to the server */
1415
final val services = prService
1516

1617
override def server(args: List[String]): Task[Server] = {
1718
BlazeBuilder
18-
.bindHttp(8080, "localhost")
19+
.bindHttp(port, "0.0.0.0")
1920
.mountService(services, "/api")
2021
.start
2122
}

project/Build.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import complete.DefaultParsers._
44
import java.io.{ RandomAccessFile, File }
55
import java.nio.channels.FileLock
66
import scala.reflect.io.Path
7+
import sbtassembly.AssemblyKeys.assembly
78

89
import org.scalajs.sbtplugin.ScalaJSPlugin
910
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
@@ -173,6 +174,10 @@ object DottyBuild extends Build {
173174
settings(
174175
resourceDirectory in Test := baseDirectory.value / "test" / "resources",
175176

177+
// specify main and ignore tests when assembling
178+
mainClass in assembly := Some("dotty.tools.bot.Main"),
179+
test in assembly := {},
180+
176181
libraryDependencies ++= {
177182
val circeVersion = "0.7.0"
178183
val http4sVersion = "0.15.3"

project/plugins.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
88
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")
99

1010
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.8")
11+
12+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")

0 commit comments

Comments
 (0)