Guest User

Untitled

a guest
May 22nd, 2021
43
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lazy val scala213Version = "2.13.5"
  2. lazy val scala30Version = "3.0.0"
  3.  
  4. lazy val commonSettings = Seq(
  5. version := "0.1.0",
  6. scalaVersion := scala30Version,
  7. crossScalaVersions := Seq(scala213Version, scala30Version),
  8. libraryDependencies ++= Seq(
  9. "com.novocode" % "junit-interface" % "0.11" % "test",
  10. "com.lihaoyi" % "ammonite" % "2.3.8-124-2da846d2" % "test" cross CrossVersion.for3Use2_13With("", ".5")
  11. ),
  12. Test / sourceGenerators += Def.task {
  13. val file = (Test / sourceManaged).value / "amm.scala"
  14. IO.write(file, """object amm extends App { ammonite.Main.main(args) }""")
  15. Seq(file)
  16. }.taskValue,
  17. Test / fullClasspath ++= {
  18. (Test / updateClassifiers).value
  19. .configurations
  20. .find(_.configuration.name == Test.name)
  21. .get
  22. .modules
  23. .flatMap(_.artifacts)
  24. .collect{case (a, f) if a.classifier == Some("sources") => f}
  25. }
  26. )
  27.  
  28. lazy val collectioneer = project
  29. .in(file("."))
  30. .settings(commonSettings)
  31. .aggregate(
  32. core,
  33. cli,
  34. gui,
  35. repl
  36. )
  37.  
  38. lazy val core = project
  39. .in(file("modules/core"))
  40. .settings(commonSettings)
  41. .settings(
  42. name := "Collectioneer Core",
  43. libraryDependencies ++= Seq(
  44. "org.flywaydb" % "flyway-core" % "6.3.0",
  45. "com.h2database" % "h2" % "1.4.200" % "test",
  46. "org.tpolecat" %% "doobie-core" % "0.13.3",
  47. "org.tpolecat" %% "doobie-h2" % "0.13.3", // H2 extensions support
  48. "org.tpolecat" %% "doobie-hikari" % "0.13.3", // HikariCP transactor.
  49. )
  50. )
  51.  
  52. lazy val cli = project
  53. .in(file("modules/cli"))
  54. .settings(commonSettings)
  55. .settings(
  56. name := "Collectioneer CLI",
  57. libraryDependencies ++= Seq(
  58. "com.github.scopt" %% "scopt" % "4.0.1",
  59. )
  60. )
  61. .dependsOn(core)
  62.  
  63. lazy val repl = project
  64. .in(file("modules/repl"))
  65. .settings(commonSettings)
  66. .settings(
  67. name:= "Collectioneer REPL",
  68. libraryDependencies ++= Seq(
  69. "com.lihaoyi" %% "ammonite-terminal" % "2.3.8-124-2da846d2" cross CrossVersion.for3Use2_13
  70. )
  71. )
  72.  
  73. // Determine OS version of JavaFX binaries
  74. lazy val osName = System.getProperty("os.name") match {
  75. case n if n.startsWith("Linux") => "linux"
  76. case n if n.startsWith("Mac") => "mac"
  77. case n if n.startsWith("Windows") => "win"
  78. case _ => throw new Exception("Unknown platform!")
  79. }
  80. // Add JavaFX dependencies
  81. lazy val javaFXModules = Seq("base", "controls", "fxml", "graphics", "media", "swing", "web")
  82. lazy val gui = project
  83. .in(file("modules/gui"))
  84. .settings(commonSettings)
  85. .settings(
  86. name := "Collectioneer GUI",
  87. scalacOptions ++= Seq("-unchecked", "-deprecation", "-encoding", "utf8", "-feature"),
  88. fork := true,
  89. mainClass := Some("ScalaFXHelloWorld"),
  90. libraryDependencies ++= Seq(
  91. "org.scalafx" %% "scalafx" % "16.0.0-R24",
  92. ),
  93. libraryDependencies ++= javaFXModules.map(m =>
  94. "org.openjfx" % s"javafx-$m" % "16" classifier osName
  95. )
  96. )
  97. .dependsOn(core)
RAW Paste Data