|
| 1 | +import com.typesafe.sbt.SbtGit.GitKeys._ |
| 2 | + |
| 3 | +val scala212 = "2.12.10" |
| 4 | +val scala213 = "2.13.1" |
| 5 | + |
| 6 | +val sharedSettings = Seq( |
| 7 | + organization := "com.github.eikek", |
| 8 | + scalaVersion := scala212, |
| 9 | + scalacOptions ++= |
| 10 | + Seq("-feature", |
| 11 | + "-deprecation", |
| 12 | + "-unchecked", |
| 13 | + "-encoding", "UTF-8", |
| 14 | + "-language:higherKinds") ++ |
| 15 | + (if (scalaBinaryVersion.value.startsWith("2.12")) |
| 16 | + List("-Xfatal-warnings", // fail when there are warnings |
| 17 | + "-Xlint", |
| 18 | + "-Yno-adapted-args", |
| 19 | + "-Ywarn-dead-code", |
| 20 | + "-Ywarn-unused-import", |
| 21 | + "-Ypartial-unification", |
| 22 | + "-Ywarn-value-discard") |
| 23 | + else if (scalaBinaryVersion.value.startsWith("2.13")) |
| 24 | + List("-Werror" |
| 25 | + , "-Wdead-code" |
| 26 | + , "-Wunused" |
| 27 | + , "-Wvalue-discard") |
| 28 | + else |
| 29 | + Nil |
| 30 | + ), |
| 31 | + crossScalaVersions := Seq(scala212, scala213), |
| 32 | + scalacOptions in Test := Seq(), |
| 33 | + scalacOptions in (Compile, console) := Seq(), |
| 34 | + licenses := Seq("MIT" -> url("http://spdx.org/licenses/MIT")), |
| 35 | + homepage := Some(url("https://github.com/eikek/bitpeace")) |
| 36 | +) |
| 37 | + |
| 38 | +val testSettings = Seq( |
| 39 | + testFrameworks += new TestFramework("minitest.runner.Framework"), |
| 40 | + libraryDependencies ++= |
| 41 | + (Dependencies.miniTest ++ |
| 42 | + Dependencies.logback ++ |
| 43 | + Dependencies.greenmail). |
| 44 | + map(_ % Test) |
| 45 | +) |
| 46 | + |
| 47 | +val buildInfoSettings = Seq( |
| 48 | + buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion, gitHeadCommit, gitHeadCommitDate, gitUncommittedChanges, gitDescribedVersion), |
| 49 | + buildInfoOptions += BuildInfoOption.ToJson, |
| 50 | + buildInfoOptions += BuildInfoOption.BuildTime |
| 51 | +) |
| 52 | + |
| 53 | + |
| 54 | +lazy val common = project.in(file("modules/common")). |
| 55 | + settings(sharedSettings). |
| 56 | + settings(testSettings). |
| 57 | + settings( |
| 58 | + name := "emil-common", |
| 59 | + libraryDependencies ++= |
| 60 | + Dependencies.fs2 ++ |
| 61 | + Dependencies.fs2io |
| 62 | + ) |
| 63 | + |
| 64 | +lazy val javamail = project.in(file("modules/javamail")). |
| 65 | + settings(sharedSettings). |
| 66 | + settings(testSettings). |
| 67 | + settings( |
| 68 | + name := "emil-javamail", |
| 69 | + libraryDependencies ++= |
| 70 | + Dependencies.fs2 ++ |
| 71 | + Dependencies.fs2io ++ |
| 72 | + Dependencies.javaxMail ++ |
| 73 | + Dependencies.loggingApi |
| 74 | + ). |
| 75 | + dependsOn(common % "compile->compile;test->test") |
| 76 | + |
| 77 | + |
| 78 | +lazy val microsite = project.in(file("modules/microsite")). |
| 79 | + enablePlugins(MicrositesPlugin). |
| 80 | + settings(sharedSettings). |
| 81 | + settings( |
| 82 | + name := "emil-microsite", |
| 83 | + crossScalaVersions := Seq(), |
| 84 | + publishArtifact := false, |
| 85 | + skip in publish := true, |
| 86 | + scalaVersion := scala212, |
| 87 | + micrositeFooterText := Some( |
| 88 | + """ |
| 89 | + |<p>© 2019 <a href="https://github.com/eikek/emil">Emil, v{{site.version}}</a></p> |
| 90 | + |""".stripMargin |
| 91 | + ), |
| 92 | + micrositeName := "Emil", |
| 93 | + micrositeDescription := "Emil – E-Mail library for Scala", |
| 94 | + micrositeBaseUrl := "/emil", |
| 95 | + micrositeAuthor := "eikek", |
| 96 | + micrositeGithubOwner := "eikek", |
| 97 | + micrositeGithubRepo := "emil", |
| 98 | + micrositeGitterChannel := false, |
| 99 | + micrositeShareOnSocial := false, |
| 100 | + fork in tut := true, |
| 101 | + scalacOptions in Tut ++= |
| 102 | + Seq("-feature", |
| 103 | + "-deprecation", |
| 104 | + "-unchecked", |
| 105 | + "-encoding", "UTF-8", |
| 106 | + "-language:higherKinds"), |
| 107 | + micrositeCompilingDocsTool := WithTut |
| 108 | + ). |
| 109 | + dependsOn(common, javamail) |
| 110 | + |
| 111 | +val root = project.in(file(".")). |
| 112 | + settings(sharedSettings). |
| 113 | + settings( |
| 114 | + name := "emil-root" |
| 115 | + ). |
| 116 | + aggregate(common, javamail) |
0 commit comments