codec/build.sbt

152 lines
4.4 KiB
Plaintext
Raw Normal View History

2018-04-09 17:10:46 +03:00
import de.heikoseeberger.sbtheader.License
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
2019-01-21 19:29:24 +03:00
import sbtcrossproject.CrossPlugin.autoImport.crossProject
2018-04-09 17:10:46 +03:00
name := "codec"
scalacOptions in Compile ++= Seq("-Ypartial-unification", "-Xdisable-assertions")
javaOptions in Test ++= Seq("-ea")
2018-04-09 17:42:24 +03:00
skip in publish := true // Skip root project
2019-01-21 18:27:43 +03:00
val scalaV = scalaVersion := "2.12.8"
2018-04-09 17:10:46 +03:00
val commons = Seq(
scalaV,
2019-01-21 18:27:43 +03:00
version := "0.0.4",
2018-04-09 17:10:46 +03:00
fork in Test := true,
parallelExecution in Test := false,
2018-04-09 18:23:34 +03:00
organization := "one.fluence",
2018-04-09 17:10:46 +03:00
organizationName := "Fluence Labs Limited",
2018-04-09 18:23:34 +03:00
organizationHomepage := Some(new URL("https://fluence.one")),
2018-04-09 17:10:46 +03:00
startYear := Some(2017),
2018-04-09 17:42:24 +03:00
licenses += ("AGPL-V3", new URL("http://www.gnu.org/licenses/agpl-3.0.en.html")),
2018-04-25 17:42:29 +03:00
headerLicense := Some(License.AGPLv3("2017", organizationName.value)),
2018-04-09 17:42:24 +03:00
bintrayOrganization := Some("fluencelabs"),
2018-04-25 17:42:29 +03:00
publishMavenStyle := true,
bintrayRepository := "releases"
2018-04-09 17:10:46 +03:00
)
commons
2019-01-21 18:27:43 +03:00
val kindProjector = addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.9")
2018-04-09 17:10:46 +03:00
2019-01-21 18:27:43 +03:00
val Cats1V = "1.5.0"
val ScodecBitsV = "1.1.9"
val CirceV = "0.11.1"
2018-04-09 17:10:46 +03:00
val ShapelessV = "2.3.+"
2019-01-21 18:27:43 +03:00
val chill = "com.twitter" %% "chill" % "0.9.3"
2018-04-09 17:10:46 +03:00
2019-01-21 19:29:24 +03:00
val ScalatestV = "3.0.5"
2019-01-22 17:57:08 +03:00
// Note that cats-laws 1.5 are compiled against scalacheck 1.13, and scalacheck-shapeless should also not introduce the upgrade
2019-01-21 19:29:24 +03:00
val ScalacheckV = "1.13.5"
2018-04-09 17:10:46 +03:00
val protobuf = Seq(
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value
),
libraryDependencies ++= Seq(
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
)
)
enablePlugins(AutomateHeaderPlugin)
lazy val `codec-core` = crossProject(JVMPlatform, JSPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(FluenceCrossType)
.in(file("core"))
.settings(
commons,
kindProjector,
libraryDependencies ++= Seq(
2018-04-25 17:42:29 +03:00
"org.typelevel" %%% "cats-core" % Cats1V,
"org.typelevel" %%% "cats-testkit" % Cats1V % Test,
2019-01-22 17:57:08 +03:00
"com.github.alexarchambault" %%% "scalacheck-shapeless_1.13" % "1.1.8" % Test,
2018-04-25 17:42:29 +03:00
"org.scalacheck" %%% "scalacheck" % ScalacheckV % Test,
"org.scalatest" %%% "scalatest" % ScalatestV % Test
2018-04-09 17:10:46 +03:00
)
)
.jsSettings(
fork in Test := false
)
.enablePlugins(AutomateHeaderPlugin)
lazy val `codec-core-jvm` = `codec-core`.jvm
lazy val `codec-core-js` = `codec-core`.js
lazy val `codec-bits` = crossProject(JVMPlatform, JSPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(FluenceCrossType)
.in(file("bits"))
.settings(
commons,
libraryDependencies ++= Seq(
2018-04-25 17:42:29 +03:00
"org.scodec" %%% "scodec-bits" % ScodecBitsV,
"org.scalacheck" %%% "scalacheck" % ScalacheckV % Test,
"org.scalatest" %%% "scalatest" % ScalatestV % Test
2018-04-09 17:10:46 +03:00
)
)
.jsSettings(
fork in Test := false
)
.enablePlugins(AutomateHeaderPlugin)
.dependsOn(`codec-core`)
lazy val `codec-bits-js` = `codec-bits`.js
lazy val `codec-bits-jvm` = `codec-bits`.jvm
lazy val `codec-circe` = crossProject(JVMPlatform, JSPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(FluenceCrossType)
.in(file("circe"))
.settings(
commons,
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % CirceV,
"io.circe" %%% "circe-parser" % CirceV,
"org.scalatest" %%% "scalatest" % ScalatestV % Test
)
)
.jsSettings(
fork in Test := false
)
.enablePlugins(AutomateHeaderPlugin)
.dependsOn(`codec-core`)
lazy val `codec-circe-js` = `codec-circe`.js
lazy val `codec-circe-jvm` = `codec-circe`.jvm
lazy val `codec-kryo` = project
.in(file("kryo"))
.settings(
commons,
libraryDependencies ++= Seq(
chill,
2018-04-25 17:42:29 +03:00
"com.chuusai" %% "shapeless" % ShapelessV,
"org.scalatest" %% "scalatest" % ScalatestV % Test
2018-04-09 17:10:46 +03:00
)
)
.dependsOn(`codec-core-jvm`)
lazy val `codec-protobuf` = crossProject(JVMPlatform, JSPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(FluenceCrossType)
2018-04-09 18:50:46 +03:00
.in(file("protobuf"))
2018-04-09 17:10:46 +03:00
.settings(
commons,
protobuf
)
.jsSettings(
fork in Test := false,
scalaJSModuleKind := ModuleKind.CommonJSModule
)
.enablePlugins(AutomateHeaderPlugin)
.dependsOn(`codec-core`)
lazy val `codec-protobuf-jvm` = `codec-protobuf`.jvm
lazy val `codec-protobuf-js` = `codec-protobuf`.js