Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 47 additions & 25 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
resolvers += Resolver.sonatypeRepo("releases")
resolvers += Resolver.sonatypeRepo("snapshots")

enablePlugins(ScalaJSPlugin)

val commonSettings = Seq(
organization := "com.github.kenbot",
scalaVersion in ThisBuild := "2.13.0",
Expand All @@ -12,41 +14,60 @@ val commonSettings = Seq(
scalacOptions in (Test, console) -= "-Ywarn-unused:imports"
)

lazy val goggles = project.in(file("."))
lazy val goggles = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.withoutSuffixFor(JVMPlatform)
.in(file("."))
.settings(moduleName := "goggles")
.settings(commonSettings)
.settings(noPublishSettings)
.aggregate(dslProject, macrosProject)
.dependsOn(dslProject, macrosProject)

lazy val macrosProject = (project in file("macros")).settings(
commonSettings,
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
libraryDependencies += "com.github.julien-truffaut" %% "monocle-core" % monocleVersion,
libraryDependencies ++= specs2Deps,
publishSettings,
moduleName := "goggles-macros",
scalacOptions += "-Yrangepos",
scalacOptions += "-language:experimental.macros"
)
lazy val macrosProject = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.withoutSuffixFor(JVMPlatform)
.in(file("macros"))
.settings(
commonSettings,
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
monocleDeps,
specs2Deps,
moduleName := "goggles-macros",
scalacOptions += "-Yrangepos",
scalacOptions += "-language:experimental.macros"
)
.jvmSettings(
publishSettings
)
.jsSettings(
noPublishSettings,
test in Test := streams.value.log.warn(
"JSPlatform tests disabled in macrosProject since macros are JVM compile-time feature."
)
)

val specs2Version = "4.6.0"
val specs2Version = "4.10.3"
val specs2Deps = Seq(
"org.specs2" %% "specs2-core" % specs2Version % "test",
"org.specs2" %% "specs2-scalacheck" % specs2Version % "test"
libraryDependencies += "org.specs2" %%% "specs2-core" % specs2Version % "test",
libraryDependencies += "org.specs2" %%% "specs2-scalacheck" % specs2Version % "test"
)

val monocleVersion = "1.6.0-RC1"
val monocleVersion = "1.7.3"
val monocleDeps = Seq(
"com.github.julien-truffaut" %% "monocle-core" % monocleVersion
libraryDependencies += "com.github.julien-truffaut" %%% "monocle-core" % monocleVersion
)

lazy val dslProject = (project in file("dsl")).
dependsOn(macrosProject).
settings(
lazy val dslProject = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.withoutSuffixFor(JVMPlatform)
.in(file("dsl"))
.dependsOn(macrosProject)
.settings(
commonSettings,
libraryDependencies ++= monocleDeps,
libraryDependencies ++= specs2Deps,
monocleDeps,
specs2Deps,
initialCommandSettings,
publishSettings,
moduleName := "goggles-dsl",
scalacOptions += "-Yrangepos",
Expand All @@ -68,7 +89,7 @@ val publishSettings = Seq(
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
sonatypeProfileName := "com.github.kenbot",
publishArtifact in Test := false,
Expand Down Expand Up @@ -109,10 +130,11 @@ val publishSettings = Seq(
)
)

initialCommands in dslProject := "import goggles._;"

initialCommands in (dslProject, Test) := """
lazy val initialCommandSettings = Seq(
initialCommands := "import goggles._;",
initialCommands in Test := """
import goggles._;
import Fixture._;
import testdsl._;
"""
)
2 changes: 2 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install:
- sbt '+ publishM2'
8 changes: 5 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.11")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.2.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.11")