|
1 | | -scalaVersion := "2.12.4" |
| 1 | +import com.typesafe.sbt.packager.docker._ |
| 2 | + |
| 3 | +ThisBuild / organization := "de.upb.cs.swt.delphi" |
| 4 | +ThisBuild / organizationName := "Delphi Project" |
| 5 | +ThisBuild / organizationHomepage := Some(url("https://delphi.cs.uni-paderborn.de/")) |
| 6 | + |
| 7 | +ThisBuild / scmInfo := Some( |
| 8 | + ScmInfo( |
| 9 | + url("https://github.com/delphi-hub/delphi-cli"), |
| 10 | + "scm:[email protected]:delphi-hub/delphi-cli.git" |
| 11 | + ) |
| 12 | +) |
| 13 | + |
| 14 | +ThisBuild / developers := List( |
| 15 | + Developer( |
| 16 | + id = "bhermann", |
| 17 | + name = "Ben Hermann", |
| 18 | + |
| 19 | + url = url("https://www.thewhitespace.de") |
| 20 | + ) |
| 21 | +) |
| 22 | + |
| 23 | +ThisBuild / description := "The command line client for Delphi" |
| 24 | +ThisBuild / licenses := List("Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt")) |
| 25 | +ThisBuild / homepage := Some(url("https://delphi.cs.uni-paderborn.de/")) |
| 26 | + |
| 27 | +lazy val scala212 = "2.12.10" |
| 28 | +lazy val scala213 = "2.13.1" |
| 29 | +lazy val supportedScalaVersions = List(scala213) |
| 30 | + |
| 31 | +ThisBuild / scalaVersion := scala213 |
2 | 32 |
|
3 | 33 | name := "delphi" |
4 | | -version := "1.0.0-SNAPSHOT" |
| 34 | +version := "0.9.5" |
5 | 35 | maintainer := "Ben Hermann <[email protected]>" |
6 | 36 |
|
7 | | -licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")) |
8 | | - |
9 | 37 | packageSummary := "Windows Package for the Delphi CLI" |
10 | 38 | packageDescription := """Windows Package for the Delphi CLI""" |
11 | 39 | wixProductId := "ce07be71-510d-414a-92d4-dff47631848a" |
12 | 40 | wixProductUpgradeId := "4552fb0e-e257-4dbd-9ecb-dba9dbacf424" |
13 | 41 |
|
14 | 42 | scalastyleConfig := baseDirectory.value / "project" / "scalastyle_config.xml" |
15 | 43 |
|
16 | | -val akkaVersion = "2.5.14" |
17 | | -val akkaHttpVersion = "10.1.5" |
| 44 | +val http4sVersion = "0.21.0-M6" |
| 45 | + |
| 46 | +// Only necessary for SNAPSHOT releases |
| 47 | +resolvers += Resolver.sonatypeRepo("snapshots") |
18 | 48 |
|
19 | 49 | libraryDependencies ++= Seq( |
20 | | - "com.typesafe.akka" %% "akka-http-core" % akkaHttpVersion, |
21 | | - "com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion, |
22 | | - "com.typesafe.akka" %% "akka-stream" % akkaVersion |
| 50 | + "org.http4s" %% "http4s-dsl" % http4sVersion, |
| 51 | + "org.http4s" %% "http4s-blaze-client" % http4sVersion, |
| 52 | + "org.http4s" %% "http4s-circe" % http4sVersion |
23 | 53 | ) |
24 | 54 |
|
25 | | -libraryDependencies += "com.github.scopt" %% "scopt" % "3.7.0" |
26 | | -libraryDependencies += "io.spray" %% "spray-json" % "1.3.3" |
| 55 | +libraryDependencies += "com.github.scopt" %% "scopt" % "3.7.1" |
| 56 | +libraryDependencies += "io.spray" %% "spray-json" % "1.3.5" |
27 | 57 | libraryDependencies += "de.vandermeer" % "asciitable" % "0.3.2" |
28 | | -libraryDependencies += "com.lihaoyi" %% "fansi" % "0.2.5" |
29 | | -libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value |
| 58 | +libraryDependencies += "com.lihaoyi" %% "fansi" % "0.2.7" |
| 59 | +libraryDependencies += "au.com.bytecode" % "opencsv" % "2.4" |
| 60 | +libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.0" % "test" |
| 61 | +libraryDependencies += "joda-time" % "joda-time" % "2.10.5" |
| 62 | + |
| 63 | +libraryDependencies += "de.upb.cs.swt.delphi" %% "delphi-core" % "0.9.2" |
| 64 | +libraryDependencies += "de.upb.cs.swt.delphi" %% "delphi-client" % "0.9.2" |
| 65 | + |
| 66 | +libraryDependencies ++= Seq( |
| 67 | + "com.softwaremill.sttp" %% "core" % "1.7.2", |
| 68 | + "com.softwaremill.sttp" %% "spray-json" % "1.7.2" |
| 69 | +) |
| 70 | + |
30 | 71 |
|
31 | 72 | debianPackageDependencies := Seq("java8-runtime-headless") |
| 73 | +mainClass in Compile := Some("de.upb.cs.swt.delphi.cli.DelphiCLI") |
| 74 | +discoveredMainClasses in Compile := Seq() |
32 | 75 |
|
33 | 76 | lazy val cli = (project in file(".")). |
34 | 77 | enablePlugins(JavaAppPackaging). |
35 | 78 | enablePlugins(DockerPlugin). |
| 79 | + settings( |
| 80 | + dockerBaseImage := "openjdk:jre-alpine", |
| 81 | + dockerAlias := com.typesafe.sbt.packager.docker.DockerAlias(None, Some("delphihub"),"delphi-cli", Some(version.value)), |
| 82 | + dockerEntrypoint := Seq("/bin/bash"), |
| 83 | + dockerCommands ++= Seq( |
| 84 | + Cmd("USER", "root"), |
| 85 | + Cmd("RUN", "apk", "--no-cache", "add", "bash"), |
| 86 | + Cmd("RUN", "ln", "-s", "/opt/docker/bin/delphi", "/usr/bin/delphi" ), |
| 87 | + Cmd("USER", "daemon") |
| 88 | + ) |
| 89 | + ). |
36 | 90 | enablePlugins(ScalastylePlugin). |
37 | 91 | enablePlugins(BuildInfoPlugin). |
38 | 92 | enablePlugins(DebianPlugin). |
39 | 93 | enablePlugins(WindowsPlugin). |
40 | | - |
| 94 | + enablePlugins(GraalVMNativeImagePlugin). |
| 95 | + settings( |
| 96 | + graalVMNativeImageOptions ++= Seq( |
| 97 | + "--enable-https", |
| 98 | + "--enable-http", |
| 99 | + "--enable-all-security-services", |
| 100 | + "--allow-incomplete-classpath", |
| 101 | + "--enable-url-protocols=http,https" |
| 102 | + ) |
| 103 | + ). |
| 104 | + enablePlugins(JDKPackagerPlugin). |
41 | 105 | settings( |
42 | 106 | buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion), |
43 | | - buildInfoPackage := "de.upb.cs.swt.delphi.cli" |
| 107 | + buildInfoPackage := "de.upb.cs.swt.delphi.cli", |
| 108 | + crossScalaVersions := supportedScalaVersions |
44 | 109 | ) |
45 | 110 | scalastyleConfig := baseDirectory.value / "project" / "scalastyle-config.xml" |
46 | 111 |
|
47 | 112 | trapExit := false |
| 113 | +fork := true |
| 114 | +connectInput := true |
0 commit comments