build.sbt 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. lazy val root = project.in(file("."))
  2. .aggregate(
  3. plugin,
  4. library,
  5. playPlugin
  6. ).settings(
  7. crossScalaVersions := Nil,
  8. publish / skip := true,
  9. )
  10. def commonSettings = Seq(
  11. organization := "com.tflucke",
  12. //maintainer := "Thomas Flucke <admin@tflucke.name>",
  13. scalacOptions ++= Seq(
  14. "-deprecation",
  15. "-unchecked"
  16. ),
  17. crossScalaVersions := Seq("2.12.11", "2.12.10")
  18. )
  19. /****** The Actual Plugin ******/
  20. lazy val plugin = (project in file("plugin"))
  21. .enablePlugins(SbtPlugin)
  22. .settings(commonSettings)
  23. .settings(
  24. addSbtPlugin("org.portable-scala" % "sbt-platform-deps" % "1.0.0"),
  25. name := "sbt-rest-rpc",
  26. version := "0.1.0-SNAPSHOT",
  27. publishLocal := (publishLocal dependsOn (library / publishLocal)).value
  28. ).dependsOn(library)
  29. /****** The Plugin Library ******/
  30. lazy val library = (project in file("library"))
  31. .enablePlugins(ScalaJSPlugin)
  32. .settings(commonSettings)
  33. .settings(
  34. name := "rest-rpc",
  35. version := "0.1.0-SNAPSHOT",
  36. libraryDependencies ++= (if (scalaJSVersion.startsWith("0.6.")) Seq(
  37. // Wrapper library for JS dom to scala
  38. // Docs: https://scala-js.github.io/scala-js-dom/
  39. // Scaladocs: https://www.javadoc.io/doc/org.scala-js/scalajs-dom_sjs1.0.0-M7_2.12/0.9.6/org/scalajs/dom/index.html
  40. "org.scala-js" %%% "scalajs-dom" % "0.9.8",
  41. "com.typesafe.play" %%% "play-json" % "2.8.1"
  42. ) else Seq(
  43. "org.scala-js" %%% "scalajs-dom" % "1.0.0",
  44. "com.typesafe.play" %%% "play-json" % "2.9.0"
  45. ))
  46. )
  47. /******* The Play Plugin *******/
  48. lazy val playPlugin = (project in file("play"))
  49. .enablePlugins(SbtPlugin)
  50. .settings(commonSettings)
  51. .settings(
  52. addSbtPlugin("com.tflucke" % "sbt-rest-rpc" % "0.1.0-SNAPSHOT"),
  53. name := "sbt-rest-rpc-play",
  54. version := "0.1.0-SNAPSHOT",
  55. libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % Test,
  56. logBuffered in Test := false,
  57. javaOptions in Runtime += "-Dlibrary.version="+(library / version).value,
  58. scriptedLaunchOpts := { scriptedLaunchOpts.value ++ Seq(
  59. "-Xmx1024M",
  60. "-Dplugin.version="+version.value,
  61. ) },
  62. scriptedBufferLog := false,
  63. publishLocal := (publishLocal dependsOn (plugin / publishLocal)).value
  64. ).dependsOn(plugin)