Skip to content
Merged
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
93 changes: 47 additions & 46 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ lazy val buildSettings = Seq(
homepage := Option(url("http://47deg.github.io/fetch/")),
organizationHomepage := Option(new URL("http://47deg.com")),
scalaVersion := "2.12.0",
crossScalaVersions := Seq("2.11.8", "2.12.0"),
crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.0"),
headers := Map(
"scala" -> Apache2_0("2016", "47 Degrees, LLC. <http://www.47deg.com>")
)
)

lazy val commonSettings = Seq(
resolvers += Resolver.sonatypeRepo("releases"),
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-free" % "0.8.1",
"org.scalatest" %%% "scalatest" % "3.0.0" % "test",
compilerPlugin(
"org.spire-math" %% "kind-projector" % "0.9.3"
)
),
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-feature",
"-Ywarn-dead-code",
"-language:higherKinds",
"-language:existentials",
"-language:postfixOps"
),
scalafmtConfig := Some(file(".scalafmt.conf"))
) ++ reformatOnCompileSettings
resolvers += Resolver.sonatypeRepo("releases"),
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-free" % "0.8.1",
"org.scalatest" %%% "scalatest" % "3.0.0" % "test",
compilerPlugin(
"org.spire-math" %% "kind-projector" % "0.9.3"
)
),
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-feature",
"-Ywarn-dead-code",
"-language:higherKinds",
"-language:existentials",
"-language:postfixOps"
),
scalafmtConfig := Some(file(".scalafmt.conf"))
) ++ reformatOnCompileSettings

lazy val allSettings = buildSettings ++
commonSettings ++
Expand All @@ -55,44 +55,45 @@ lazy val allSettings = buildSettings ++
credentialSettings ++
sharedPublishSettings(gh, dev)

lazy val fetch = crossProject.in(file("."))
lazy val fetch = crossProject
.in(file("."))
.settings(moduleName := "fetch")
.settings(allSettings:_*)
.jsSettings(sharedJsSettings:_*)
.settings(allSettings: _*)
.jsSettings(sharedJsSettings: _*)
.enablePlugins(AutomateHeaderPlugin)

lazy val fetchJVM = fetch.jvm
lazy val fetchJS = fetch.js
lazy val fetchJS = fetch.js

lazy val root = project.in(file("."))
lazy val root = project
.in(file("."))
.aggregate(fetchJS, fetchJVM, fetchMonixJVM, fetchMonixJS)
.settings(allSettings)
.settings(noPublishSettings)

lazy val docsSettings = ghpages.settings ++ buildSettings ++ tutSettings ++ Seq(
git.remoteRepo := "git@github.com:47deg/fetch.git",
tutSourceDirectory := sourceDirectory.value / "tut",
tutTargetDirectory := sourceDirectory.value / "jekyll",
tutScalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code"))),
aggregate in doc := true
)
git.remoteRepo := "git@github.com:47deg/fetch.git",
tutSourceDirectory := sourceDirectory.value / "tut",
tutTargetDirectory := sourceDirectory.value / "jekyll",
tutScalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code"))),
aggregate in doc := true
)

lazy val docs = (project in file("docs"))
.settings(
moduleName := "fetch-docs"
)
)
.dependsOn(fetchJVM, fetchMonixJVM)
.enablePlugins(JekyllPlugin)
.settings(docsSettings: _*)
.settings(noPublishSettings)


lazy val readmeSettings = buildSettings ++ tutSettings ++ Seq(
tutSourceDirectory := baseDirectory.value,
tutTargetDirectory := baseDirectory.value.getParentFile,
tutScalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code"))),
tutNameFilter := """README.md""".r
)
tutSourceDirectory := baseDirectory.value,
tutTargetDirectory := baseDirectory.value.getParentFile,
tutScalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code"))),
tutNameFilter := """README.md""".r
)

lazy val readme = (project in file("tut"))
.settings(
Expand All @@ -103,20 +104,20 @@ lazy val readme = (project in file("tut"))
.settings(noPublishSettings)

lazy val monixSettings = (
libraryDependencies ++= Seq(
"io.monix" %%% "monix-eval" % "2.1.0",
"io.monix" %%% "monix-cats" % "2.1.0"
libraryDependencies ++= Seq(
"io.monix" %%% "monix-eval" % "2.1.0",
"io.monix" %%% "monix-cats" % "2.1.0"
)
)
)

lazy val monix = crossProject.in(file("monix"))
lazy val monix = crossProject
.in(file("monix"))
.dependsOn(fetch)
.settings(moduleName := "fetch-monix")
.settings(allSettings:_*)
.jsSettings(sharedJsSettings:_*)
.settings(allSettings: _*)
.jsSettings(sharedJsSettings: _*)
.settings(monixSettings: _*)
.enablePlugins(AutomateHeaderPlugin)


lazy val fetchMonixJVM = monix.jvm
lazy val fetchMonixJS = monix.js
32 changes: 16 additions & 16 deletions monix/shared/src/test/scala/FetchTaskTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ class FetchTaskTests extends AsyncFreeSpec with Matchers {
val fut: Future[List[Article]] = task.runAsync

fut.map(
_ shouldEqual List(
Article(1, "An article with id 1"),
Article(1, "An article with id 1"),
Article(2, "An article with id 2")
)
_ shouldEqual List(
Article(1, "An article with id 1"),
Article(1, "An article with id 1"),
Article(2, "An article with id 2")
)
)
}

Expand All @@ -110,18 +110,18 @@ class FetchTaskTests extends AsyncFreeSpec with Matchers {
val fut: Future[(List[Article], List[Author])] = task.runAsync

fut.map(
_ shouldEqual (
List(
Article(1, "An article with id 1"),
Article(1, "An article with id 1"),
Article(2, "An article with id 2")
),
List(
Author(2, "@egg2"),
Author(2, "@egg2"),
Author(3, "@egg3")
)
_ shouldEqual (
List(
Article(1, "An article with id 1"),
Article(1, "An article with id 1"),
Article(2, "An article with id 2")
),
List(
Author(2, "@egg2"),
Author(2, "@egg2"),
Author(3, "@egg3")
)
)
)
}
}
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4" exclude("com.typesafe.sbt", "sbt-git"))
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4" exclude ("com.typesafe.sbt", "sbt-git"))
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5")
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.6")
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.6")
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "0.4.8")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
Expand Down
5 changes: 2 additions & 3 deletions shared/src/main/scala/fetch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,11 @@ object `package` {
def run[M[_]]: FetchRunnerA[M] = new FetchRunnerA[M]
}

private[fetch] implicit class DataSourceCast[A, B](private val ds: DataSource[A, B])
extends AnyVal {
private[fetch] implicit class DataSourceCast[A, B](val ds: DataSource[A, B]) extends AnyVal {
def castDS[C, D]: DataSource[C, D] = ds.asInstanceOf[DataSource[C, D]]
}

private[fetch] implicit class NonEmptyListDetourList[A](private val nel: NonEmptyList[A])
private[fetch] implicit class NonEmptyListDetourList[A](val nel: NonEmptyList[A])
extends AnyVal {
def unsafeListOp[B](f: List[A] => List[B]): NonEmptyList[B] =
NonEmptyList.fromListUnsafe(f(nel.toList))
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "0.4.1-SNAPSHOT"
version in ThisBuild := "0.4.1-SNAPSHOT"